From a2d05ba49c200da8ab5b6b2bda2d42d2fecf97eb Mon Sep 17 00:00:00 2001 From: Squire as Brandon High <759848+highb@users.noreply.github.com> Date: Sat, 5 Sep 2026 00:29:39 +0000 Subject: [PATCH 1/3] feat(secret): add --shared-with-me list mode for recipient discovery Add cone secret list --shared-with-me, calling the caller-bound POST /api/v1/search/secrets/shared_with_me operation through the generated SDK (PaperSecret.SearchSecretsSharedWithMe). The default creator list (SearchMySecrets), its flags, help, and output stay unchanged; the new mode preserves pagination, query/status/type filters, enforces the endpoint's page_size<=100 and query<=256 limits, defaults include_own=false (opt-in via --include-own), and rejects an explicit --sharing-mode filter instead of silently dropping it, since the endpoint accepts no user_id, sort_by, or sharing_mode. Generalize the SDK-error-to-HTTPError mapping (mapPaperSecretCreateError -> mapPaperSecretError) so the shared search reports HTTP failures with the same shape as create. Co-authored-by: c1-squire-dev[bot] --- cmd/cone/secret.go | 151 ++++++++++++++++++++++++++++++--- cmd/cone/secret_test.go | 174 ++++++++++++++++++++++++++++++++++++++ pkg/client/client.go | 1 + pkg/client/secret.go | 37 +++++++- pkg/client/secret_test.go | 126 +++++++++++++++++++++++++++ 5 files changed, 474 insertions(+), 15 deletions(-) diff --git a/cmd/cone/secret.go b/cmd/cone/secret.go index 805afc5b..a5f67730 100644 --- a/cmd/cone/secret.go +++ b/cmd/cone/secret.go @@ -18,6 +18,7 @@ import ( "filippo.io/age" "github.com/spf13/cobra" + "github.com/spf13/viper" "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" "github.com/conductorone/cone/pkg/client" @@ -44,6 +45,9 @@ const ( secretStatusFlag = "status" secretTypeFlag = "type" secretSharingFlag = "sharing-mode" + sharedWithMeFlag = "shared-with-me" + includeOwnFlag = "include-own" + allFilter = "all" defaultSecretExpiry = "1w" formatPlaintext = "plaintext" formatJSON = "json" @@ -613,14 +617,16 @@ func createSecret(ctx context.Context, c secretCreator, p createSecretParams) (* func secretListCmd() *cobra.Command { cmd := &cobra.Command{ Use: "list", - Short: "List secrets you created", + Short: "List secrets you created or that were shared with you", RunE: secretListRun, } cmd.Flags().String(queryFlag, "", "Fuzzy search by display name.") cmd.Flags().String(secretStatusFlag, "active", "Status filter: active, expired, burned, revoked, data-deleted, or all.") - cmd.Flags().String(secretTypeFlag, "all", "Type filter: text, file, or all.") - cmd.Flags().String(secretSharingFlag, "all", "Sharing mode filter: internal, external, or all.") - cmd.Flags().Int(pageSizeFlag, 100, "Page size for API requests.") + cmd.Flags().String(secretTypeFlag, allFilter, "Type filter: text, file, or all.") + cmd.Flags().String(secretSharingFlag, allFilter, "Sharing mode filter: internal, external, or all. Incompatible with --shared-with-me.") + cmd.Flags().Bool(sharedWithMeFlag, false, "List secrets shared with you instead of secrets you created.") + cmd.Flags().Bool(includeOwnFlag, false, "With --shared-with-me, also include secrets you created and shared with yourself.") + cmd.Flags().Int(pageSizeFlag, 100, "Page size for API requests. Max 100 with --shared-with-me, 1000 otherwise.") return cmd } @@ -634,9 +640,31 @@ func secretListRun(cmd *cobra.Command, args []string) error { return err } + if v.GetBool(sharedWithMeFlag) { + return secretListSharedWithMeRun(ctx, c, v, cmd) + } + if cmd.Flags().Changed(includeOwnFlag) { + return fmt.Errorf("--%s requires --%s", includeOwnFlag, sharedWithMeFlag) + } + + req, err := buildSearchMySecretsRequest(v) + if err != nil { + return err + } + secrets, err := c.SearchMySecrets(ctx, req) + if err != nil { + return err + } + + resp := Secrets(secrets) + return output.NewManager(ctx, v).Output(ctx, &resp) +} + +// buildSearchMySecretsRequest assembles the creator-list request from CLI flags. +func buildSearchMySecretsRequest(v *viper.Viper) (*shared.PaperSecretServiceSearchMySecretsRequest, error) { pageSize := v.GetInt(pageSizeFlag) if pageSize <= 0 || pageSize > 1000 { - return fmt.Errorf("--%s must be between 1 and 1000", pageSizeFlag) + return nil, fmt.Errorf("--%s must be between 1 and 1000", pageSizeFlag) } req := &shared.PaperSecretServiceSearchMySecretsRequest{ PageSize: &pageSize, @@ -648,21 +676,38 @@ func secretListRun(cmd *cobra.Command, args []string) error { } statuses, err := secretListStatuses(v.GetString(secretStatusFlag)) if err != nil { - return err + return nil, err } req.Statuses = statuses secretType, err := secretListType(v.GetString(secretTypeFlag)) if err != nil { - return err + return nil, err } req.SecretType = secretType sharingMode, err := secretListSharingMode(v.GetString(secretSharingFlag)) if err != nil { - return err + return nil, err } req.SharingMode = sharingMode + return req, nil +} - secrets, err := c.SearchMySecrets(ctx, req) +// secretSharer is the subset of client.C1Client that the shared-with-me list +// path needs, narrowed so the flag-routing logic can be exercised with a +// lightweight fake in tests (same pattern as secretCreator). +type secretSharer interface { + SearchSecretsSharedWithMe(ctx context.Context, req *shared.PaperSecretServiceSearchSecretsSharedWithMeRequest) ([]shared.PaperSecret, error) +} + +// secretListSharedWithMeRun lists secrets shared with the caller. The endpoint is +// caller-bound: it accepts no user_id, sort_by, or sharing-mode filter, so those +// incompatibilities are rejected here rather than silently dropped. +func secretListSharedWithMeRun(ctx context.Context, c secretSharer, v *viper.Viper, cmd *cobra.Command) error { + req, err := buildSearchSecretsSharedWithMeRequest(v, cmd) + if err != nil { + return err + } + secrets, err := c.SearchSecretsSharedWithMe(ctx, req) if err != nil { return err } @@ -671,6 +716,44 @@ func secretListRun(cmd *cobra.Command, args []string) error { return output.NewManager(ctx, v).Output(ctx, &resp) } +// buildSearchSecretsSharedWithMeRequest assembles the recipient-list request +// from CLI flags. The endpoint is caller-bound: it accepts no user_id, sort_by, +// or sharing-mode filter, so those incompatibilities are rejected here rather +// than silently dropped. +func buildSearchSecretsSharedWithMeRequest(v *viper.Viper, cmd *cobra.Command) (*shared.PaperSecretServiceSearchSecretsSharedWithMeRequest, error) { + if cmd.Flags().Changed(secretSharingFlag) { + return nil, fmt.Errorf("--%s is not supported with --%s", secretSharingFlag, sharedWithMeFlag) + } + + pageSize := v.GetInt(pageSizeFlag) + if pageSize <= 0 || pageSize > 100 { + return nil, fmt.Errorf("--%s must be between 1 and 100 with --%s", pageSizeFlag, sharedWithMeFlag) + } + req := &shared.PaperSecretServiceSearchSecretsSharedWithMeRequest{ + PageSize: &pageSize, + } + if query := strings.TrimSpace(v.GetString(queryFlag)); query != "" { + if len(query) > 256 { + return nil, fmt.Errorf("--%s must be at most 256 characters with --%s", queryFlag, sharedWithMeFlag) + } + req.Query = &query + } + statuses, err := secretListSharedWithMeStatuses(v.GetString(secretStatusFlag)) + if err != nil { + return nil, err + } + req.Statuses = statuses + secretType, err := secretListSharedWithMeType(v.GetString(secretTypeFlag)) + if err != nil { + return nil, err + } + req.SecretType = secretType + if v.GetBool(includeOwnFlag) { + req.IncludeOwn = new(true) + } + return req, nil +} + func secretGetCmd() *cobra.Command { return &cobra.Command{ Use: "get ", @@ -1132,7 +1215,7 @@ func secretListStatuses(input string) ([]shared.PaperSecretServiceSearchMySecret return []shared.PaperSecretServiceSearchMySecretsRequestStatuses{ shared.PaperSecretServiceSearchMySecretsRequestStatusesSecretStatusActive, }, nil - case "all": + case allFilter: return nil, nil case "expired": return []shared.PaperSecretServiceSearchMySecretsRequestStatuses{ @@ -1158,7 +1241,7 @@ func secretListStatuses(input string) ([]shared.PaperSecretServiceSearchMySecret func secretListType(input string) (*shared.PaperSecretServiceSearchMySecretsRequestSecretType, error) { var secretType shared.PaperSecretServiceSearchMySecretsRequestSecretType switch strings.ToLower(strings.TrimSpace(input)) { - case "", "all": + case "", allFilter: return nil, nil case "text": secretType = shared.PaperSecretServiceSearchMySecretsRequestSecretTypeSecretTypeText @@ -1173,7 +1256,7 @@ func secretListType(input string) (*shared.PaperSecretServiceSearchMySecretsRequ func secretListSharingMode(input string) (*shared.PaperSecretServiceSearchMySecretsRequestSharingMode, error) { var sharingMode shared.PaperSecretServiceSearchMySecretsRequestSharingMode switch strings.ToLower(strings.TrimSpace(input)) { - case "", "all": + case "", allFilter: return nil, nil case "internal", "team": sharingMode = shared.PaperSecretServiceSearchMySecretsRequestSharingModePaperVaultSharingModeInternal @@ -1185,6 +1268,50 @@ func secretListSharingMode(input string) (*shared.PaperSecretServiceSearchMySecr return &sharingMode, nil } +func secretListSharedWithMeStatuses(input string) ([]shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses, error) { + switch strings.ToLower(strings.TrimSpace(input)) { + case "", "active": + return []shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses{ + shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusActive, + }, nil + case allFilter: + return nil, nil + case "expired": + return []shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses{ + shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusExpired, + }, nil + case "burned": + return []shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses{ + shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusBurned, + }, nil + case "revoked": + return []shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses{ + shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusRevoked, + }, nil + case "data-deleted": + return []shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses{ + shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusDataDeleted, + }, nil + default: + return nil, fmt.Errorf("--%s must be active, expired, burned, revoked, data-deleted, or all", secretStatusFlag) + } +} + +func secretListSharedWithMeType(input string) (*shared.PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType, error) { + var secretType shared.PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType + switch strings.ToLower(strings.TrimSpace(input)) { + case "", allFilter: + return nil, nil + case "text": + secretType = shared.PaperSecretServiceSearchSecretsSharedWithMeRequestSecretTypeSecretTypeText + case "file": + secretType = shared.PaperSecretServiceSearchSecretsSharedWithMeRequestSecretTypeSecretTypeFile + default: + return nil, fmt.Errorf("--%s must be text, file, or all", secretTypeFlag) + } + return &secretType, nil +} + func createInputFormat(name string) *shared.PaperSecretServiceCreateInternalRequestInputFormat { var format shared.PaperSecretServiceCreateInternalRequestInputFormat switch name { diff --git a/cmd/cone/secret_test.go b/cmd/cone/secret_test.go index 53764ff0..57995630 100644 --- a/cmd/cone/secret_test.go +++ b/cmd/cone/secret_test.go @@ -11,6 +11,8 @@ import ( "testing" "filippo.io/age" + "github.com/spf13/cobra" + "github.com/spf13/viper" "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" ) @@ -600,3 +602,175 @@ func TestEncryptFileToTemp(t *testing.T) { t.Fatalf("decrypt = %q, want %q", got, want) } } + +// sharedListHarness drives the shared-with-me list flag handling against a fake +// cobra/viper environment, without a live API: it verifies which request shape +// the flag logic builds and which client method it selects. +type sharedListHarness struct { + mySecretsCalled bool + sharedWithMeCalled bool + lastMySecretsReq *shared.PaperSecretServiceSearchMySecretsRequest + lastSharedWithMeReq *shared.PaperSecretServiceSearchSecretsSharedWithMeRequest +} + +func (h *sharedListHarness) SearchMySecrets(_ context.Context, req *shared.PaperSecretServiceSearchMySecretsRequest) ([]shared.PaperSecret, error) { + h.mySecretsCalled = true + h.lastMySecretsReq = req + return nil, nil +} + +func (h *sharedListHarness) SearchSecretsSharedWithMe(_ context.Context, req *shared.PaperSecretServiceSearchSecretsSharedWithMeRequest) ([]shared.PaperSecret, error) { + h.sharedWithMeCalled = true + h.lastSharedWithMeReq = req + return nil, nil +} + +func newSecretListCmdHarness(t *testing.T, flags map[string]string, boolFlags ...string) (*sharedListHarness, *cobra.Command) { + t.Helper() + h := &sharedListHarness{} + cmd := secretListCmd() + cmd.RunE = func(cmd *cobra.Command, _ []string) error { + ctx := cmd.Context() + v := viper.New() + for _, f := range boolFlags { + _ = cmd.Flags().Set(f, "true") + _ = v.BindPFlag(f, cmd.Flags().Lookup(f)) + } + for name, value := range flags { + _ = cmd.Flags().Set(name, value) + _ = v.BindPFlag(name, cmd.Flags().Lookup(name)) + } + for _, name := range []string{queryFlag, secretStatusFlag, secretTypeFlag, secretSharingFlag, pageSizeFlag, sharedWithMeFlag, includeOwnFlag} { + if cmd.Flags().Lookup(name) != nil && v.Get(name) == nil { + _ = v.BindPFlag(name, cmd.Flags().Lookup(name)) + } + } + return secretListRunForTest(ctx, h, v, cmd) + } + return h, cmd +} + +// secretListRunForTest executes the same flag-routing core secretListRun uses, +// against the harness, without the authenticated cmdContext. +func secretListRunForTest(ctx context.Context, h *sharedListHarness, v *viper.Viper, cmd *cobra.Command) error { + if v.GetBool(sharedWithMeFlag) { + return secretListSharedWithMeRun(ctx, h, v, cmd) + } + req, err := buildSearchMySecretsRequest(v) + if err != nil { + return err + } + _, err = h.SearchMySecrets(ctx, req) + return err +} + +func TestSecretListDefaultUsesCreatorEndpoint(t *testing.T) { + h, cmd := newSecretListCmdHarness(t, map[string]string{queryFlag: "reports"}) + if err := cmd.Execute(); err != nil { + t.Fatalf("Execute() unexpected error: %v", err) + } + if !h.mySecretsCalled { + t.Fatal("default list must call SearchMySecrets") + } + if h.sharedWithMeCalled { + t.Fatal("default list must not call SearchSecretsSharedWithMe") + } + if h.lastMySecretsReq == nil || h.lastMySecretsReq.Query == nil || *h.lastMySecretsReq.Query != "reports" { + t.Fatalf("creator request query = %+v, want reports", h.lastMySecretsReq) + } +} + +func TestSecretListSharedWithMeSelectsSharedEndpointWithoutUserID(t *testing.T) { + h, cmd := newSecretListCmdHarness(t, map[string]string{queryFlag: "shared-thing"}, sharedWithMeFlag) + if err := cmd.Execute(); err != nil { + t.Fatalf("Execute() unexpected error: %v", err) + } + if !h.sharedWithMeCalled { + t.Fatal("--shared-with-me must call SearchSecretsSharedWithMe") + } + if h.mySecretsCalled { + t.Fatal("--shared-with-me must not call SearchMySecrets") + } + req := h.lastSharedWithMeReq + if req == nil { + t.Fatal("shared-with-me request was nil") + } + if req.Query == nil || *req.Query != "shared-thing" { + t.Fatalf("query = %v, want shared-thing", req.Query) + } + // The shared endpoint is caller-bound: the generated request type has no + // user_id field at all, and cone must never smuggle one into the body. + if req.IncludeOwn != nil && *req.IncludeOwn { + t.Fatal("include_own must default to false") + } + if req.Statuses == nil { + t.Fatal("default status filter must be active") + } + if len(req.Statuses) != 1 || req.Statuses[0] != shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusActive { + t.Fatalf("statuses = %v, want [active]", req.Statuses) + } +} + +func TestSecretListSharedWithMeRejectsSharingModeFilter(t *testing.T) { + _, cmd := newSecretListCmdHarness(t, map[string]string{secretSharingFlag: "internal"}, sharedWithMeFlag) + err := cmd.Execute() + if err == nil { + t.Fatal("explicit --sharing-mode with --shared-with-me must fail") + } + if !strings.Contains(err.Error(), "not supported") { + t.Fatalf("error = %v, want sharing-mode incompatibility message", err) + } +} + +func TestSecretListSharedWithMePageSizeLimit(t *testing.T) { + _, cmd := newSecretListCmdHarness(t, map[string]string{pageSizeFlag: "500"}, sharedWithMeFlag) + err := cmd.Execute() + if err == nil { + t.Fatal("page size above 100 must fail with --shared-with-me") + } + if !strings.Contains(err.Error(), "100") { + t.Fatalf("error = %v, want page size limit message", err) + } +} + +func TestSecretListSharedWithMeQueryTooLong(t *testing.T) { + long := strings.Repeat("x", 257) + _, cmd := newSecretListCmdHarness(t, map[string]string{queryFlag: long}, sharedWithMeFlag) + if err := cmd.Execute(); err == nil { + t.Fatal("query longer than 256 characters must fail with --shared-with-me") + } +} + +func TestSecretListSharedWithMeIncludeOwn(t *testing.T) { + h, cmd := newSecretListCmdHarness(t, nil, sharedWithMeFlag, includeOwnFlag) + if err := cmd.Execute(); err != nil { + t.Fatalf("Execute() unexpected error: %v", err) + } + if h.lastSharedWithMeReq == nil || h.lastSharedWithMeReq.IncludeOwn == nil || !*h.lastSharedWithMeReq.IncludeOwn { + t.Fatal("include_own must be true when --include-own is passed") + } +} + +func TestSecretListSharedWithMeStatusesAndType(t *testing.T) { + h, cmd := newSecretListCmdHarness(t, map[string]string{secretStatusFlag: "burned", secretTypeFlag: "file"}, sharedWithMeFlag) + if err := cmd.Execute(); err != nil { + t.Fatalf("Execute() unexpected error: %v", err) + } + req := h.lastSharedWithMeReq + if req == nil { + t.Fatal("shared-with-me request was nil") + } + if len(req.Statuses) != 1 || req.Statuses[0] != shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusBurned { + t.Fatalf("statuses = %v, want [burned]", req.Statuses) + } + if req.SecretType == nil || *req.SecretType != shared.PaperSecretServiceSearchSecretsSharedWithMeRequestSecretTypeSecretTypeFile { + t.Fatalf("secret type = %v, want file", req.SecretType) + } +} + +func TestSecretListSharedWithMeInvalidStatus(t *testing.T) { + _, cmd := newSecretListCmdHarness(t, map[string]string{secretStatusFlag: "bogus"}, sharedWithMeFlag) + if err := cmd.Execute(); err == nil { + t.Fatal("invalid status must fail") + } +} diff --git a/pkg/client/client.go b/pkg/client/client.go index 3bca50e0..3d9c9dec 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -210,6 +210,7 @@ type C1Client interface { SearchMySecrets(ctx context.Context, req *shared.PaperSecretServiceSearchMySecretsRequest) ([]shared.PaperSecret, error) RevokeSecret(ctx context.Context, vaultID string) (*shared.PaperSecret, error) SearchSecretAuditEvents(ctx context.Context, vaultID string, pageSize int) ([]map[string]any, error) + SearchSecretsSharedWithMe(ctx context.Context, req *shared.PaperSecretServiceSearchSecretsSharedWithMeRequest) ([]shared.PaperSecret, error) SearchUsers(ctx context.Context, req *shared.SearchUsersRequest) ([]*shared.User, error) } diff --git a/pkg/client/secret.go b/pkg/client/secret.go index d5805b1a..07248939 100644 --- a/pkg/client/secret.go +++ b/pkg/client/secret.go @@ -47,7 +47,10 @@ func requirePaperSecretAgeSuite(operation string, returned *shared.PaperSecretSe return nil } -func mapPaperSecretCreateError(err error) error { +// mapPaperSecretError converts the generated SDK's 4XX/5XX *sdkerrors.SDKError +// into cone's *HTTPError so HTTP failures surface uniformly across paper-secret +// operations. Non-HTTP errors pass through unchanged. +func mapPaperSecretError(err error) error { var sdkErr *sdkerrors.SDKError if errors.As(err, &sdkErr) && sdkErr.StatusCode >= http.StatusBadRequest { return &HTTPError{StatusCode: sdkErr.StatusCode, Body: sdkErr.Body} @@ -70,7 +73,7 @@ func (c *client) CreateInternalSecret( resp, err := c.sdk.PaperSecret.CreateInternal(ctx, &request) if err != nil { - return nil, mapPaperSecretCreateError(err) + return nil, mapPaperSecretError(err) } if err := NewHTTPError(resp.RawResponse); err != nil { return nil, err @@ -99,7 +102,7 @@ func (c *client) CreateExternalSecret( resp, err := c.sdk.PaperSecret.CreateExternal(ctx, &request) if err != nil { - return nil, mapPaperSecretCreateError(err) + return nil, mapPaperSecretError(err) } if err := NewHTTPError(resp.RawResponse); err != nil { return nil, err @@ -290,6 +293,34 @@ func (c *client) RevokeSecret(ctx context.Context, vaultID string) (*shared.Pape return resp.PaperSecretServiceRevokeResponse.Secret, nil } +// SearchSecretsSharedWithMe returns secrets shared with the calling user, following +// next_page_token until the listing is complete. The request is caller-bound +// server-side; it carries no user_id and cone never sets one. +func (c *client) SearchSecretsSharedWithMe(ctx context.Context, req *shared.PaperSecretServiceSearchSecretsSharedWithMeRequest) ([]shared.PaperSecret, error) { + if req == nil { + req = &shared.PaperSecretServiceSearchSecretsSharedWithMeRequest{} + } + var out []shared.PaperSecret + for { + resp, err := c.sdk.PaperSecret.SearchSecretsSharedWithMe(ctx, req) + if err != nil { + return nil, mapPaperSecretError(err) + } + if err := NewHTTPError(resp.RawResponse); err != nil { + return nil, err + } + if resp.PaperSecretServiceSearchResponse != nil { + out = append(out, resp.PaperSecretServiceSearchResponse.List...) + token := StringFromPtr(resp.PaperSecretServiceSearchResponse.NextPageToken) + if token != "" { + req.PageToken = &token + continue + } + } + return out, nil + } +} + func (c *client) SearchSecretAuditEvents(ctx context.Context, vaultID string, pageSize int) ([]map[string]any, error) { req := &shared.PaperSecretServiceSearchAuditEventsRequest{ VaultID: &vaultID, diff --git a/pkg/client/secret_test.go b/pkg/client/secret_test.go index d1179c50..30549f37 100644 --- a/pkg/client/secret_test.go +++ b/pkg/client/secret_test.go @@ -234,3 +234,129 @@ type roundTripFunc func(*http.Request) (*http.Response, error) func (f roundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) { return f(req) } + +func TestSearchSecretsSharedWithMePaginatesWithFiltersPreserved(t *testing.T) { + type capturedRequest struct { + body map[string]any + } + var requests []capturedRequest + page := 0 + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/api/v1/search/secrets/shared_with_me" { + t.Errorf("path = %q, want /api/v1/search/secrets/shared_with_me", r.URL.Path) + w.WriteHeader(http.StatusNotFound) + return + } + if r.Method != http.MethodPost { + t.Errorf("method = %q, want POST", r.Method) + } + var body map[string]any + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + t.Errorf("Decode() unexpected error: %v", err) + } + requests = append(requests, capturedRequest{body: body}) + page++ + w.Header().Set("Content-Type", "application/json") + resp := shared.PaperSecretServiceSearchResponse{} + if page == 1 { + resp.NextPageToken = new("page-two") + resp.List = []shared.PaperSecret{{VaultID: new("vault-1")}} + } else { + resp.List = []shared.PaperSecret{{VaultID: new("vault-2")}} + } + if err := json.NewEncoder(w).Encode(resp); err != nil { + t.Errorf("Encode() unexpected error: %v", err) + } + })) + defer server.Close() + + c := newPaperSecretTestClient(server.URL, server.Client()) + req := &shared.PaperSecretServiceSearchSecretsSharedWithMeRequest{ + Query: new("deploy"), + Statuses: []shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses{shared.PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusActive}, + SecretType: shared.PaperSecretServiceSearchSecretsSharedWithMeRequestSecretTypeSecretTypeText.ToPointer(), + } + secrets, err := c.SearchSecretsSharedWithMe(context.Background(), req) + if err != nil { + t.Fatalf("SearchSecretsSharedWithMe() unexpected error: %v", err) + } + if len(secrets) != 2 { + t.Fatalf("secrets returned = %d, want 2 across two pages", len(secrets)) + } + if len(requests) != 2 { + t.Fatalf("requests sent = %d, want 2", len(requests)) + } + for i, cr := range requests { + if _, hasUserID := cr.body["userId"]; hasUserID { + t.Errorf("request %d carried userId; the endpoint is caller-bound", i+1) + } + if _, hasSortBy := cr.body["sortBy"]; hasSortBy { + t.Errorf("request %d carried sortBy; the endpoint does not accept it", i+1) + } + if _, hasSharing := cr.body["sharingMode"]; hasSharing { + t.Errorf("request %d carried sharingMode; the endpoint does not accept it", i+1) + } + if got, _ := cr.body["query"].(string); got != "deploy" { + t.Errorf("request %d query = %v, want deploy preserved across pages", i+1, got) + } + } + if _, hasToken := requests[1].body["pageToken"]; !hasToken { + t.Error("second request must carry pageToken from first response") + } +} + +func TestSearchSecretsSharedWithMeNeverSendsUserID(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + var body map[string]any + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + t.Errorf("Decode() unexpected error: %v", err) + } + if _, hasUserID := body["userId"]; hasUserID { + t.Error("request carried userId; the endpoint is caller-bound") + } + w.Header().Set("Content-Type", "application/json") + if err := json.NewEncoder(w).Encode(shared.PaperSecretServiceSearchResponse{}); err != nil { + t.Errorf("Encode() unexpected error: %v", err) + } + })) + defer server.Close() + + c := newPaperSecretTestClient(server.URL, server.Client()) + if _, err := c.SearchSecretsSharedWithMe(context.Background(), &shared.PaperSecretServiceSearchSecretsSharedWithMeRequest{}); err != nil { + t.Fatalf("SearchSecretsSharedWithMe() unexpected error: %v", err) + } +} + +func TestSearchSecretsSharedWithMePreservesHTTPErrorMapping(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusForbidden) + _, _ = w.Write([]byte(`{"code":"permission_denied"}`)) + })) + defer server.Close() + + c := newPaperSecretTestClient(server.URL, server.Client()) + _, err := c.SearchSecretsSharedWithMe(context.Background(), &shared.PaperSecretServiceSearchSecretsSharedWithMeRequest{}) + var httpErr *HTTPError + if !errors.As(err, &httpErr) { + t.Fatalf("error = %T, want *HTTPError", err) + } + if httpErr.StatusCode != http.StatusForbidden { + t.Fatalf("status code = %d, want %d", httpErr.StatusCode, http.StatusForbidden) + } +} + +func TestSearchSecretsSharedWithMeHonorsContextDeadline(t *testing.T) { + httpClient := &http.Client{Transport: roundTripFunc(func(req *http.Request) (*http.Response, error) { + <-req.Context().Done() + return nil, req.Context().Err() + })} + c := newPaperSecretTestClient("https://example.invalid", httpClient) + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + + _, err := c.SearchSecretsSharedWithMe(ctx, &shared.PaperSecretServiceSearchSecretsSharedWithMeRequest{}) + if !errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("error = %v, want context deadline exceeded", err) + } +} From a6dc1257e9f83f42824e592f5b6612052b122b53 Mon Sep 17 00:00:00 2001 From: Squire as Brandon High <759848+highb@users.noreply.github.com> Date: Sat, 5 Sep 2026 00:29:40 +0000 Subject: [PATCH 2/3] chore(deps): bump conductorone-sdk-go to regenerated SearchSecretsSharedWithMe build Pin github.com/conductorone/conductorone-sdk-go to v1.29.1-0.20260905002051-ef0d92d9c5f2 (the speakeasy-sdk-regen branch head carrying the generated PaperSecret.SearchSecretsSharedWithMe operation and its request/response models) and re-vendor. This is the established SDK generation output from the refreshed canonical OpenAPI input (insulator now serves the C1 main canonical spec including the shared_with_me route); no generated file is hand-edited. Re-pin to the v1.29.1 tag once conductorone-sdk-go PR #117 merges and publishes. Co-authored-by: c1-squire-dev[bot] --- go.mod | 2 +- go.sum | 4 +- .../conductorone-sdk-go/README.md | 163 + .../conductorone-sdk-go/RELEASES.md | 12 +- .../conductorone/conductorone-sdk-go/a2ui.go | 208 ++ .../accessreviewactions.go | 247 ++ .../conductorone-sdk-go/accessreviewreport.go | 242 ++ .../aigovernancesettings.go | 6 +- .../conductorone-sdk-go/appcap.go | 1515 ++++++++ .../appentitlementroutingrule.go | 18 +- .../conductorone-sdk-go/appentitlements.go | 17 +- .../appentitlementsearch.go | 217 ++ .../conductorone-sdk-go/appmanagedstate.go | 660 ++++ .../conductorone-sdk-go/automation.go | 2 +- .../conductorone-sdk-go/conductoroneapi.go | 42 +- .../conductorone-sdk-go/connector.go | 5 +- .../conductorone-sdk-go/contacts.go | 10 +- .../conductorone-sdk-go/feedback.go | 247 ++ .../conductorone-sdk-go/finding.go | 212 ++ .../conductorone-sdk-go/findingsettings.go | 452 +++ .../conductorone-sdk-go/functions.go | 12 +- .../functionsinvocation.go | 209 ++ .../conductorone-sdk-go/fundassignment.go | 1945 ++++++++++ .../conductorone-sdk-go/fundpolicy.go | 1735 +++++++++ .../conductorone-sdk-go/fundrule.go | 1521 ++++++++ .../conductorone-sdk-go/gatewaykey.go | 667 ++++ .../conductorone/conductorone-sdk-go/gen.yaml | 5 +- .../conductorone/conductorone-sdk-go/hooks.go | 18 +- .../conductorone-sdk-go/hookssearch.go | 4 +- .../conductorone-sdk-go/mcpaccessprofile.go | 214 ++ .../conductorone-sdk-go/mcpresource.go | 1093 ++++++ .../conductorone-sdk-go/mcpserver.go | 2 +- .../conductorone-sdk-go/myfundlimits.go | 1312 +++++++ .../conductorone-sdk-go/papersecret.go | 217 ++ ...pia2uiv1a2uiservicegetsurfaceprovenance.go | 73 + ...ccessreviewactionsservicegeneratereport.go | 72 + ...ssreviewv1accessreviewreportservicelist.go | 80 + ...ccessprofileservicesearchaccessprofiles.go | 81 + ...1apiaigovernancev1mcpresourceserviceget.go | 80 + ...apiaigovernancev1mcpresourceservicelist.go | 88 + ...vernancev1mcpresourceservicelisthistory.go | 96 + ...iaigovernancev1mcpresourceservicesearch.go | 80 + ...iaigovernancev1mcpresourceserviceupdate.go | 88 + ...c1apiaigovernancev1mcpserverservicelist.go | 8 + ...hservicesearchreachableresourcesforuser.go | 51 + .../c1apiappv1appentitlementslist.go | 16 + .../c1apiappv1appmanagedstateserviceget.go | 80 + .../c1apiappv1appmanagedstateservicelist.go | 88 + ...c1apiappv1appmanagedstateservicepromote.go | 88 + .../models/operations/c1apiappv1appscreate.go | 2 +- .../c1apiappv1connectorserviceforcesync.go | 3 +- ...ersationsserviceensureonboardingsession.go | 50 + ...feedbackv1feedbackservicecreatefeedback.go | 50 + ...ngv1findingserviceupdatefindingassignee.go | 72 + ...ndingsettingsservicelistfindingsettings.go | 50 + ...ingsettingsserviceupdatefindingsettings.go | 50 + ...nsinvocationservicegetresultdownloadurl.go | 72 + .../c1apifundsv1appcapservicedelete.go | 72 + .../c1apifundsv1appcapserviceget.go | 64 + .../c1apifundsv1appcapservicelist.go | 72 + .../c1apifundsv1appcapservicelisthistory.go | 80 + .../c1apifundsv1appcapservicesetlimit.go | 72 + .../c1apifundsv1appcapservicesuspend.go | 72 + .../c1apifundsv1appcapserviceunsuspend.go | 72 + ...dsv1fundassignmentserviceclearextension.go | 72 + ...c1apifundsv1fundassignmentservicedelete.go | 72 + .../c1apifundsv1fundassignmentserviceget.go | 64 + ...dsv1fundassignmentservicegrantextension.go | 72 + ...fundsv1fundassignmentservicelisthistory.go | 80 + ...c1apifundsv1fundassignmentservicesearch.go | 50 + ...apifundsv1fundassignmentservicesetlimit.go | 72 + ...1apifundsv1fundassignmentservicesuspend.go | 72 + ...pifundsv1fundassignmentserviceunsuspend.go | 72 + .../c1apifundsv1fundpolicyservicecreate.go | 50 + .../c1apifundsv1fundpolicyservicedelete.go | 50 + ...apifundsv1fundpolicyservicefreezetenant.go | 50 + .../c1apifundsv1fundpolicyserviceget.go | 50 + ...1apifundsv1fundpolicyservicelisthistory.go | 72 + ...pifundsv1fundpolicyservicesetorgceiling.go | 50 + ...ifundsv1fundpolicyserviceunfreezetenant.go | 50 + .../c1apifundsv1fundpolicyserviceupdate.go | 50 + .../c1apifundsv1fundruleservicecreate.go | 50 + .../c1apifundsv1fundruleservicedelete.go | 72 + .../c1apifundsv1fundruleserviceget.go | 64 + .../c1apifundsv1fundruleservicelist.go | 72 + .../c1apifundsv1fundruleservicelisthistory.go | 80 + .../c1apifundsv1fundruleservicesearch.go | 50 + .../c1apifundsv1fundruleserviceupdate.go | 72 + .../c1apifundsv1myfundlimitsservicedelete.go | 72 + .../c1apifundsv1myfundlimitsservicelist.go | 72 + ...pifundsv1myfundlimitsservicelisthistory.go | 80 + .../c1apifundsv1myfundlimitsservicepause.go | 72 + .../c1apifundsv1myfundlimitsserviceresume.go | 72 + ...c1apifundsv1myfundlimitsservicesetlimit.go | 72 + ...1apifundsv1subjectapplimitservicedelete.go | 80 + .../c1apifundsv1subjectapplimitserviceget.go | 72 + ...undsv1subjectapplimitservicelisthistory.go | 88 + ...1apifundsv1subjectapplimitservicesearch.go | 50 + ...pifundsv1subjectapplimitservicesetlimit.go | 80 + ...apifundsv1subjectapplimitservicesuspend.go | 80 + ...ifundsv1subjectapplimitserviceunsuspend.go | 80 + .../c1apillmgatewayv1gatewaykeyservicelist.go | 50 + .../c1apillmgatewayv1gatewaykeyservicemint.go | 50 + ...1apillmgatewayv1gatewaykeyservicerevoke.go | 72 + ...gatewayv1providercredentialserviceclear.go | 72 + ...lmgatewayv1providercredentialserviceget.go | 64 + ...lmgatewayv1providercredentialserviceset.go | 72 + .../c1apireportingv1reportingservicedelete.go | 72 + .../c1apireportingv1reportingserviceget.go | 64 + ...pireportingv1reportingservicegetprogram.go | 72 + ...rtingv1reportingservicegetrunprovenance.go | 72 + .../c1apireportingv1reportingservicelist.go | 72 + .../c1apireportingv1reportingservicerun.go | 72 + .../c1apireportingv1reportingservicesave.go | 50 + .../c1apireportingv1reportingserviceupdate.go | 72 + ...tcatalogmanagementserviceplantypechange.go | 72 + ...mentserviceevaluateentitlementselection.go | 73 + ...rsecretservicesearchsecretssharedwithme.go | 50 + ...npolicyservicegeteffectivesessionpolicy.go | 65 + ...yv1sessionpolicyservicelistuserpolicies.go | 66 + ...v1sessionpolicyservicesearchpolicyusers.go | 75 + ...nservicebatchdeletesubjectcompatibility.go | 81 + ...nservicebatchimportsubjectcompatibility.go | 81 + .../c1apissov1ssoapplicationservicecreate.go | 72 + ...issov1ssoapplicationservicecreateclient.go | 81 + .../c1apissov1ssoapplicationservicedelete.go | 80 + ...issov1ssoapplicationservicedeleteclient.go | 80 + .../c1apissov1ssoapplicationserviceget.go | 72 + .../c1apissov1ssoapplicationservicelist.go | 80 + ...pissov1ssoapplicationservicelistclients.go | 89 + ...pissov1ssoapplicationservicelisthistory.go | 89 + ...serviceparsesamlserviceprovidermetadata.go | 52 + ...ssoapplicationservicerotateclientsecret.go | 81 + .../c1apissov1ssoapplicationservicesearch.go | 50 + .../c1apissov1ssoapplicationserviceupdate.go | 80 + ...issov1ssoapplicationserviceupdateclient.go | 80 + .../c1apissov1ssosettingsserviceget.go | 50 + ...c1apissov1ssosettingsservicelisthistory.go | 72 + .../c1apissov1ssosettingsserviceupdate.go | 50 + ...skv1taskactionsserviceretryprovisioning.go | 72 + ...controlplaneservicegetdiscoverysnapshot.go | 64 + ...ev1tbcontrolplaneservicegetegresspolicy.go | 64 + ...anev1tbcontrolplaneservicepushdiscovery.go | 50 + ...v1tbcontrolplaneservicesaveegresspolicy.go | 50 + .../pkg/models/shared/a2uicomponent.go | 18 + .../pkg/models/shared/a2uiprovenanceobject.go | 91 + .../pkg/models/shared/a2uiprovenancesource.go | 96 + .../pkg/models/shared/a2uiprovenancestep.go | 122 + .../models/shared/a2uiprovenancetoolcall.go | 52 + .../pkg/models/shared/a2uireportedittarget.go | 37 + ...a2uiservicegetsurfaceprovenanceresponse.go | 126 + .../pkg/models/shared/a2uisurface.go | 18 + ...viewactionsservicegeneratereportrequest.go | 56 + ...iewactionsservicegeneratereportresponse.go | 7 + .../models/shared/accessreviewcolumnconfig.go | 17 +- .../pkg/models/shared/accessreviewreport.go | 135 + .../shared/accessreviewreportcolumnconfig.go | 71 + .../accessreviewreportservicelistresponse.go | 25 + .../shared/accessreviewtaskcolumnref.go | 91 + .../pkg/models/shared/accessreviewtemplate.go | 18 + .../pkg/models/shared/aigovernancesettings.go | 17 +- .../pkg/models/shared/app.go | 20 +- .../pkg/models/shared/appcap.go | 65 + .../pkg/models/shared/appcaphistoryentry.go | 23 + .../shared/appcapservicedeleterequest.go | 7 + .../shared/appcapservicedeleteresponse.go | 7 + .../models/shared/appcapservicegetresponse.go | 15 + .../appcapservicelisthistoryresponse.go | 25 + .../shared/appcapservicelistresponse.go | 25 + .../shared/appcapservicesetlimitrequest.go | 51 + .../shared/appcapservicesetlimitresponse.go | 15 + .../shared/appcapservicesuspendrequest.go | 16 + .../shared/appcapservicesuspendresponse.go | 15 + .../shared/appcapserviceunsuspendrequest.go | 7 + .../shared/appcapserviceunsuspendresponse.go | 15 + ...esearchreachableresourcesforuserrequest.go | 53 + ...searchreachableresourcesforuserresponse.go | 28 + .../appentitlementuserbindinghistory.go | 9 + .../pkg/models/shared/appmanagedstate.go | 27 + .../models/shared/appmanagedstatebinding.go | 91 + .../appmanagedstatebindingexpandmask.go | 16 + .../shared/appmanagedstatebindingref.go | 8 +- .../shared/appmanagedstatebindingview.go | 33 + .../models/shared/appmanagedstatemanaged.go | 16 + .../models/shared/appmanagedstateunmanaged.go | 7 + .../pkg/models/shared/appmatchbatonref.go | 35 + .../pkg/models/shared/appuser.go | 93 +- .../shared/appuserservicesearchrequest.go | 68 + .../pkg/models/shared/blockoutputconfig.go | 53 + .../pkg/models/shared/blocktoolcallconfig.go | 19 + .../pkg/models/shared/builtinpattern.go | 63 + .../models/shared/bulkassignowneraction.go | 12 +- .../pkg/models/shared/bulkreprocessaction.go | 48 + .../shared/bulkupdatefindingstaterequest.go | 9 + .../pkg/models/shared/bundleautomationref.go | 16 + .../pkg/models/shared/c1metriccard.go | 82 + .../models/shared/c1metriccardscomponent.go | 36 + .../pkg/models/shared/c1tablecomponent.go | 88 + .../pkg/models/shared/c1tablerow.go | 21 + .../pkg/models/shared/c1userfilter.go | 28 + .../shared/clearprovidercredentialrequest.go | 7 + .../shared/clearprovidercredentialresponse.go | 15 + .../pkg/models/shared/clientcontext.go | 88 + .../pkg/models/shared/composite.go | 18 +- .../pkg/models/shared/connectoractionref.go | 19 +- .../pkg/models/shared/connectorexpandmask.go | 3 +- .../shared/connectorsyncfailingevidence.go | 60 + .../models/shared/connectorsyncfailingtype.go | 10 + .../pkg/models/shared/createapprequest.go | 14 +- .../pkg/models/shared/createappresponse.go | 2 +- .../models/shared/createfeedbackrequest.go | 41 + .../models/shared/createfeedbackresponse.go | 26 + ...reatemanuallymanagedresourcetyperequest.go | 3 +- .../pkg/models/shared/createpolicyrequest.go | 23 +- .../pkg/models/shared/createrevoketasksv2.go | 45 +- .../shared/credentialexpiringevidence.go | 40 + .../models/shared/credentialexpiringtype.go | 34 + .../models/shared/credentialissuetarget.go | 71 + .../shared/credentialissuetargetinput.go | 9 + .../credentialpubliclyexposedevidence.go | 93 + .../shared/credentialpubliclyexposedtype.go | 68 + .../pkg/models/shared/datadogcontext.go | 75 + .../pkg/models/shared/datefield.go | 62 + .../models/shared/deactivatedownerdetail.go | 53 + .../models/shared/deactivatedownerevidence.go | 16 + .../pkg/models/shared/deactivatedownertype.go | 45 + .../shared/decoypubliclyexposedevidence.go | 93 + .../models/shared/decoypubliclyexposedtype.go | 27 + .../models/shared/deviceplacementprovision.go | 16 + .../shared/disabledreasoncircuitbreaker.go | 22 +- .../pkg/models/shared/effectiveuserpolicy.go | 58 + .../pkg/models/shared/emailchannelsettings.go | 16 + .../shared/encodedcontentguardconfig.go | 36 + .../shared/ensureonboardingsessionrequest.go | 7 + .../shared/ensureonboardingsessionresponse.go | 25 + .../shared/entitlementcutoffimpactpoint.go | 36 + .../pkg/models/shared/entitlementref.go | 6 +- .../evaluateentitlementselectionrequest.go | 45 + .../evaluateentitlementselectionresponse.go | 36 + .../pkg/models/shared/evaluateexpressions.go | 2 + .../pkg/models/shared/expression.go | 2 + .../pkg/models/shared/externalclientinfo.go | 3 +- .../pkg/models/shared/finding.go | 194 +- .../pkg/models/shared/findingaudience.go | 21 + .../pkg/models/shared/findingaudienceusers.go | 16 + .../pkg/models/shared/findingauditevent.go | 5 +- .../findingauditservicesearchrequest.go | 5 +- .../pkg/models/shared/findingdispatcher.go | 117 + .../shared/findingdispatchoutcomenotify.go | 34 + .../pkg/models/shared/findingroutingrule.go | 54 + .../pkg/models/shared/findingsearchrequest.go | 53 +- .../pkg/models/shared/findingsettingsentry.go | 67 + .../shared/findingtransformationrule.go | 45 + .../pkg/models/shared/findingtypesetting.go | 67 + .../pkg/models/shared/forcesyncresponse.go | 4 +- .../pkg/models/shared/formstringfield.go | 9 + .../pkg/models/shared/function.go | 57 +- .../pkg/models/shared/functioninvocation.go | 29 +- .../shared/functioninvocationresultref.go | 102 + ...tionservicegetresultdownloadurlresponse.go | 16 + .../models/shared/functionssearchrequest.go | 3 +- .../functionsservicecreatefunctionrequest.go | 13 +- .../functionsserviceupdatefunctionrequest.go | 26 +- .../functionsserviceupdatefunctionresponse.go | 10 +- .../pkg/models/shared/fundassignment.go | 65 + .../shared/fundassignmenthistoryentry.go | 23 + ...dassignmentserviceclearextensionrequest.go | 7 + ...assignmentserviceclearextensionresponse.go | 15 + .../fundassignmentservicedeleterequest.go | 7 + .../fundassignmentservicedeleteresponse.go | 7 + .../fundassignmentservicegetresponse.go | 15 + ...dassignmentservicegrantextensionrequest.go | 48 + ...assignmentservicegrantextensionresponse.go | 15 + ...undassignmentservicelisthistoryresponse.go | 25 + .../fundassignmentservicesearchrequest.go | 34 + .../fundassignmentservicesearchresponse.go | 25 + .../fundassignmentservicesetlimitrequest.go | 51 + .../fundassignmentservicesetlimitresponse.go | 15 + .../fundassignmentservicesuspendrequest.go | 16 + .../fundassignmentservicesuspendresponse.go | 15 + .../fundassignmentserviceunsuspendrequest.go | 7 + .../fundassignmentserviceunsuspendresponse.go | 15 + .../pkg/models/shared/fundpolicy.go | 112 + .../models/shared/fundpolicyhistoryentry.go | 23 + .../shared/fundpolicyservicecreaterequest.go | 61 + .../shared/fundpolicyservicecreateresponse.go | 15 + .../shared/fundpolicyservicedeleterequest.go | 7 + .../shared/fundpolicyservicedeleteresponse.go | 7 + .../fundpolicyservicefreezetenantrequest.go | 16 + .../fundpolicyservicefreezetenantresponse.go | 15 + .../shared/fundpolicyservicegetresponse.go | 15 + .../fundpolicyservicelisthistoryresponse.go | 25 + .../fundpolicyservicesetorgceilingrequest.go | 51 + .../fundpolicyservicesetorgceilingresponse.go | 15 + .../fundpolicyserviceunfreezetenantrequest.go | 7 + ...fundpolicyserviceunfreezetenantresponse.go | 15 + .../shared/fundpolicyserviceupdaterequest.go | 23 + .../shared/fundpolicyserviceupdateresponse.go | 15 + .../pkg/models/shared/fundrule.go | 94 + .../pkg/models/shared/fundrulehistoryentry.go | 23 + .../shared/fundruleservicecreaterequest.go | 41 + .../shared/fundruleservicecreateresponse.go | 15 + .../shared/fundruleservicedeleterequest.go | 7 + .../shared/fundruleservicedeleteresponse.go | 7 + .../shared/fundruleservicegetresponse.go | 15 + .../fundruleservicelisthistoryresponse.go | 25 + .../shared/fundruleservicelistresponse.go | 25 + .../shared/fundruleservicesearchrequest.go | 34 + .../shared/fundruleservicesearchresponse.go | 25 + .../shared/fundruleserviceupdaterequest.go | 23 + .../shared/fundruleserviceupdateresponse.go | 15 + .../pkg/models/shared/gatewaykey.go | 74 + .../getappmanagedstatebindingresponse.go | 60 + .../shared/getcustomanalysisresultresponse.go | 9 + .../shared/getprovidercredentialresponse.go | 15 + .../pkg/models/shared/grantfilter.go | 18 +- .../pkg/models/shared/hook.go | 49 +- .../pkg/models/shared/hookfilter.go | 19 +- .../shared/hooksservicecreaterequest.go | 27 +- .../pkg/models/shared/introspectresponse.go | 34 + .../models/shared/invokefunctiondispatcher.go | 35 + .../pkg/models/shared/jsonpatchconfig.go | 37 + .../pkg/models/shared/linkfilterconfig.go | 61 + .../listappmanagedstatebindingsresponse.go | 70 + .../shared/listfindingsettingsresponse.go | 30 + .../models/shared/listgatewaykeysresponse.go | 25 + .../pkg/models/shared/mcpaccessprofile.go | 22 + .../models/shared/mcpaccessprofileinput.go | 110 + ...fileservicesearchaccessprofilesresponse.go | 27 + .../mcpaccessprofileserviceupdaterequest.go | 6 +- .../pkg/models/shared/mcpresource.go | 408 +++ .../models/shared/mcpresourcehistoryentry.go | 23 + .../shared/mcpresourceservicegetresponse.go | 15 + .../mcpresourceservicelisthistoryresponse.go | 25 + .../shared/mcpresourceservicelistresponse.go | 25 + .../shared/mcpresourceservicesearchrequest.go | 182 + .../mcpresourceservicesearchresponse.go | 25 + .../shared/mcpresourceserviceupdaterequest.go | 23 + .../mcpresourceserviceupdateresponse.go | 15 + .../models/shared/mcpservercatalogauthmode.go | 47 + .../models/shared/mcpservercatalogentry.go | 13 + .../shared/mcpserverserviceregisterrequest.go | 13 + .../mcpserverserviceregisterresponse.go | 14 +- .../pkg/models/shared/mcpserverview.go | 15 +- .../pkg/models/shared/mcptool.go | 22 + .../shared/mcptoolservicesearchrequest.go | 50 +- .../models/shared/mintgatewaykeyrequest.go | 16 + .../models/shared/mintgatewaykeyresponse.go | 24 + .../pkg/models/shared/money.go | 57 + .../pkg/models/shared/msteamschannel.go | 25 + .../models/shared/msteamschannelsettings.go | 16 + .../pkg/models/shared/myfundlimit.go | 66 + .../models/shared/myfundlimithistoryentry.go | 23 + .../myfundlimitsservicedeleterequest.go | 7 + .../myfundlimitsservicedeleteresponse.go | 7 + .../myfundlimitsservicelisthistoryresponse.go | 25 + .../shared/myfundlimitsservicelistresponse.go | 25 + .../shared/myfundlimitsservicepauserequest.go | 16 + .../myfundlimitsservicepauseresponse.go | 15 + .../myfundlimitsserviceresumerequest.go | 7 + .../myfundlimitsserviceresumeresponse.go | 15 + .../myfundlimitsservicesetlimitrequest.go | 51 + .../myfundlimitsservicesetlimitresponse.go | 15 + .../pkg/models/shared/notifydispatcher.go | 70 + .../pkg/models/shared/oidcclaimmapping.go | 62 + ...servicesearchsecretssharedwithmerequest.go | 114 + .../models/shared/payloadfindingdispatch.go | 52 + .../pkg/models/shared/policy.go | 54 +- .../pkg/models/shared/policyscope.go | 61 + .../pkg/models/shared/policyuser.go | 58 + .../pkg/models/shared/pretoolblockconfig.go | 19 + .../pkg/models/shared/programref.go | 51 + .../promoteappmanagedstatebindingrequest.go | 34 + .../shared/promptinjectionscanconfig.go | 55 + .../pkg/models/shared/providercredential.go | 116 + .../pkg/models/shared/provisioninstance.go | 13 +- .../pkg/models/shared/provisionpolicy.go | 25 +- .../pkg/models/shared/provisionpolicyinput.go | 25 +- .../pkg/models/shared/provisionwaitingon.go | 59 + .../pkg/models/shared/recurrencerule.go | 13 +- .../pkg/models/shared/report.go | 137 + .../shared/reportingservicedeleterequest.go | 7 + .../shared/reportingservicedeleteresponse.go | 7 + .../reportingservicegetprogramresponse.go | 25 + .../shared/reportingservicegetresponse.go | 42 + ...eportingservicegetrunprovenanceresponse.go | 97 + .../shared/reportingservicelistresponse.go | 25 + .../shared/reportingservicerunrequest.go | 7 + .../shared/reportingservicerunresponse.go | 15 + .../shared/reportingservicesaverequest.go | 66 + .../shared/reportingservicesaveresponse.go | 15 + .../shared/reportingserviceupdaterequest.go | 46 + .../shared/reportingserviceupdateresponse.go | 15 + .../pkg/models/shared/reportrun.go | 330 ++ .../pkg/models/shared/reportsource.go | 64 + .../pkg/models/shared/requestcatalog.go | 54 + ...stcatalogmanagementservicecreaterequest.go | 50 + ...gmanagementserviceplantypechangerequest.go | 42 + ...managementserviceplantypechangeresponse.go | 91 + .../pkg/models/shared/requestcatalogref.go | 16 + .../shared/requestcatalogtypechangeimpact.go | 144 + .../requestcatalogtypechangeimpactref.go | 36 + .../models/shared/requestcreatedpreference.go | 25 + .../pkg/models/shared/requestsettings.go | 12 + .../models/shared/revokegatewaykeyrequest.go | 7 + .../models/shared/revokegatewaykeyresponse.go | 15 + .../pkg/models/shared/rule.go | 51 +- .../pkg/models/shared/samlattributemapping.go | 71 + .../pkg/models/shared/samlmetadatafinding.go | 90 + .../pkg/models/shared/screenshot.go | 68 + .../shared/searchappresourcesrequest.go | 18 +- .../models/shared/searchcohortusersrequest.go | 5 +- .../shared/searchcohortusersresponse.go | 5 +- .../models/shared/searchpoliciesrequest.go | 133 + .../shared/searchstepuptransactionsrequest.go | 18 +- .../pkg/models/shared/searchusersrequest.go | 11 + .../pkg/models/shared/secretsmaskingconfig.go | 28 + ...ervicegeteffectivesessionpolicyresponse.go | 60 + ...onpolicyservicelistuserpoliciesresponse.go | 19 + ...onpolicyservicesearchpolicyusersrequest.go | 76 + ...npolicyservicesearchpolicyusersresponse.go | 27 + .../shared/sessionpolicystepuprequired.go | 24 +- .../shared/setprovidercredentialrequest.go | 58 + .../shared/setprovidercredentialresponse.go | 15 + .../pkg/models/shared/shadowmcpevidence.go | 27 + .../pkg/models/shared/shadowmcptype.go | 22 + .../pkg/models/shared/slackchannelsettings.go | 16 + .../pkg/models/shared/slackchanneltarget.go | 28 + .../pkg/models/shared/spendcontrols.go | 81 + .../pkg/models/shared/spendextension.go | 52 + .../pkg/models/shared/spendlimit.go | 39 + .../pkg/models/shared/spendlimitamount.go | 15 + .../pkg/models/shared/spendlimitblocked.go | 10 + .../pkg/models/shared/spendlimitunlimited.go | 10 + .../pkg/models/shared/spendsuspension.go | 43 + .../pkg/models/shared/ssoapplication.go | 179 + .../shared/ssoapplicationhistoryentry.go | 25 + .../models/shared/ssoapplicationoidcclient.go | 125 + ...licationoidcclientauthclientsecretbasic.go | 7 + ...plicationoidcclientauthclientsecretpost.go | 7 + .../ssoapplicationoidcclientauthentication.go | 47 + .../ssoapplicationoidcclientauthnone.go | 7 + ...oapplicationoidcclientauthprivatekeyjwt.go | 19 + .../shared/ssoapplicationoidcclientconfig.go | 75 + .../models/shared/ssoapplicationoidcconfig.go | 51 + .../models/shared/ssoapplicationsamlconfig.go | 179 + ...ebatchdeletesubjectcompatibilityrequest.go | 18 + ...batchdeletesubjectcompatibilityresponse.go | 27 + ...ebatchimportsubjectcompatibilityrequest.go | 37 + ...batchimportsubjectcompatibilityresponse.go | 77 + ...soapplicationservicecreateclientrequest.go | 17 + ...oapplicationservicecreateclientresponse.go | 27 + .../ssoapplicationservicecreaterequest.go | 116 + .../ssoapplicationservicecreateresponse.go | 33 + ...soapplicationservicedeleteclientrequest.go | 16 + ...oapplicationservicedeleteclientresponse.go | 7 + .../ssoapplicationservicedeleterequest.go | 7 + .../ssoapplicationservicedeleteresponse.go | 7 + .../ssoapplicationservicegetresponse.go | 15 + ...soapplicationservicelistclientsresponse.go | 27 + ...soapplicationservicelisthistoryresponse.go | 27 + .../ssoapplicationservicelistresponse.go | 25 + ...parsesamlserviceprovidermetadatarequest.go | 19 + ...arsesamlserviceprovidermetadataresponse.go | 28 + ...icationservicerotateclientsecretrequest.go | 18 + ...cationservicerotateclientsecretresponse.go | 18 + .../ssoapplicationservicesearchrequest.go | 44 + .../ssoapplicationservicesearchresponse.go | 25 + ...soapplicationserviceupdateclientrequest.go | 26 + ...oapplicationserviceupdateclientresponse.go | 15 + .../ssoapplicationserviceupdaterequest.go | 23 + .../ssoapplicationserviceupdateresponse.go | 15 + .../pkg/models/shared/ssosettings.go | 137 + .../models/shared/ssosettingshistoryentry.go | 25 + .../shared/ssosettingsservicegetresponse.go | 15 + .../ssosettingsservicelisthistoryresponse.go | 25 + .../shared/ssosettingsserviceupdaterequest.go | 23 + .../ssosettingsserviceupdateresponse.go | 15 + .../models/shared/ssosubjectcompatibility.go | 21 + .../ssosubjectcompatibilitydeleteissue.go | 27 + .../ssosubjectcompatibilityimportentry.go | 34 + .../ssosubjectcompatibilityimportissue.go | 45 + .../pkg/models/shared/subjectapplimit.go | 85 + .../shared/subjectapplimithistoryentry.go | 23 + .../subjectapplimitservicedeleterequest.go | 7 + .../subjectapplimitservicedeleteresponse.go | 7 + .../subjectapplimitservicegetresponse.go | 15 + ...bjectapplimitservicelisthistoryresponse.go | 25 + .../subjectapplimitservicesearchrequest.go | 51 + .../subjectapplimitservicesearchresponse.go | 25 + .../subjectapplimitservicesetlimitrequest.go | 51 + .../subjectapplimitservicesetlimitresponse.go | 15 + .../subjectapplimitservicesuspendrequest.go | 16 + .../subjectapplimitservicesuspendresponse.go | 15 + .../subjectapplimitserviceunsuspendrequest.go | 7 + ...subjectapplimitserviceunsuspendresponse.go | 15 + .../shared/subjectapplimitstatefilter.go | 47 + .../pkg/models/shared/submittedtaskaction.go | 3 +- .../pkg/models/shared/systempreference.go | 25 + .../pkg/models/shared/task.go | 3 +- ...kactionsserviceretryprovisioningrequest.go | 33 + .../models/shared/taskauditaccountdeleted.go | 63 + .../shared/taskauditautomationtriggered.go | 52 + ...skauditconditionalpolicyexecutionresult.go | 30 + .../pkg/models/shared/taskauditlistrequest.go | 11 + .../models/shared/taskauditlistresponse.go | 31 + ...auditprovisionentitlementmergecompleted.go | 25 + ...kauditprovisionentitlementmergetimedout.go | 25 + ...uditprovisionwaitingforentitlementmerge.go | 49 + .../pkg/models/shared/taskauditview.go | 71 +- .../models/shared/taskauditwebhooksuccess.go | 9 + .../pkg/models/shared/tasksearchrequest.go | 33 + .../pkg/models/shared/tasktypeaction.go | 26 +- .../pkg/models/shared/tasktypeactioninput.go | 17 +- ...laneservicegetdiscoverysnapshotresponse.go | 15 + ...trolplaneservicegetegresspolicyresponse.go | 25 + ...controlplaneservicepushdiscoveryrequest.go | 70 + ...ontrolplaneservicepushdiscoveryresponse.go | 15 + ...trolplaneservicesaveegresspolicyrequest.go | 67 + ...rolplaneservicesaveegresspolicyresponse.go | 15 + .../shared/tbdiscoverydestinationtargets.go | 19 + .../pkg/models/shared/tbdiscoverysnapshot.go | 126 + .../pkg/models/shared/tbegresspolicy.go | 121 + .../pkg/models/shared/tbegressrule.go | 214 ++ .../shared/triggerautomationdispatcher.go | 26 + .../pkg/models/shared/unusedsecretevidence.go | 31 + .../pkg/models/shared/unusedsecrettype.go | 9 + .../shared/updatefindingassigneerequest.go | 16 + .../shared/updatefindingassigneeresponse.go | 15 + .../shared/updatefindingsettingsrequest.go | 19 + .../shared/updatefindingsettingsresponse.go | 17 + .../shared/waitingfordeviceplacement.go | 25 + .../shared/waitingforentitlementmerge.go | 25 + .../pkg/models/shared/webhookdispatcher.go | 25 + .../models/shared/xaaclientaudiencemapping.go | 4 +- .../conductorone-sdk-go/providercredential.go | 667 ++++ .../conductorone-sdk-go/reporting.go | 1728 +++++++++ .../requestcatalogmanagement.go | 215 ++ .../roleminingmanagement.go | 226 +- .../conductorone-sdk-go/sessionpolicy.go | 719 +++- .../conductorone-sdk-go/ssoapplication.go | 3240 +++++++++++++++++ .../conductorone-sdk-go/ssosettings.go | 662 ++++ .../conductorone-sdk-go/subjectapplimit.go | 1534 ++++++++ .../conductorone-sdk-go/taskactions.go | 215 ++ .../conductorone-sdk-go/tbcontrolplane.go | 884 +++++ .../conductorone-sdk-go/uiconversations.go | 246 ++ vendor/modules.txt | 2 +- 547 files changed, 45425 insertions(+), 305 deletions(-) create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/accessreviewactions.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/accessreviewreport.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/appcap.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/appmanagedstate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/feedback.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/findingsettings.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/fundassignment.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/fundpolicy.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/fundrule.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/gatewaykey.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/mcpresource.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/myfundlimits.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apia2uiv1a2uiservicegetsurfaceprovenance.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaccessreviewv1accessreviewactionsservicegeneratereport.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaccessreviewv1accessreviewreportservicelist.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpaccessprofileservicesearchaccessprofiles.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicelist.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicelisthistory.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicesearch.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceserviceupdate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appentitlementsearchservicesearchreachableresourcesforuser.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateservicelist.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateservicepromote.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiconversationsv1uiconversationsserviceensureonboardingsession.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifeedbackv1feedbackservicecreatefeedback.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingserviceupdatefindingassignee.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingsettingsservicelistfindingsettings.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingsettingsserviceupdatefindingsettings.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifunctionsv1functionsinvocationservicegetresultdownloadurl.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicedelete.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicelist.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicelisthistory.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicesetlimit.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicesuspend.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapserviceunsuspend.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceclearextension.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicedelete.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicegrantextension.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicelisthistory.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesearch.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesetlimit.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesuspend.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceunsuspend.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicecreate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicedelete.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicefreezetenant.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicelisthistory.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicesetorgceiling.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceunfreezetenant.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceupdate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicecreate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicedelete.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicelist.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicelisthistory.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicesearch.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleserviceupdate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicedelete.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicelist.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicelisthistory.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicepause.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsserviceresume.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicesetlimit.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicedelete.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicelisthistory.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesearch.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesetlimit.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesuspend.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitserviceunsuspend.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicelist.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicemint.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicerevoke.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceclear.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceset.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicedelete.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicegetprogram.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicegetrunprovenance.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicelist.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicerun.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicesave.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingserviceupdate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apirequestcatalogv1requestcatalogmanagementserviceplantypechange.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiroleminingmanagementv1roleminingmanagementserviceevaluateentitlementselection.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisecretsv1papersecretservicesearchsecretssharedwithme.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicegeteffectivesessionpolicy.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicelistuserpolicies.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicesearchpolicyusers.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicebatchdeletesubjectcompatibility.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicebatchimportsubjectcompatibility.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicecreate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicecreateclient.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicedelete.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicedeleteclient.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelist.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelistclients.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelisthistory.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceparsesamlserviceprovidermetadata.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicerotateclientsecret.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicesearch.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceupdate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceupdateclient.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsserviceget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsservicelisthistory.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsserviceupdate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitaskv1taskactionsserviceretryprovisioning.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicegetdiscoverysnapshot.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicegetegresspolicy.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicepushdiscovery.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicesaveegresspolicy.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenanceobject.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancesource.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancestep.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancetoolcall.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uireportedittarget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiservicegetsurfaceprovenanceresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewactionsservicegeneratereportrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewactionsservicegeneratereportresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreport.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreportcolumnconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreportservicelistresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewtaskcolumnref.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcap.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcaphistoryentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicedeleterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicedeleteresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicegetresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicelisthistoryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicelistresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesetlimitrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesetlimitresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesuspendrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesuspendresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapserviceunsuspendrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapserviceunsuspendresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementsearchservicesearchreachableresourcesforuserrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementsearchservicesearchreachableresourcesforuserresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstate.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebinding.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingexpandmask.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingview.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatemanaged.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstateunmanaged.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmatchbatonref.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/blockoutputconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/blocktoolcallconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkreprocessaction.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bundleautomationref.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1metriccard.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1metriccardscomponent.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1tablecomponent.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1tablerow.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clearprovidercredentialrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clearprovidercredentialresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clientcontext.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorsyncfailingevidence.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorsyncfailingtype.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createfeedbackrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createfeedbackresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialexpiringevidence.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialexpiringtype.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialissuetarget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialissuetargetinput.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialpubliclyexposedevidence.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialpubliclyexposedtype.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/datadogcontext.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/datefield.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownerdetail.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownerevidence.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownertype.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/decoypubliclyexposedevidence.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/decoypubliclyexposedtype.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deviceplacementprovision.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/effectiveuserpolicy.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/encodedcontentguardconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ensureonboardingsessionrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ensureonboardingsessionresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/entitlementcutoffimpactpoint.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateentitlementselectionrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateentitlementselectionresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingaudience.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingaudienceusers.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingdispatcher.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingdispatchoutcomenotify.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingsettingsentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingtypesetting.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functioninvocationresultref.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsinvocationservicegetresultdownloadurlresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignment.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmenthistoryentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceclearextensionrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceclearextensionresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicedeleterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicedeleteresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegetresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegrantextensionrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegrantextensionresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicelisthistoryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesearchrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesearchresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesetlimitrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesetlimitresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesuspendrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesuspendresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceunsuspendrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceunsuspendresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicy.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyhistoryentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicecreaterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicecreateresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicedeleterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicedeleteresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicefreezetenantrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicefreezetenantresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicegetresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicelisthistoryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicesetorgceilingrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicesetorgceilingresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceunfreezetenantrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceunfreezetenantresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceupdaterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceupdateresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundrule.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundrulehistoryentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicecreaterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicecreateresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicedeleterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicedeleteresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicegetresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicelisthistoryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicelistresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicesearchrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicesearchresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleserviceupdaterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleserviceupdateresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/gatewaykey.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getappmanagedstatebindingresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getprovidercredentialresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/invokefunctiondispatcher.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/jsonpatchconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/linkfilterconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listappmanagedstatebindingsresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listfindingsettingsresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listgatewaykeysresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileinput.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileservicesearchaccessprofilesresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresource.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourcehistoryentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicegetresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicelisthistoryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicelistresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicesearchrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicesearchresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceserviceupdaterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceserviceupdateresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mintgatewaykeyrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mintgatewaykeyresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/money.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/msteamschannel.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimit.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimithistoryentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicedeleterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicedeleteresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicelisthistoryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicelistresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicepauserequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicepauseresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsserviceresumerequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsserviceresumeresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicesetlimitrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicesetlimitresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/notifydispatcher.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/oidcclaimmapping.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/papersecretservicesearchsecretssharedwithmerequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/payloadfindingdispatch.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policyscope.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policyuser.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/pretoolblockconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/programref.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/promoteappmanagedstatebindingrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/promptinjectionscanconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/providercredential.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionwaitingon.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/report.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicedeleterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicedeleteresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetprogramresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetrunprovenanceresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicelistresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicerunrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicerunresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicesaverequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicesaveresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingserviceupdaterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingserviceupdateresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportrun.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportsource.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementserviceplantypechangerequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementserviceplantypechangeresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogref.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogtypechangeimpact.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogtypechangeimpactref.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcreatedpreference.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/revokegatewaykeyrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/revokegatewaykeyresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/samlattributemapping.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/samlmetadatafinding.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/screenshot.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/secretsmaskingconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicegeteffectivesessionpolicyresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicelistuserpoliciesresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicesearchpolicyusersrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicesearchpolicyusersresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/setprovidercredentialrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/setprovidercredentialresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/shadowmcpevidence.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/shadowmcptype.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/slackchanneltarget.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendcontrols.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendextension.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimit.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitamount.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitblocked.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitunlimited.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendsuspension.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplication.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationhistoryentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclient.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthclientsecretbasic.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthclientsecretpost.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthentication.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthnone.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthprivatekeyjwt.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationsamlconfig.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchdeletesubjectcompatibilityrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchdeletesubjectcompatibilityresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchimportsubjectcompatibilityrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchimportsubjectcompatibilityresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateclientrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateclientresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreaterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteclientrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteclientresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicegetresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelistclientsresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelisthistoryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelistresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceparsesamlserviceprovidermetadatarequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceparsesamlserviceprovidermetadataresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicerotateclientsecretrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicerotateclientsecretresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicesearchrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicesearchresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateclientrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateclientresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdaterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettings.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingshistoryentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsservicegetresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsservicelisthistoryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsserviceupdaterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsserviceupdateresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibility.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilitydeleteissue.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilityimportentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilityimportissue.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimit.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimithistoryentry.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicedeleterequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicedeleteresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicegetresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicelisthistoryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesearchrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesearchresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesetlimitrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesetlimitresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesuspendrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesuspendresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitserviceunsuspendrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitserviceunsuspendresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitstatefilter.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/systempreference.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskactionsserviceretryprovisioningrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditaccountdeleted.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditautomationtriggered.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionentitlementmergecompleted.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionentitlementmergetimedout.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionwaitingforentitlementmerge.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicegetdiscoverysnapshotresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicegetegresspolicyresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicepushdiscoveryrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicepushdiscoveryresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicesaveegresspolicyrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicesaveegresspolicyresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbdiscoverydestinationtargets.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbdiscoverysnapshot.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbegresspolicy.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbegressrule.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/triggerautomationdispatcher.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/unusedsecretevidence.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/unusedsecrettype.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingassigneerequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingassigneeresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingsettingsrequest.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingsettingsresponse.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/waitingfordeviceplacement.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/waitingforentitlementmerge.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/webhookdispatcher.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/providercredential.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/reporting.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/ssoapplication.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/ssosettings.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/subjectapplimit.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/tbcontrolplane.go create mode 100644 vendor/github.com/conductorone/conductorone-sdk-go/uiconversations.go diff --git a/go.mod b/go.mod index 4a654f74..3a96e8ac 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( require ( filippo.io/age v1.3.1 github.com/conductorone/baton-sdk v0.3.17 - github.com/conductorone/conductorone-sdk-go v1.29.0 + github.com/conductorone/conductorone-sdk-go v1.29.1-0.20260905002051-ef0d92d9c5f2 github.com/pterm/pterm v0.12.81 github.com/toqueteos/webbrowser v1.2.0 github.com/xhit/go-str2duration/v2 v2.1.0 diff --git a/go.sum b/go.sum index 555c4a27..9939b4e5 100644 --- a/go.sum +++ b/go.sum @@ -32,8 +32,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/conductorone/baton-sdk v0.3.17 h1:aJNr4T2xr7rDa4P2nwKEHjJngI5JcNgfBZZ9aeeliHc= github.com/conductorone/baton-sdk v0.3.17/go.mod h1:lWZHgu025Rsgs5jvBrhilGti0zWF2+YfaFY/bWOS/g0= -github.com/conductorone/conductorone-sdk-go v1.29.0 h1:GaIrU29Sx8CprDzAwbZ1Z+ckyp6VQ0J29BxnNwz/8+I= -github.com/conductorone/conductorone-sdk-go v1.29.0/go.mod h1:iqBl+c2rcJkLTcvACVFAmq9f26175oBIQTR8pAjQVi4= +github.com/conductorone/conductorone-sdk-go v1.29.1-0.20260905002051-ef0d92d9c5f2 h1:2pIItiRX0t6HbqAYCc9+0RHjP4fwuMqYfl1X1Q4Jj4U= +github.com/conductorone/conductorone-sdk-go v1.29.1-0.20260905002051-ef0d92d9c5f2/go.mod h1:iqBl+c2rcJkLTcvACVFAmq9f26175oBIQTR8pAjQVi4= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/console v1.0.5 h1:R0ymNeydRqH2DmakFNdmjR2k0t7UPuiOV/N/27/qqsc= github.com/containerd/console v1.0.5/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/README.md b/vendor/github.com/conductorone/conductorone-sdk-go/README.md index 433ed406..1ceef66e 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/README.md +++ b/vendor/github.com/conductorone/conductorone-sdk-go/README.md @@ -77,6 +77,7 @@ func main() { ### [A2Ui](docs/sdks/a2ui/README.md) * [CreateSurfaceFeedback](docs/sdks/a2ui/README.md#createsurfacefeedback) - Create Surface Feedback +* [GetSurfaceProvenance](docs/sdks/a2ui/README.md#getsurfaceprovenance) - Get Surface Provenance * [ListSurfaceFeedback](docs/sdks/a2ui/README.md#listsurfacefeedback) - List Surface Feedback * [ListSurfaces](docs/sdks/a2ui/README.md#listsurfaces) - List Surfaces * [SubmitAction](docs/sdks/a2ui/README.md#submitaction) - Submit Action @@ -96,6 +97,14 @@ func main() { * [List](docs/sdks/accessreview/README.md#list) - List * [Update](docs/sdks/accessreview/README.md#update) - Update +### [AccessReviewActions](docs/sdks/accessreviewactions/README.md) + +* [GenerateReport](docs/sdks/accessreviewactions/README.md#generatereport) - Generate Report + +### [AccessReviewReport](docs/sdks/accessreviewreport/README.md) + +* [List](docs/sdks/accessreviewreport/README.md#list) - List + ### [AccessReviewSetupEntitlement](docs/sdks/accessreviewsetupentitlement/README.md) * [GetCampaignScopeAndEntitlements](docs/sdks/accessreviewsetupentitlement/README.md#getcampaignscopeandentitlements) - Get Campaign Scope And Entitlements @@ -132,6 +141,16 @@ func main() { * [CreateAppAccessRequestsDefaults](docs/sdks/appaccessrequestsdefaults/README.md#createappaccessrequestsdefaults) - Create App Access Requests Defaults * [GetAppAccessRequestsDefaults](docs/sdks/appaccessrequestsdefaults/README.md#getappaccessrequestsdefaults) - Get App Access Requests Defaults +### [AppCap](docs/sdks/appcap/README.md) + +* [Delete](docs/sdks/appcap/README.md#delete) - Delete +* [Get](docs/sdks/appcap/README.md#get) - Get +* [List](docs/sdks/appcap/README.md#list) - List +* [ListHistory](docs/sdks/appcap/README.md#listhistory) - List History +* [SetLimit](docs/sdks/appcap/README.md#setlimit) - Set Limit +* [Suspend](docs/sdks/appcap/README.md#suspend) - Suspend +* [Unsuspend](docs/sdks/appcap/README.md#unsuspend) - Unsuspend + ### [AppEntitlementMonitorBinding](docs/sdks/appentitlementmonitorbinding/README.md) * [CreateAppEntitlementMonitorBinding](docs/sdks/appentitlementmonitorbinding/README.md#createappentitlementmonitorbinding) - Create App Entitlement Monitor Binding @@ -196,6 +215,7 @@ func main() { * [SearchAppEntitlementsWithExpired](docs/sdks/appentitlementsearch/README.md#searchappentitlementswithexpired) - Search App Entitlements With Expired * [SearchGrants](docs/sdks/appentitlementsearch/README.md#searchgrants) - Search Grants * [SearchGraph](docs/sdks/appentitlementsearch/README.md#searchgraph) - Search Graph +* [SearchReachableResourcesForUser](docs/sdks/appentitlementsearch/README.md#searchreachableresourcesforuser) - Search Reachable Resources For User ### [AppEntitlementsProxy](docs/sdks/appentitlementsproxy/README.md) @@ -211,6 +231,12 @@ func main() { * [SearchPastGrants](docs/sdks/appentitlementuserbinding/README.md#searchpastgrants) - Search Past Grants * [UpdateGrantDuration](docs/sdks/appentitlementuserbinding/README.md#updategrantduration) - Update Grant Duration +### [AppManagedState](docs/sdks/appmanagedstate/README.md) + +* [Get](docs/sdks/appmanagedstate/README.md#get) - Get +* [List](docs/sdks/appmanagedstate/README.md#list) - List +* [Promote](docs/sdks/appmanagedstate/README.md#promote) - Promote + ### [AppOwners](docs/sdks/appowners/README.md) * [Add](docs/sdks/appowners/README.md#add) - Add @@ -470,6 +496,10 @@ func main() { * [Search](docs/sdks/externalclientsearch/README.md#search) - NOTE: Searches external client grants for all users +### [Feedback](docs/sdks/feedback/README.md) + +* [CreateFeedback](docs/sdks/feedback/README.md#createfeedback) - Create Feedback + ### [Finding](docs/sdks/finding/README.md) * [BulkCreateFindingTasks](docs/sdks/finding/README.md#bulkcreatefindingtasks) - Bulk Create Finding Tasks @@ -477,6 +507,7 @@ func main() { * [CreateFinding](docs/sdks/finding/README.md#createfinding) - Create Finding * [CreateFindingTask](docs/sdks/finding/README.md#createfindingtask) - Create Finding Task * [GetFinding](docs/sdks/finding/README.md#getfinding) - Get Finding +* [UpdateFindingAssignee](docs/sdks/finding/README.md#updatefindingassignee) - Update Finding Assignee * [UpdateFindingState](docs/sdks/finding/README.md#updatefindingstate) - Update Finding State ### [FindingAudit](docs/sdks/findingaudit/README.md) @@ -495,6 +526,11 @@ func main() { * [Search](docs/sdks/findingsearch/README.md#search) - Search +### [FindingSettings](docs/sdks/findingsettings/README.md) + +* [ListFindingSettings](docs/sdks/findingsettings/README.md#listfindingsettings) - List Finding Settings +* [UpdateFindingSettings](docs/sdks/findingsettings/README.md#updatefindingsettings) - Update Finding Settings + ### [FindingTransformationRule](docs/sdks/findingtransformationrule/README.md) * [CreateFindingTransformationRule](docs/sdks/findingtransformationrule/README.md#createfindingtransformationrule) - Create Finding Transformation Rule @@ -523,6 +559,7 @@ func main() { ### [FunctionsInvocation](docs/sdks/functionsinvocation/README.md) * [Get](docs/sdks/functionsinvocation/README.md#get) - Get +* [GetResultDownloadURL](docs/sdks/functionsinvocation/README.md#getresultdownloadurl) - Get Result Download Url * [List](docs/sdks/functionsinvocation/README.md#list) - List ### [FunctionsInvocationSearch](docs/sdks/functionsinvocationsearch/README.md) @@ -533,6 +570,45 @@ func main() { * [Search](docs/sdks/functionssearch/README.md#search) - Search +### [FundAssignment](docs/sdks/fundassignment/README.md) + +* [ClearExtension](docs/sdks/fundassignment/README.md#clearextension) - Clear Extension +* [Delete](docs/sdks/fundassignment/README.md#delete) - Delete +* [Get](docs/sdks/fundassignment/README.md#get) - Get +* [GrantExtension](docs/sdks/fundassignment/README.md#grantextension) - Grant Extension +* [ListHistory](docs/sdks/fundassignment/README.md#listhistory) - List History +* [Search](docs/sdks/fundassignment/README.md#search) - Search +* [SetLimit](docs/sdks/fundassignment/README.md#setlimit) - Set Limit +* [Suspend](docs/sdks/fundassignment/README.md#suspend) - Suspend +* [Unsuspend](docs/sdks/fundassignment/README.md#unsuspend) - Unsuspend + +### [FundPolicy](docs/sdks/fundpolicy/README.md) + +* [Create](docs/sdks/fundpolicy/README.md#create) - Create +* [Delete](docs/sdks/fundpolicy/README.md#delete) - Delete +* [FreezeTenant](docs/sdks/fundpolicy/README.md#freezetenant) - Freeze Tenant +* [Get](docs/sdks/fundpolicy/README.md#get) - Get +* [ListHistory](docs/sdks/fundpolicy/README.md#listhistory) - List History +* [SetOrgCeiling](docs/sdks/fundpolicy/README.md#setorgceiling) - Set Org Ceiling +* [UnfreezeTenant](docs/sdks/fundpolicy/README.md#unfreezetenant) - Unfreeze Tenant +* [Update](docs/sdks/fundpolicy/README.md#update) - Update + +### [FundRule](docs/sdks/fundrule/README.md) + +* [Create](docs/sdks/fundrule/README.md#create) - Create +* [Delete](docs/sdks/fundrule/README.md#delete) - Delete +* [Get](docs/sdks/fundrule/README.md#get) - Get +* [List](docs/sdks/fundrule/README.md#list) - List +* [ListHistory](docs/sdks/fundrule/README.md#listhistory) - List History +* [Search](docs/sdks/fundrule/README.md#search) - Search +* [Update](docs/sdks/fundrule/README.md#update) - Update + +### [GatewayKey](docs/sdks/gatewaykey/README.md) + +* [List](docs/sdks/gatewaykey/README.md#list) - List +* [Mint](docs/sdks/gatewaykey/README.md#mint) - Mint +* [Revoke](docs/sdks/gatewaykey/README.md#revoke) - Revoke + ### [Hooks](docs/sdks/hooks/README.md) * [Create](docs/sdks/hooks/README.md#create) - Create @@ -573,6 +649,7 @@ func main() { * [GetByAppEntitlementID](docs/sdks/mcpaccessprofile/README.md#getbyappentitlementid) - Get By App Entitlement Id * [List](docs/sdks/mcpaccessprofile/README.md#list) - List * [ListRequestableConnectors](docs/sdks/mcpaccessprofile/README.md#listrequestableconnectors) - List Requestable Connectors +* [SearchAccessProfiles](docs/sdks/mcpaccessprofile/README.md#searchaccessprofiles) - Search Access Profiles * [SearchRequestableConnectors](docs/sdks/mcpaccessprofile/README.md#searchrequestableconnectors) - Search Requestable Connectors * [Update](docs/sdks/mcpaccessprofile/README.md#update) - Update @@ -585,6 +662,14 @@ func main() { * [ListProfilesByToolHistory](docs/sdks/mcpaccessprofiletoolbinding/README.md#listprofilesbytoolhistory) - List Profiles By Tool History * [ListToolsByProfileHistory](docs/sdks/mcpaccessprofiletoolbinding/README.md#listtoolsbyprofilehistory) - List Tools By Profile History +### [MCPResource](docs/sdks/mcpresource/README.md) + +* [Get](docs/sdks/mcpresource/README.md#get) - Get +* [List](docs/sdks/mcpresource/README.md#list) - List +* [ListHistory](docs/sdks/mcpresource/README.md#listhistory) - List History +* [Search](docs/sdks/mcpresource/README.md#search) - Search +* [Update](docs/sdks/mcpresource/README.md#update) - Update + ### [MCPServer](docs/sdks/mcpserver/README.md) * [Delete](docs/sdks/mcpserver/README.md#delete) - Delete @@ -610,6 +695,15 @@ func main() { * [Search](docs/sdks/mcptool/README.md#search) - Search * [Update](docs/sdks/mcptool/README.md#update) - Update +### [MyFundLimits](docs/sdks/myfundlimits/README.md) + +* [Delete](docs/sdks/myfundlimits/README.md#delete) - Delete +* [List](docs/sdks/myfundlimits/README.md#list) - List +* [ListHistory](docs/sdks/myfundlimits/README.md#listhistory) - List History +* [Pause](docs/sdks/myfundlimits/README.md#pause) - Pause +* [Resume](docs/sdks/myfundlimits/README.md#resume) - Resume +* [SetLimit](docs/sdks/myfundlimits/README.md#setlimit) - Set Limit + ### [OnboardingSettings](docs/sdks/onboardingsettings/README.md) * [Get](docs/sdks/onboardingsettings/README.md#get) - Get @@ -635,6 +729,7 @@ func main() { * [Revoke](docs/sdks/papersecret/README.md#revoke) - Revoke * [SearchAuditEvents](docs/sdks/papersecret/README.md#searchauditevents) - Search Audit Events * [SearchMySecrets](docs/sdks/papersecret/README.md#searchmysecrets) - Search My Secrets +* [SearchSecretsSharedWithMe](docs/sdks/papersecret/README.md#searchsecretssharedwithme) - Search Secrets Shared With Me * [SetTextContent](docs/sdks/papersecret/README.md#settextcontent) - Set Text Content ### [PaperSecretAdmin](docs/sdks/papersecretadmin/README.md) @@ -697,6 +792,12 @@ func main() { * [Update](docs/sdks/principal/README.md#update) - Update * [UpdateCredential](docs/sdks/principal/README.md#updatecredential) - Update Credential +### [ProviderCredential](docs/sdks/providercredential/README.md) + +* [Clear](docs/sdks/providercredential/README.md#clear) - Clear +* [Get](docs/sdks/providercredential/README.md#get) - Get +* [Set](docs/sdks/providercredential/README.md#set) - Set + ### [RecoveryPolicy](docs/sdks/recoverypolicy/README.md) * [Create](docs/sdks/recoverypolicy/README.md#create) - Create @@ -706,6 +807,17 @@ func main() { * [Search](docs/sdks/recoverypolicy/README.md#search) - Search * [Update](docs/sdks/recoverypolicy/README.md#update) - Update +### [Reporting](docs/sdks/reporting/README.md) + +* [Delete](docs/sdks/reporting/README.md#delete) - Delete +* [Get](docs/sdks/reporting/README.md#get) - Get +* [GetProgram](docs/sdks/reporting/README.md#getprogram) - Get Program +* [GetRunProvenance](docs/sdks/reporting/README.md#getrunprovenance) - Get Run Provenance +* [List](docs/sdks/reporting/README.md#list) - List +* [Run](docs/sdks/reporting/README.md#run) - Run +* [Save](docs/sdks/reporting/README.md#save) - Save +* [Update](docs/sdks/reporting/README.md#update) - Update + ### [RequestCatalogManagement](docs/sdks/requestcatalogmanagement/README.md) * [AddAccessEntitlements](docs/sdks/requestcatalogmanagement/README.md#addaccessentitlements) - Add Access Entitlements @@ -724,6 +836,7 @@ func main() { * [ListAllEntitlementIdsPerApp](docs/sdks/requestcatalogmanagement/README.md#listallentitlementidsperapp) - List All Entitlement Ids Per App * [ListEntitlementsForAccess](docs/sdks/requestcatalogmanagement/README.md#listentitlementsforaccess) - List Entitlements For Access * [ListEntitlementsPerCatalog](docs/sdks/requestcatalogmanagement/README.md#listentitlementspercatalog) - List Entitlements Per Catalog +* [PlanTypeChange](docs/sdks/requestcatalogmanagement/README.md#plantypechange) - Plan Type Change * [RemoveAccessEntitlements](docs/sdks/requestcatalogmanagement/README.md#removeaccessentitlements) - Remove Access Entitlements * [RemoveAppEntitlements](docs/sdks/requestcatalogmanagement/README.md#removeappentitlements) - Remove App Entitlements * [ResumePausedBundleAutomation](docs/sdks/requestcatalogmanagement/README.md#resumepausedbundleautomation) - Resume Paused Bundle Automation @@ -753,6 +866,7 @@ func main() { ### [RoleMiningManagement](docs/sdks/roleminingmanagement/README.md) * [CreateAccessProfileFromCohort](docs/sdks/roleminingmanagement/README.md#createaccessprofilefromcohort) - Create Access Profile From Cohort +* [EvaluateEntitlementSelection](docs/sdks/roleminingmanagement/README.md#evaluateentitlementselection) - Evaluate Entitlement Selection * [GetCustomAnalysisResult](docs/sdks/roleminingmanagement/README.md#getcustomanalysisresult) - Get Custom Analysis Result * [GetLatestRun](docs/sdks/roleminingmanagement/README.md#getlatestrun) - Get Latest Run * [GetRoleMiningConfig](docs/sdks/roleminingmanagement/README.md#getroleminingconfig) - Get Role Mining Config @@ -783,9 +897,12 @@ func main() { * [Create](docs/sdks/sessionpolicy/README.md#create) - Create * [Delete](docs/sdks/sessionpolicy/README.md#delete) - Delete * [Get](docs/sdks/sessionpolicy/README.md#get) - Get +* [GetEffectiveSessionPolicy](docs/sdks/sessionpolicy/README.md#geteffectivesessionpolicy) - Get Effective Session Policy * [List](docs/sdks/sessionpolicy/README.md#list) - List * [ListAssignments](docs/sdks/sessionpolicy/README.md#listassignments) - List Assignments +* [ListUserPolicies](docs/sdks/sessionpolicy/README.md#listuserpolicies) - List User Policies * [Search](docs/sdks/sessionpolicy/README.md#search) - Search +* [SearchPolicyUsers](docs/sdks/sessionpolicy/README.md#searchpolicyusers) - Search Policy Users * [UnassignGroup](docs/sdks/sessionpolicy/README.md#unassigngroup) - Unassign Group * [UnassignUser](docs/sdks/sessionpolicy/README.md#unassignuser) - Unassign User * [Update](docs/sdks/sessionpolicy/README.md#update) - Update @@ -823,6 +940,30 @@ func main() { * [Test](docs/sdks/ssfreceiverstream/README.md#test) - Test * [Update](docs/sdks/ssfreceiverstream/README.md#update) - Update +### [SSOApplication](docs/sdks/ssoapplication/README.md) + +* [BatchDeleteSubjectCompatibility](docs/sdks/ssoapplication/README.md#batchdeletesubjectcompatibility) - Batch Delete Subject Compatibility +* [BatchImportSubjectCompatibility](docs/sdks/ssoapplication/README.md#batchimportsubjectcompatibility) - Batch Import Subject Compatibility +* [Create](docs/sdks/ssoapplication/README.md#create) - Create +* [CreateClient](docs/sdks/ssoapplication/README.md#createclient) - Create Client +* [Delete](docs/sdks/ssoapplication/README.md#delete) - Delete +* [DeleteClient](docs/sdks/ssoapplication/README.md#deleteclient) - Delete Client +* [Get](docs/sdks/ssoapplication/README.md#get) - Get +* [List](docs/sdks/ssoapplication/README.md#list) - List +* [ListClients](docs/sdks/ssoapplication/README.md#listclients) - List Clients +* [ListHistory](docs/sdks/ssoapplication/README.md#listhistory) - List History +* [ParseSAMLServiceProviderMetadata](docs/sdks/ssoapplication/README.md#parsesamlserviceprovidermetadata) - Parse Saml Service Provider Metadata +* [RotateClientSecret](docs/sdks/ssoapplication/README.md#rotateclientsecret) - Rotate Client Secret +* [Search](docs/sdks/ssoapplication/README.md#search) - Search +* [Update](docs/sdks/ssoapplication/README.md#update) - Update +* [UpdateClient](docs/sdks/ssoapplication/README.md#updateclient) - Update Client + +### [SSOSettings](docs/sdks/ssosettings/README.md) + +* [Get](docs/sdks/ssosettings/README.md#get) - Get +* [ListHistory](docs/sdks/ssosettings/README.md#listhistory) - List History +* [Update](docs/sdks/ssosettings/README.md#update) - Update + ### [StepUpProvider](docs/sdks/stepupprovider/README.md) * [Create](docs/sdks/stepupprovider/README.md#create) - Create @@ -839,6 +980,16 @@ func main() { * [Get](docs/sdks/stepuptransaction/README.md#get) - Get * [Search](docs/sdks/stepuptransaction/README.md#search) - Search +### [SubjectAppLimit](docs/sdks/subjectapplimit/README.md) + +* [Delete](docs/sdks/subjectapplimit/README.md#delete) - Delete +* [Get](docs/sdks/subjectapplimit/README.md#get) - Get +* [ListHistory](docs/sdks/subjectapplimit/README.md#listhistory) - List History +* [Search](docs/sdks/subjectapplimit/README.md#search) - Search +* [SetLimit](docs/sdks/subjectapplimit/README.md#setlimit) - Set Limit +* [Suspend](docs/sdks/subjectapplimit/README.md#suspend) - Suspend +* [Unsuspend](docs/sdks/subjectapplimit/README.md#unsuspend) - Unsuspend + ### [SystemLog](docs/sdks/systemlog/README.md) * [ListEvents](docs/sdks/systemlog/README.md#listevents) - List Events @@ -864,6 +1015,7 @@ func main() { * [ProcessNow](docs/sdks/taskactions/README.md#processnow) - Process Now * [Reassign](docs/sdks/taskactions/README.md#reassign) - Reassign * [Restart](docs/sdks/taskactions/README.md#restart) - Restart +* [RetryProvisioning](docs/sdks/taskactions/README.md#retryprovisioning) - Retry Provisioning * [SkipStep](docs/sdks/taskactions/README.md#skipstep) - Skip Step * [UpdateGrantDuration](docs/sdks/taskactions/README.md#updategrantduration) - Update Grant Duration * [UpdateRequestData](docs/sdks/taskactions/README.md#updaterequestdata) - Update Request Data @@ -876,6 +1028,13 @@ func main() { * [Search](docs/sdks/tasksearch/README.md#search) - Search +### [TBControlPlane](docs/sdks/tbcontrolplane/README.md) + +* [GetDiscoverySnapshot](docs/sdks/tbcontrolplane/README.md#getdiscoverysnapshot) - Get Discovery Snapshot +* [GetEgressPolicy](docs/sdks/tbcontrolplane/README.md#getegresspolicy) - Get Egress Policy +* [PushDiscovery](docs/sdks/tbcontrolplane/README.md#pushdiscovery) - Push Discovery +* [SaveEgressPolicy](docs/sdks/tbcontrolplane/README.md#saveegresspolicy) - Save Egress Policy + ### [TenantAuthConfig](docs/sdks/tenantauthconfig/README.md) * [Create](docs/sdks/tenantauthconfig/README.md#create) - Create @@ -908,6 +1067,10 @@ func main() { * [RevokeBridgeCredential](docs/sdks/tunnelcredentials/README.md#revokebridgecredential) - Revoke Bridge Credential * [UpdateBridge](docs/sdks/tunnelcredentials/README.md#updatebridge) - Update Bridge +### [UIConversations](docs/sdks/uiconversations/README.md) + +* [EnsureOnboardingSession](docs/sdks/uiconversations/README.md#ensureonboardingsession) - Ensure Onboarding Session + ### [User](docs/sdks/user/README.md) * [Get](docs/sdks/user/README.md#get) - Get diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/RELEASES.md b/vendor/github.com/conductorone/conductorone-sdk-go/RELEASES.md index bf394b67..156afed8 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/RELEASES.md +++ b/vendor/github.com/conductorone/conductorone-sdk-go/RELEASES.md @@ -128,4 +128,14 @@ Based on: ### Generated - [go v1.29.0] . ### Releases -- [Go v1.29.0] https://github.com/ConductorOne/conductorone-sdk-go/releases/tag/v1.29.0 - . \ No newline at end of file +- [Go v1.29.0] https://github.com/ConductorOne/conductorone-sdk-go/releases/tag/v1.29.0 - . + +## 2026-09-05 00:11:18 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.790.2 (2.918.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v1.29.1] . +### Releases +- [Go v1.29.1] https://github.com/ConductorOne/conductorone-sdk-go/releases/tag/v1.29.1 - . \ No newline at end of file diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/a2ui.go b/vendor/github.com/conductorone/conductorone-sdk-go/a2ui.go index f7962a74..4a3a2c53 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/a2ui.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/a2ui.go @@ -242,6 +242,214 @@ func (s *A2UI) CreateSurfaceFeedback(ctx context.Context, request operations.C1A } +// GetSurfaceProvenance - Get Surface Provenance +// GetSurfaceProvenance returns, in plain terms, what the surface's report +// +// was built from: every record its program touched, in the order it touched +// them. +func (s *A2UI) GetSurfaceProvenance(ctx context.Context, request operations.C1APIA2uiV1A2UIServiceGetSurfaceProvenanceRequest, opts ...operations.Option) (*operations.C1APIA2uiV1A2UIServiceGetSurfaceProvenanceResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/a2ui/conversations/{conversation_id}/surfaces/{surface_id}/provenance", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.a2ui.v1.A2UIService.GetSurfaceProvenance", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIA2uiV1A2UIServiceGetSurfaceProvenanceResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.A2UIServiceGetSurfaceProvenanceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.A2UIServiceGetSurfaceProvenanceResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // ListSurfaceFeedback - List Surface Feedback // ListSurfaceFeedback lists feedback for a surface. func (s *A2UI) ListSurfaceFeedback(ctx context.Context, request operations.C1APIA2uiV1A2UIServiceListSurfaceFeedbackRequest, opts ...operations.Option) (*operations.C1APIA2uiV1A2UIServiceListSurfaceFeedbackResponse, error) { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/accessreviewactions.go b/vendor/github.com/conductorone/conductorone-sdk-go/accessreviewactions.go new file mode 100644 index 00000000..c12c5db3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/accessreviewactions.go @@ -0,0 +1,247 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" +) + +type AccessReviewActions struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newAccessReviewActions(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *AccessReviewActions { + return &AccessReviewActions{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GenerateReport - Generate Report +// Generate a report of the campaign's reviews and decisions. The format +// +// defaults to JSON (also available: CSV, XLSX). Works on in-flight (OPEN) +// and closed campaigns. Asynchronous — the report record is created +// immediately; the file is materialized in the background. +func (s *AccessReviewActions) GenerateReport(ctx context.Context, request operations.C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportRequest, opts ...operations.Option) (*operations.C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/access_review/{access_review_id}/report", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.accessreview.v1.AccessReviewActionsService.GenerateReport", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "AccessReviewActionsServiceGenerateReportRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AccessReviewActionsServiceGenerateReportResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AccessReviewActionsServiceGenerateReportResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/accessreviewreport.go b/vendor/github.com/conductorone/conductorone-sdk-go/accessreviewreport.go new file mode 100644 index 00000000..112c0552 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/accessreviewreport.go @@ -0,0 +1,242 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" +) + +type AccessReviewReport struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newAccessReviewReport(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *AccessReviewReport { + return &AccessReviewReport{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// List +// List the generated reports for an access review campaign, each with a +// +// time-limited download_url and its output format. +func (s *AccessReviewReport) List(ctx context.Context, request operations.C1APIAccessreviewV1AccessReviewReportServiceListRequest, opts ...operations.Option) (*operations.C1APIAccessreviewV1AccessReviewReportServiceListResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/access_review/{access_review_id}/report", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.accessreview.v1.AccessReviewReportService.List", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAccessreviewV1AccessReviewReportServiceListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AccessReviewReportServiceListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AccessReviewReportServiceListResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/aigovernancesettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/aigovernancesettings.go index c3c13dd5..09b1875a 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/aigovernancesettings.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/aigovernancesettings.go @@ -37,7 +37,8 @@ func newAIGovernanceSettings(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfi // /admin/settings/ai-governance page. Returns the full AIGovernanceSettings: // allowed MCP client types, default client lifecycle, require_tool_approval, // default tool classification, audit verbosity, auto-discovery toggle + -// interval, prefer_code_mode_over_direct_tools, and surface_requestable_tools. +// interval, prefer_code_mode_over_direct_tools, surface_requestable_tools, +// and untrusted_judge_disable. func (s *AIGovernanceSettings) Get(ctx context.Context, opts ...operations.Option) (*operations.C1APIAIGovernanceV1AIGovernanceSettingsServiceGetResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -662,7 +663,8 @@ func (s *AIGovernanceSettings) ListHistory(ctx context.Context, opts ...operatio // which fields to apply (e.g. require_tool_approval, // default_tool_classification, audit_verbosity, auto_discovery_enabled, // discovery_interval, prefer_code_mode_over_direct_tools, -// surface_requestable_tools, allowed_client_types, default_client_lifecycle). +// surface_requestable_tools, untrusted_judge_disable, allowed_client_types, +// default_client_lifecycle). // Only masked fields change. Returns the updated settings. func (s *AIGovernanceSettings) Update(ctx context.Context, request *shared.UpdateAIGovernanceSettingsRequest, opts ...operations.Option) (*operations.C1APIAIGovernanceV1AIGovernanceSettingsServiceUpdateResponse, error) { o := operations.Options{} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/appcap.go b/vendor/github.com/conductorone/conductorone-sdk-go/appcap.go new file mode 100644 index 00000000..ecdbff74 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/appcap.go @@ -0,0 +1,1515 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type AppCap struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newAppCap(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *AppCap { + return &AppCap{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Delete +// Delete the cap entirely. The app is no longer bounded tenant-wide. +func (s *AppCap) Delete(ctx context.Context, request operations.C1APIFundsV1AppCapServiceDeleteRequest, opts ...operations.Option) (*operations.C1APIFundsV1AppCapServiceDeleteResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/app-caps/{app_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.AppCapService.Delete", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "AppCapServiceDeleteRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1AppCapServiceDeleteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AppCapServiceDeleteResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AppCapServiceDeleteResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Get +// Get returns the tenant's ceiling for one app, together with any suspension +// +// acting as that app's kill switch. An app with no cap is not found, meaning +// nothing bounds it beyond the fund the spender already has. +func (s *AppCap) Get(ctx context.Context, request operations.C1APIFundsV1AppCapServiceGetRequest, opts ...operations.Option) (*operations.C1APIFundsV1AppCapServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/app-caps/{app_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.AppCapService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1AppCapServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AppCapServiceGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AppCapServiceGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// List +// List every capped app in the tenant. Cardinality is the tenant's installed +// +// App count, so this is one runtime-plane query. +func (s *AppCap) List(ctx context.Context, request operations.C1APIFundsV1AppCapServiceListRequest, opts ...operations.Option) (*operations.C1APIFundsV1AppCapServiceListResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/app-caps") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.AppCapService.List", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1AppCapServiceListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AppCapServiceListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AppCapServiceListResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHistory - List History +// List the change history for one app's cap, newest first. Admin-tier per the +// +// object-history convention. A cap cleared down to nothing is deleted, and its +// history is where the kill switch that preceded the delete is still readable. +func (s *AppCap) ListHistory(ctx context.Context, request operations.C1APIFundsV1AppCapServiceListHistoryRequest, opts ...operations.Option) (*operations.C1APIFundsV1AppCapServiceListHistoryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/app-caps/{app_id}/history", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.AppCapService.ListHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1AppCapServiceListHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AppCapServiceListHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AppCapServiceListHistoryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetLimit - Set Limit +// Set the app's tenant-wide ceiling, creating the cap if absent. Leaves any +// +// suspension in place. +func (s *AppCap) SetLimit(ctx context.Context, request operations.C1APIFundsV1AppCapServiceSetLimitRequest, opts ...operations.Option) (*operations.C1APIFundsV1AppCapServiceSetLimitResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/app-caps/{app_id}/limit", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.AppCapService.SetLimit", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "AppCapServiceSetLimitRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1AppCapServiceSetLimitResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AppCapServiceSetLimitResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AppCapServiceSetLimitResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Suspend +// Kill the app tenant-wide. The cap amount underneath is preserved and +// +// restored by Unsuspend. +func (s *AppCap) Suspend(ctx context.Context, request operations.C1APIFundsV1AppCapServiceSuspendRequest, opts ...operations.Option) (*operations.C1APIFundsV1AppCapServiceSuspendResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/app-caps/{app_id}/suspension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.AppCapService.Suspend", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "AppCapServiceSuspendRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1AppCapServiceSuspendResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AppCapServiceSuspendResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AppCapServiceSuspendResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Unsuspend +// Bring the app back, restoring the cap it froze. +func (s *AppCap) Unsuspend(ctx context.Context, request operations.C1APIFundsV1AppCapServiceUnsuspendRequest, opts ...operations.Option) (*operations.C1APIFundsV1AppCapServiceUnsuspendResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/app-caps/{app_id}/suspension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.AppCapService.Unsuspend", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "AppCapServiceUnsuspendRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1AppCapServiceUnsuspendResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AppCapServiceUnsuspendResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AppCapServiceUnsuspendResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/appentitlementroutingrule.go b/vendor/github.com/conductorone/conductorone-sdk-go/appentitlementroutingrule.go index 6c4e0964..05d22ad2 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/appentitlementroutingrule.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/appentitlementroutingrule.go @@ -31,7 +31,11 @@ func newAppEntitlementRoutingRule(rootSDK *ConductoroneAPI, sdkConfig config.SDK } // CreateAppEntitlementRoutingRule - Create App Entitlement Routing Rule -// Invokes the c1.api.app.v1.AppEntitlementRoutingRuleService.CreateAppEntitlementRoutingRule method. +// CreateAppEntitlementRoutingRule creates an entitlement configuration rule +// +// for an application. Rules are evaluated in priority order and the first +// rule whose condition matches supplies the entitlement's request settings. +// An app can have at most 5 rules. func (s *AppEntitlementRoutingRule) CreateAppEntitlementRoutingRule(ctx context.Context, request operations.C1APIAppV1AppEntitlementRoutingRuleServiceCreateAppEntitlementRoutingRuleRequest, opts ...operations.Option) (*operations.C1APIAppV1AppEntitlementRoutingRuleServiceCreateAppEntitlementRoutingRuleResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -243,7 +247,9 @@ func (s *AppEntitlementRoutingRule) CreateAppEntitlementRoutingRule(ctx context. } // DeleteAppEntitlementRoutingRule - Delete App Entitlement Routing Rule -// Invokes the c1.api.app.v1.AppEntitlementRoutingRuleService.DeleteAppEntitlementRoutingRule method. +// DeleteAppEntitlementRoutingRule deletes an entitlement configuration rule +// +// by ID. func (s *AppEntitlementRoutingRule) DeleteAppEntitlementRoutingRule(ctx context.Context, request operations.C1APIAppV1AppEntitlementRoutingRuleServiceDeleteAppEntitlementRoutingRuleRequest, opts ...operations.Option) (*operations.C1APIAppV1AppEntitlementRoutingRuleServiceDeleteAppEntitlementRoutingRuleResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -455,7 +461,9 @@ func (s *AppEntitlementRoutingRule) DeleteAppEntitlementRoutingRule(ctx context. } // GetAppEntitlementRoutingRule - Get App Entitlement Routing Rule -// Invokes the c1.api.app.v1.AppEntitlementRoutingRuleService.GetAppEntitlementRoutingRule method. +// GetAppEntitlementRoutingRule returns a single entitlement configuration +// +// rule by ID. func (s *AppEntitlementRoutingRule) GetAppEntitlementRoutingRule(ctx context.Context, request operations.C1APIAppV1AppEntitlementRoutingRuleServiceGetAppEntitlementRoutingRuleRequest, opts ...operations.Option) (*operations.C1APIAppV1AppEntitlementRoutingRuleServiceGetAppEntitlementRoutingRuleResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -660,7 +668,9 @@ func (s *AppEntitlementRoutingRule) GetAppEntitlementRoutingRule(ctx context.Con } // ListAppEntitlementRoutingRules - List App Entitlement Routing Rules -// Invokes the c1.api.app.v1.AppEntitlementRoutingRuleService.ListAppEntitlementRoutingRules method. +// ListAppEntitlementRoutingRules returns an application's entitlement +// +// configuration rules in evaluation order, by priority then by ID. func (s *AppEntitlementRoutingRule) ListAppEntitlementRoutingRules(ctx context.Context, request operations.C1APIAppV1AppEntitlementRoutingRuleServiceListAppEntitlementRoutingRulesRequest, opts ...operations.Option) (*operations.C1APIAppV1AppEntitlementRoutingRuleServiceListAppEntitlementRoutingRulesResponse, error) { o := operations.Options{} supportedOptions := []string{ diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/appentitlements.go b/vendor/github.com/conductorone/conductorone-sdk-go/appentitlements.go index 8bc4cad0..fda526e1 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/appentitlements.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/appentitlements.go @@ -244,6 +244,8 @@ func (s *AppEntitlements) AddAutomationExclusion(ctx context.Context, request op // AddManuallyManagedMembers - Add Manually Managed Members // Add users as manually managed members of an app entitlement. These memberships are tracked directly by ConductorOne rather than synced from the app. +// +// Adding members to an access profile's enrollment entitlement requires the JML feature; without it the request fails with a failed-precondition error. func (s *AppEntitlements) AddManuallyManagedMembers(ctx context.Context, request operations.C1APIAppV1AppEntitlementsAddManuallyManagedMembersRequest, opts ...operations.Option) (*operations.C1APIAppV1AppEntitlementsAddManuallyManagedMembersResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -1713,7 +1715,11 @@ func (s *AppEntitlements) GetAutomation(ctx context.Context, request operations. } // List -// List app entitlements associated with an app. +// List app entitlements associated with an app. Query parameters are +// +// accepted in snake_case (page_size, page_token, app_user_id) and, as a +// compatibility shim, their camelCase equivalents (pageSize, pageToken, +// appUserId). func (s *AppEntitlements) List(ctx context.Context, request operations.C1APIAppV1AppEntitlementsListRequest, opts ...operations.Option) (*operations.C1APIAppV1AppEntitlementsListResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -2968,7 +2974,14 @@ func (s *AppEntitlements) RemoveAutomationExclusion(ctx context.Context, request } // RemoveEntitlementMembership - Remove Entitlement Membership -// Remove a user from a ConductorOne-managed entitlement (catalog, group, or profile type). For access profiles, this creates a revoke task to deprovision access. +// Remove a user from a manually managed entitlement. For ConductorOne +// +// catalogs, groups, and profile types, the existing resource-specific +// removal behavior applies. When the SSO provider feature is enabled, an SSO +// application's sign-in entitlement removes only direct manual access and +// preserves independent requested, connector, and group-derived access. +// Removing a member from an access profile requires the JML feature; without +// it the request fails with a failed-precondition error. func (s *AppEntitlements) RemoveEntitlementMembership(ctx context.Context, request operations.C1APIAppV1AppEntitlementsRemoveEntitlementMembershipRequest, opts ...operations.Option) (*operations.C1APIAppV1AppEntitlementsRemoveEntitlementMembershipResponse, error) { o := operations.Options{} supportedOptions := []string{ diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/appentitlementsearch.go b/vendor/github.com/conductorone/conductorone-sdk-go/appentitlementsearch.go index de67e77c..69433c60 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/appentitlementsearch.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/appentitlementsearch.go @@ -1358,3 +1358,220 @@ func (s *AppEntitlementSearch) SearchGraph(ctx context.Context, request *shared. return res, nil } + +// SearchReachableResourcesForUser - Search Reachable Resources For User +// SearchReachableResourcesForUser returns the distinct app resources a user +// +// can reach through any of their grants, deduplicated across entitlements +// (a resource reachable via more than one grant appears once). Powers the +// Resources lane of the access graph's list view: supports free-text search +// over resource display name and narrowing to specific applications. +func (s *AppEntitlementSearch) SearchReachableResourcesForUser(ctx context.Context, request *shared.AppEntitlementSearchServiceSearchReachableResourcesForUserRequest, opts ...operations.Option) (*operations.C1APIAppV1AppEntitlementSearchServiceSearchReachableResourcesForUserResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/search/graph/resources") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.app.v1.AppEntitlementSearchService.SearchReachableResourcesForUser", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAppV1AppEntitlementSearchServiceSearchReachableResourcesForUserResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.AppEntitlementSearchServiceSearchReachableResourcesForUserResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AppEntitlementSearchServiceSearchReachableResourcesForUserResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/appmanagedstate.go b/vendor/github.com/conductorone/conductorone-sdk-go/appmanagedstate.go new file mode 100644 index 00000000..44167ddf --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/appmanagedstate.go @@ -0,0 +1,660 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" +) + +type AppManagedState struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newAppManagedState(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *AppManagedState { + return &AppManagedState{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Get +// Get the managed state of a discovered application. +func (s *AppManagedState) Get(ctx context.Context, request operations.C1APIAppV1AppManagedStateServiceGetRequest, opts ...operations.Option) (*operations.C1APIAppV1AppManagedStateServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/resource_types/{resource_type_id}/managed_state_bindings/{resource_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.app.v1.AppManagedStateService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAppV1AppManagedStateServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.GetAppManagedStateBindingResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.GetAppManagedStateBindingResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// List +// List the managed states of applications discovered by a connector. +func (s *AppManagedState) List(ctx context.Context, request operations.C1APIAppV1AppManagedStateServiceListRequest, opts ...operations.Option) (*operations.C1APIAppV1AppManagedStateServiceListResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/resource_types/{resource_type_id}/managed_state_bindings", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.app.v1.AppManagedStateService.List", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAppV1AppManagedStateServiceListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ListAppManagedStateBindingsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ListAppManagedStateBindingsResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Promote +// Promote an unmanaged application into a managed application. +// +// Returns AlreadyExists when the application is already managed. The new application inherits source owners when user_ids is omitted. +// Concurrent promotion requests are not supported. +func (s *AppManagedState) Promote(ctx context.Context, request operations.C1APIAppV1AppManagedStateServicePromoteRequest, opts ...operations.Option) (*operations.C1APIAppV1AppManagedStateServicePromoteResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/resource_types/{resource_type_id}/managed_state_bindings/{resource_id}/promote", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.app.v1.AppManagedStateService.Promote", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "PromoteAppManagedStateBindingRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAppV1AppManagedStateServicePromoteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.GetAppManagedStateBindingResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.GetAppManagedStateBindingResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/automation.go b/vendor/github.com/conductorone/conductorone-sdk-go/automation.go index 055d6b15..b2421077 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/automation.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/automation.go @@ -250,7 +250,7 @@ func (s *Automation) ClearAutomationCircuitBreaker(ctx context.Context, request // Create a new automation with the specified steps, triggers, and // // configuration. See get_authoring_guide for the AutomationStep contract -// (step kinds, evaluate_expressions shape, CEL identifier scope). +// (step kinds and their required fields, CEL identifier scope). // // At create time, draft_automation_steps and draft_triggers default to // their published counterparts when omitted — callers writing a single diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/conductoroneapi.go b/vendor/github.com/conductorone/conductorone-sdk-go/conductoroneapi.go index 04948488..127ee567 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/conductoroneapi.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/conductoroneapi.go @@ -53,6 +53,8 @@ type ConductoroneAPI struct { SDKVersion string A2UI *A2UI AccessReview *AccessReview + AccessReviewReport *AccessReviewReport + AccessReviewActions *AccessReviewActions AccessReviewSetupEntitlement *AccessReviewSetupEntitlement AccessReviewTemplate *AccessReviewTemplate AccessReviewTemplateSetupEntitlement *AccessReviewTemplateSetupEntitlement @@ -62,6 +64,7 @@ type ConductoroneAPI struct { Apps *Apps Connector *Connector AppAccessRequestsDefaults *AppAccessRequestsDefaults + MCPResource *MCPResource MCPTool *MCPTool MCPAccessProfile *MCPAccessProfile MCPAccessProfileToolBinding *MCPAccessProfileToolBinding @@ -76,7 +79,9 @@ type ConductoroneAPI struct { AppReportAction *AppReportAction AppResourceType *AppResourceType AppResource *AppResource + AppManagedState *AppManagedState AppResourceOwners *AppResourceOwners + SSOApplication *SSOApplication AppUsageControls *AppUsageControls XAAAccessProfile *XAAAccessProfile XAAAccessProfileScopeBinding *XAAAccessProfileScopeBinding @@ -92,28 +97,40 @@ type ConductoroneAPI struct { RequestCatalogManagement *RequestCatalogManagement ConnectorAuthoringActivation *ConnectorAuthoringActivation ConnectorCatalog *ConnectorCatalog + UIConversations *UIConversations CredentialInventoryPolicy *CredentialInventoryPolicy Decoy *Decoy DecoySearch *DecoySearch Directory *Directory + Feedback *Feedback Finding *Finding FindingRoutingRule *FindingRoutingRule FindingSearch *FindingSearch + FindingSettings *FindingSettings FindingTransformationRule *FindingTransformationRule Functions *Functions FunctionsInvocation *FunctionsInvocation FunctionsInvocationSearch *FunctionsInvocationSearch + AppCap *AppCap + FundAssignment *FundAssignment + MyFundLimits *MyFundLimits + FundPolicy *FundPolicy + FundRule *FundRule + SubjectAppLimit *SubjectAppLimit Hooks *Hooks PersonalClient *PersonalClient PersonalDevice *PersonalDevice Roles *Roles TunnelCredentials *TunnelCredentials + GatewayKey *GatewayKey + ProviderCredential *ProviderCredential LocalDirectoryConfig *LocalDirectoryConfig LocalUserInvitation *LocalUserInvitation Policies *Policies AccountProvisionPolicyTest *AccountProvisionPolicyTest PolicyValidate *PolicyValidate RecoveryPolicy *RecoveryPolicy + Reporting *Reporting RequestSchema *RequestSchema RoleMiningManagement *RoleMiningManagement AutomationExecutionSearch *AutomationExecutionSearch @@ -156,6 +173,7 @@ type ConductoroneAPI struct { OnboardingSettings *OnboardingSettings RequestSettings *RequestSettings SessionSettings *SessionSettings + SSOSettings *SSOSettings SSFReceiverStream *SSFReceiverStream SSFReceiverEvent *SSFReceiverEvent SystemLog *SystemLog @@ -163,6 +181,7 @@ type ConductoroneAPI struct { Task *Task TaskAudit *TaskAudit TaskActions *TaskActions + TBControlPlane *TBControlPlane TerraformExport *TerraformExport User *User Vault *Vault @@ -261,9 +280,9 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *ConductoroneAPI { sdk := &ConductoroneAPI{ - SDKVersion: "1.29.0", + SDKVersion: "1.29.1", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 1.29.0 2.918.3 0.1.0-alpha github.com/conductorone/conductorone-sdk-go", + UserAgent: "speakeasy-sdk/go 1.29.1 2.918.3 0.1.0-alpha github.com/conductorone/conductorone-sdk-go", ServerList: ServerList, ServerVariables: []map[string]string{ { @@ -291,6 +310,8 @@ func New(opts ...SDKOption) *ConductoroneAPI { sdk.A2UI = newA2UI(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AccessReview = newAccessReview(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.AccessReviewReport = newAccessReviewReport(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.AccessReviewActions = newAccessReviewActions(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AccessReviewSetupEntitlement = newAccessReviewSetupEntitlement(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AccessReviewTemplate = newAccessReviewTemplate(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AccessReviewTemplateSetupEntitlement = newAccessReviewTemplateSetupEntitlement(sdk, sdk.sdkConfiguration, sdk.hooks) @@ -300,6 +321,7 @@ func New(opts ...SDKOption) *ConductoroneAPI { sdk.Apps = newApps(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Connector = newConnector(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AppAccessRequestsDefaults = newAppAccessRequestsDefaults(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.MCPResource = newMCPResource(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.MCPTool = newMCPTool(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.MCPAccessProfile = newMCPAccessProfile(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.MCPAccessProfileToolBinding = newMCPAccessProfileToolBinding(sdk, sdk.sdkConfiguration, sdk.hooks) @@ -314,7 +336,9 @@ func New(opts ...SDKOption) *ConductoroneAPI { sdk.AppReportAction = newAppReportAction(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AppResourceType = newAppResourceType(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AppResource = newAppResource(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.AppManagedState = newAppManagedState(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AppResourceOwners = newAppResourceOwners(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.SSOApplication = newSSOApplication(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AppUsageControls = newAppUsageControls(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.XAAAccessProfile = newXAAAccessProfile(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.XAAAccessProfileScopeBinding = newXAAAccessProfileScopeBinding(sdk, sdk.sdkConfiguration, sdk.hooks) @@ -330,28 +354,40 @@ func New(opts ...SDKOption) *ConductoroneAPI { sdk.RequestCatalogManagement = newRequestCatalogManagement(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.ConnectorAuthoringActivation = newConnectorAuthoringActivation(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.ConnectorCatalog = newConnectorCatalog(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.UIConversations = newUIConversations(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.CredentialInventoryPolicy = newCredentialInventoryPolicy(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Decoy = newDecoy(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.DecoySearch = newDecoySearch(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Directory = newDirectory(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Feedback = newFeedback(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Finding = newFinding(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.FindingRoutingRule = newFindingRoutingRule(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.FindingSearch = newFindingSearch(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.FindingSettings = newFindingSettings(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.FindingTransformationRule = newFindingTransformationRule(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Functions = newFunctions(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.FunctionsInvocation = newFunctionsInvocation(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.FunctionsInvocationSearch = newFunctionsInvocationSearch(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.AppCap = newAppCap(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.FundAssignment = newFundAssignment(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.MyFundLimits = newMyFundLimits(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.FundPolicy = newFundPolicy(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.FundRule = newFundRule(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.SubjectAppLimit = newSubjectAppLimit(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Hooks = newHooks(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.PersonalClient = newPersonalClient(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.PersonalDevice = newPersonalDevice(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Roles = newRoles(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.TunnelCredentials = newTunnelCredentials(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.GatewayKey = newGatewayKey(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.ProviderCredential = newProviderCredential(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.LocalDirectoryConfig = newLocalDirectoryConfig(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.LocalUserInvitation = newLocalUserInvitation(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Policies = newPolicies(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AccountProvisionPolicyTest = newAccountProvisionPolicyTest(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.PolicyValidate = newPolicyValidate(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.RecoveryPolicy = newRecoveryPolicy(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Reporting = newReporting(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.RequestSchema = newRequestSchema(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.RoleMiningManagement = newRoleMiningManagement(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.AutomationExecutionSearch = newAutomationExecutionSearch(sdk, sdk.sdkConfiguration, sdk.hooks) @@ -394,6 +430,7 @@ func New(opts ...SDKOption) *ConductoroneAPI { sdk.OnboardingSettings = newOnboardingSettings(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.RequestSettings = newRequestSettings(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.SessionSettings = newSessionSettings(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.SSOSettings = newSSOSettings(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.SSFReceiverStream = newSSFReceiverStream(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.SSFReceiverEvent = newSSFReceiverEvent(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.SystemLog = newSystemLog(sdk, sdk.sdkConfiguration, sdk.hooks) @@ -401,6 +438,7 @@ func New(opts ...SDKOption) *ConductoroneAPI { sdk.Task = newTask(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.TaskAudit = newTaskAudit(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.TaskActions = newTaskActions(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.TBControlPlane = newTBControlPlane(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.TerraformExport = newTerraformExport(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.User = newUser(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Vault = newVault(sdk, sdk.sdkConfiguration, sdk.hooks) diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/connector.go b/vendor/github.com/conductorone/conductorone-sdk-go/connector.go index 2db19894..1939bac5 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/connector.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/connector.go @@ -880,7 +880,10 @@ func (s *Connector) Delete(ctx context.Context, request operations.C1APIAppV1Con } // ForceSync - Force Sync -// Trigger an immediate sync for a connector. The sync is queued and may not start instantly. +// Trigger an immediate sync for a connector. The sync is queued and may not start +// +// instantly. Poll the connector's sync_status (or GetConnector) for progress; an empty +// success response means the sync was accepted onto the queue, not that it has finished. func (s *Connector) ForceSync(ctx context.Context, request operations.C1APIAppV1ConnectorServiceForceSyncRequest, opts ...operations.Option) (*operations.C1APIAppV1ConnectorServiceForceSyncResponse, error) { o := operations.Options{} supportedOptions := []string{ diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/contacts.go b/vendor/github.com/conductorone/conductorone-sdk-go/contacts.go index 144e4ca2..c40962e2 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/contacts.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/contacts.go @@ -32,7 +32,9 @@ func newContacts(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, ho } // GetContacts - Get Contacts -// Invokes the c1.api.settings.v1.ContactsService.GetContacts method. +// GetContacts returns the organization's security, billing, and operations +// +// contact email addresses. func (s *Contacts) GetContacts(ctx context.Context, opts ...operations.Option) (*operations.C1APISettingsV1ContactsServiceGetContactsResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -237,7 +239,11 @@ func (s *Contacts) GetContacts(ctx context.Context, opts ...operations.Option) ( } // UpdateContacts - Update Contacts -// Invokes the c1.api.settings.v1.ContactsService.UpdateContacts method. +// UpdateContacts updates the organization's security, billing, and +// +// operations contact email addresses. If update_mask is set, only the +// selected fields are changed; otherwise all contact fields are replaced +// with the values in the request. func (s *Contacts) UpdateContacts(ctx context.Context, request *shared.UpdateContactsRequest, opts ...operations.Option) (*operations.C1APISettingsV1ContactsServiceUpdateContactsResponse, error) { o := operations.Options{} supportedOptions := []string{ diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/feedback.go b/vendor/github.com/conductorone/conductorone-sdk-go/feedback.go new file mode 100644 index 00000000..e7d5c88a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/feedback.go @@ -0,0 +1,247 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type Feedback struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newFeedback(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Feedback { + return &Feedback{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// CreateFeedback - Create Feedback +// Create feedback with client diagnostics, Datadog correlation context, and +// +// up to five WebP screenshots. Gated by the feedback feature flag; the +// submitter's identity is taken from the session, not the request. +func (s *Feedback) CreateFeedback(ctx context.Context, request *shared.CreateFeedbackRequest, opts ...operations.Option) (*operations.C1APIFeedbackV1FeedbackServiceCreateFeedbackResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/feedback") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.feedback.v1.FeedbackService.CreateFeedback", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFeedbackV1FeedbackServiceCreateFeedbackResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.CreateFeedbackResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.CreateFeedbackResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/finding.go b/vendor/github.com/conductorone/conductorone-sdk-go/finding.go index f1e93743..0910c5e4 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/finding.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/finding.go @@ -1084,6 +1084,218 @@ func (s *Finding) GetFinding(ctx context.Context, request operations.C1APIFindin } +// UpdateFindingAssignee - Update Finding Assignee +// Assign or clear a finding's assignee. +func (s *Finding) UpdateFindingAssignee(ctx context.Context, request operations.C1APIFindingV1FindingServiceUpdateFindingAssigneeRequest, opts ...operations.Option) (*operations.C1APIFindingV1FindingServiceUpdateFindingAssigneeResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/findings/{finding_id}/assignee", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.finding.v1.FindingService.UpdateFindingAssignee", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "UpdateFindingAssigneeRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFindingV1FindingServiceUpdateFindingAssigneeResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.UpdateFindingAssigneeResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.UpdateFindingAssigneeResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // UpdateFindingState - Update Finding State // Update finding workflow state (snooze, accept risk, suppress, reopen, resolve). func (s *Finding) UpdateFindingState(ctx context.Context, request operations.C1APIFindingV1FindingServiceUpdateFindingStateRequest, opts ...operations.Option) (*operations.C1APIFindingV1FindingServiceUpdateFindingStateResponse, error) { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/findingsettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/findingsettings.go new file mode 100644 index 00000000..ad6e36dd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/findingsettings.go @@ -0,0 +1,452 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type FindingSettings struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newFindingSettings(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *FindingSettings { + return &FindingSettings{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// ListFindingSettings - List Finding Settings +// List every configurable finding type and whether detection is enabled. +func (s *FindingSettings) ListFindingSettings(ctx context.Context, opts ...operations.Option) (*operations.C1APIFindingV1FindingSettingsServiceListFindingSettingsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/findings/settings") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.finding.v1.FindingSettingsService.ListFindingSettings", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFindingV1FindingSettingsServiceListFindingSettingsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ListFindingSettingsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ListFindingSettingsResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UpdateFindingSettings - Update Finding Settings +// Enable or disable detection for one or more finding types in a single +// +// write. Enabling a type whose detector is a scheduled job also queues an +// immediate run. +func (s *FindingSettings) UpdateFindingSettings(ctx context.Context, request *shared.UpdateFindingSettingsRequest, opts ...operations.Option) (*operations.C1APIFindingV1FindingSettingsServiceUpdateFindingSettingsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/findings/settings/update") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.finding.v1.FindingSettingsService.UpdateFindingSettings", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFindingV1FindingSettingsServiceUpdateFindingSettingsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.UpdateFindingSettingsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.UpdateFindingSettingsResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/functions.go b/vendor/github.com/conductorone/conductorone-sdk-go/functions.go index 6a7690d7..2aabc81c 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/functions.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/functions.go @@ -2756,10 +2756,16 @@ func (s *Functions) Test(ctx context.Context, request operations.C1APIFunctionsV } // UpdateFunction - Update Function -// Update an existing function's metadata. Also the publish path: set +// Update an existing function's metadata, code, or both. Also the publish // -// function.published_commit_id and include "published_commit_id" in -// update_mask to make a commit the default runnable version. +// path: set function.published_commit_id and include "published_commit_id" +// in update_mask to make a commit the default runnable version. To push a +// new code commit, set content (and optionally commit_message); this is +// independent of update_mask, since commits are versioned separately from +// function metadata. A single request cannot publish the commit it just +// created, since published_commit_id is validated against existing commits +// before content is committed: publishing new code takes two calls, push +// then publish with the returned commit.id. func (s *Functions) UpdateFunction(ctx context.Context, request *shared.FunctionsServiceUpdateFunctionRequest, opts ...operations.Option) (*operations.C1APIFunctionsV1FunctionsServiceUpdateFunctionResponse, error) { o := operations.Options{} supportedOptions := []string{ diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/functionsinvocation.go b/vendor/github.com/conductorone/conductorone-sdk-go/functionsinvocation.go index 4c1ec9b1..d82b9a47 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/functionsinvocation.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/functionsinvocation.go @@ -235,6 +235,215 @@ func (s *FunctionsInvocation) Get(ctx context.Context, request operations.C1APIF } +// GetResultDownloadURL - Get Result Download Url +// GetResultDownloadURL mints a short-lived download URL for an invocation +// +// result held outside the invocation row. The URL is generated at request +// time and never persisted; the invocation object itself exposes only the +// result's VFS path, size, checksum, media type, and expiry. +func (s *FunctionsInvocation) GetResultDownloadURL(ctx context.Context, request operations.C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLRequest, opts ...operations.Option) (*operations.C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/functions/{function_id}/invocations/{id}/result/download-url", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.functions.v1.FunctionsInvocationService.GetResultDownloadURL", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FunctionsInvocationServiceGetResultDownloadURLResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FunctionsInvocationServiceGetResultDownloadURLResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // List // List retrieves the invocation history for a function func (s *FunctionsInvocation) List(ctx context.Context, request operations.C1APIFunctionsV1FunctionsInvocationServiceListRequest, opts ...operations.Option) (*operations.C1APIFunctionsV1FunctionsInvocationServiceListResponse, error) { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/fundassignment.go b/vendor/github.com/conductorone/conductorone-sdk-go/fundassignment.go new file mode 100644 index 00000000..b0dcf503 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/fundassignment.go @@ -0,0 +1,1945 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type FundAssignment struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newFundAssignment(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *FundAssignment { + return &FundAssignment{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// ClearExtension - Clear Extension +// Revoke the extension early. The base limit underneath is untouched. +func (s *FundAssignment) ClearExtension(ctx context.Context, request operations.C1APIFundsV1FundAssignmentServiceClearExtensionRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundAssignmentServiceClearExtensionResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/assignments/{user_id}/extension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundAssignmentService.ClearExtension", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "FundAssignmentServiceClearExtensionRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundAssignmentServiceClearExtensionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundAssignmentServiceClearExtensionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundAssignmentServiceClearExtensionResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Delete +// Delete the whole assignment. The subject falls back to the rules and the +// +// tenant default. +func (s *FundAssignment) Delete(ctx context.Context, request operations.C1APIFundsV1FundAssignmentServiceDeleteRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundAssignmentServiceDeleteResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/assignments/{user_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundAssignmentService.Delete", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "FundAssignmentServiceDeleteRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundAssignmentServiceDeleteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundAssignmentServiceDeleteResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundAssignmentServiceDeleteResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Get +// Get returns one subject's exception: their own limit, any extension +// +// running on top of it, and any suspension. A subject with no exception is +// not found rather than reported at the tenant default, because no row is +// what "this subject is governed by the layers above" looks like. +func (s *FundAssignment) Get(ctx context.Context, request operations.C1APIFundsV1FundAssignmentServiceGetRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundAssignmentServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/assignments/{user_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundAssignmentService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundAssignmentServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundAssignmentServiceGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundAssignmentServiceGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GrantExtension - Grant Extension +// Grant a temporary total until expires_at. Never changes the period, and +// +// never expresses a refusal — a temporary refusal is a suspension. +func (s *FundAssignment) GrantExtension(ctx context.Context, request operations.C1APIFundsV1FundAssignmentServiceGrantExtensionRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundAssignmentServiceGrantExtensionResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/assignments/{user_id}/extension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundAssignmentService.GrantExtension", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "FundAssignmentServiceGrantExtensionRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundAssignmentServiceGrantExtensionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundAssignmentServiceGrantExtensionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundAssignmentServiceGrantExtensionResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHistory - List History +// List the change history for one subject's assignment, newest first. +func (s *FundAssignment) ListHistory(ctx context.Context, request operations.C1APIFundsV1FundAssignmentServiceListHistoryRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundAssignmentServiceListHistoryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/assignments/{user_id}/history", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundAssignmentService.ListHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundAssignmentServiceListHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundAssignmentServiceListHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundAssignmentServiceListHistoryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Search +// Search the tenant's assignments. Reads the Postgres mirror: the runtime +// +// row is keyed on (tenant, user), so there is no cross-subject query on the +// runtime plane at all. +func (s *FundAssignment) Search(ctx context.Context, request *shared.FundAssignmentServiceSearchRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundAssignmentServiceSearchResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/assignments/search") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundAssignmentService.Search", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundAssignmentServiceSearchResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundAssignmentServiceSearchResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundAssignmentServiceSearchResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetLimit - Set Limit +// Set the subject's base limit, creating the assignment if absent. Leaves any +// +// extension and any suspension in place. +func (s *FundAssignment) SetLimit(ctx context.Context, request operations.C1APIFundsV1FundAssignmentServiceSetLimitRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundAssignmentServiceSetLimitResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/assignments/{user_id}/limit", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundAssignmentService.SetLimit", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "FundAssignmentServiceSetLimitRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundAssignmentServiceSetLimitResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundAssignmentServiceSetLimitResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundAssignmentServiceSetLimitResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Suspend +// Freeze the subject's fund. The limit and any extension underneath are +// +// preserved and restored by Unsuspend. +func (s *FundAssignment) Suspend(ctx context.Context, request operations.C1APIFundsV1FundAssignmentServiceSuspendRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundAssignmentServiceSuspendResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/assignments/{user_id}/suspension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundAssignmentService.Suspend", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "FundAssignmentServiceSuspendRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundAssignmentServiceSuspendResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundAssignmentServiceSuspendResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundAssignmentServiceSuspendResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Unsuspend +// Lift the suspension, restoring the numbers it froze. +func (s *FundAssignment) Unsuspend(ctx context.Context, request operations.C1APIFundsV1FundAssignmentServiceUnsuspendRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundAssignmentServiceUnsuspendResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/assignments/{user_id}/suspension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundAssignmentService.Unsuspend", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "FundAssignmentServiceUnsuspendRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundAssignmentServiceUnsuspendResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundAssignmentServiceUnsuspendResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundAssignmentServiceUnsuspendResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/fundpolicy.go b/vendor/github.com/conductorone/conductorone-sdk-go/fundpolicy.go new file mode 100644 index 00000000..9184a5ba --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/fundpolicy.go @@ -0,0 +1,1735 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type FundPolicy struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newFundPolicy(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *FundPolicy { + return &FundPolicy{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Create +// Create the tenant's fund policy. default_limit is required: a tenant +// +// states its posture explicitly, and there is no implicit default anywhere +// in the write path. +func (s *FundPolicy) Create(ctx context.Context, request *shared.FundPolicyServiceCreateRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundPolicyServiceCreateResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/policy") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundPolicyService.Create", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundPolicyServiceCreateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundPolicyServiceCreateResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundPolicyServiceCreateResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Delete +// Delete the tenant's fund policy. Refused while spend governance is enabled +// +// because enabled inference requires this row. Disable governance and drain +// in-flight leases before calling Delete. +func (s *FundPolicy) Delete(ctx context.Context, request *shared.FundPolicyServiceDeleteRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundPolicyServiceDeleteResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/policy") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundPolicyService.Delete", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundPolicyServiceDeleteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundPolicyServiceDeleteResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundPolicyServiceDeleteResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// FreezeTenant - Freeze Tenant +// Freeze the whole tenant. The ceiling amount underneath is preserved and +// +// restored by Unfreeze. +func (s *FundPolicy) FreezeTenant(ctx context.Context, request *shared.FundPolicyServiceFreezeTenantRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundPolicyServiceFreezeTenantResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/policy/ceiling/suspension") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundPolicyService.FreezeTenant", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundPolicyServiceFreezeTenantResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundPolicyServiceFreezeTenantResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundPolicyServiceFreezeTenantResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Get +// Get the tenant's fund policy. An absent policy is a configuration state +// +// that prevents enabled metered inference from serving traffic. +func (s *FundPolicy) Get(ctx context.Context, opts ...operations.Option) (*operations.C1APIFundsV1FundPolicyServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/policy") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundPolicyService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundPolicyServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundPolicyServiceGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundPolicyServiceGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHistory - List History +// List the change history for the fund policy, newest first. Admin-tier per +// +// the object-history convention. +func (s *FundPolicy) ListHistory(ctx context.Context, request operations.C1APIFundsV1FundPolicyServiceListHistoryRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundPolicyServiceListHistoryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/policy/history") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundPolicyService.ListHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundPolicyServiceListHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundPolicyServiceListHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundPolicyServiceListHistoryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetOrgCeiling - Set Org Ceiling +// Set the org-wide ceiling: the bound on the tenant's total regardless of +// +// what any principal was granted. Amount arm only. An absent limit clears +// the ceiling only after spend governance is disabled. +func (s *FundPolicy) SetOrgCeiling(ctx context.Context, request *shared.FundPolicyServiceSetOrgCeilingRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundPolicyServiceSetOrgCeilingResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/policy/ceiling/limit") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundPolicyService.SetOrgCeiling", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundPolicyServiceSetOrgCeilingResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundPolicyServiceSetOrgCeilingResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundPolicyServiceSetOrgCeilingResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UnfreezeTenant - Unfreeze Tenant +// Lift the tenant freeze, restoring the ceiling it froze. +func (s *FundPolicy) UnfreezeTenant(ctx context.Context, request *shared.FundPolicyServiceUnfreezeTenantRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundPolicyServiceUnfreezeTenantResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/policy/ceiling/suspension") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundPolicyService.UnfreezeTenant", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundPolicyServiceUnfreezeTenantResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundPolicyServiceUnfreezeTenantResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundPolicyServiceUnfreezeTenantResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Update +// Update the period or the default limit. currency_code is fixed to USD at +// +// Create and immutable thereafter; update_mask rejects it. +func (s *FundPolicy) Update(ctx context.Context, request *shared.FundPolicyServiceUpdateRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundPolicyServiceUpdateResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/policy/update") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundPolicyService.Update", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundPolicyServiceUpdateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundPolicyServiceUpdateResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundPolicyServiceUpdateResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/fundrule.go b/vendor/github.com/conductorone/conductorone-sdk-go/fundrule.go new file mode 100644 index 00000000..0d3e0a14 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/fundrule.go @@ -0,0 +1,1521 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type FundRule struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newFundRule(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *FundRule { + return &FundRule{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Create +// Create funds a group. The group is an AppEntitlement, so membership +// +// resolves through that entitlement's bindings on every acquire rather than +// being captured here. Creating the tenant's first rule is what turns group +// resolution on for that tenant. +func (s *FundRule) Create(ctx context.Context, request *shared.FundRuleServiceCreateRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundRuleServiceCreateResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/rules") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundRuleService.Create", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundRuleServiceCreateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundRuleServiceCreateResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundRuleServiceCreateResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Delete +// Delete withdraws a group grant. The cohort keeps whatever the tenant +// +// default and any other rule matching them still allow, so this narrows their +// fund rather than necessarily cutting it off. The rule's history survives. +func (s *FundRule) Delete(ctx context.Context, request operations.C1APIFundsV1FundRuleServiceDeleteRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundRuleServiceDeleteResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/rules/{rule_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundRuleService.Delete", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "FundRuleServiceDeleteRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundRuleServiceDeleteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundRuleServiceDeleteResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundRuleServiceDeleteResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Get +// Get returns one rule: the group it funds, the grant it carries, and the +// +// label and reason an admin reads it by. A deleted rule is not found. +func (s *FundRule) Get(ctx context.Context, request operations.C1APIFundsV1FundRuleServiceGetRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundRuleServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/rules/{rule_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundRuleService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundRuleServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundRuleServiceGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundRuleServiceGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// List +// List every rule in the tenant. Reads the runtime plane: rule cardinality +// +// is the tenant's rule count, so this is the same one-partition read +// resolution does. +func (s *FundRule) List(ctx context.Context, request operations.C1APIFundsV1FundRuleServiceListRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundRuleServiceListResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/rules") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundRuleService.List", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundRuleServiceListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundRuleServiceListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundRuleServiceListResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHistory - List History +// List the change history for one rule, newest first. Admin-tier per the +// +// object-history convention. A deleted rule keeps its history: the delete is +// the last entry, and the one before it is the rule as it last stood. +func (s *FundRule) ListHistory(ctx context.Context, request operations.C1APIFundsV1FundRuleServiceListHistoryRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundRuleServiceListHistoryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/rules/{rule_id}/history", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundRuleService.ListHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundRuleServiceListHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundRuleServiceListHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundRuleServiceListHistoryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Search +// Search rules by display name. Reads the Postgres mirror. +func (s *FundRule) Search(ctx context.Context, request *shared.FundRuleServiceSearchRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundRuleServiceSearchResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/rules/search") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundRuleService.Search", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundRuleServiceSearchResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundRuleServiceSearchResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundRuleServiceSearchResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Update +// Update replaces the group, grant, label or reason on one rule, whichever +// +// the field mask names. The new grant governs the next acquire; spend already +// accounted for against the old one is not revisited. +func (s *FundRule) Update(ctx context.Context, request operations.C1APIFundsV1FundRuleServiceUpdateRequest, opts ...operations.Option) (*operations.C1APIFundsV1FundRuleServiceUpdateResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/rules/{rule_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.FundRuleService.Update", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "FundRuleServiceUpdateRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1FundRuleServiceUpdateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.FundRuleServiceUpdateResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FundRuleServiceUpdateResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/gatewaykey.go b/vendor/github.com/conductorone/conductorone-sdk-go/gatewaykey.go new file mode 100644 index 00000000..5298b003 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/gatewaykey.go @@ -0,0 +1,667 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type GatewayKey struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newGatewayKey(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *GatewayKey { + return &GatewayKey{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// List +// List returns the tenant's LLM gateway API keys. Only key metadata and a +// +// key prefix are returned, never the full key. +func (s *GatewayKey) List(ctx context.Context, opts ...operations.Option) (*operations.C1APILlmGatewayV1GatewayKeyServiceListResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/llm-gateway/keys") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.llm_gateway.v1.GatewayKeyService.List", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APILlmGatewayV1GatewayKeyServiceListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ListGatewayKeysResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ListGatewayKeysResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Mint +// Mint creates a new LLM gateway API key. The key value is shown only in +// +// this response and cannot be retrieved again; store it immediately. +func (s *GatewayKey) Mint(ctx context.Context, request *shared.MintGatewayKeyRequest, opts ...operations.Option) (*operations.C1APILlmGatewayV1GatewayKeyServiceMintResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/llm-gateway/keys") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.llm_gateway.v1.GatewayKeyService.Mint", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APILlmGatewayV1GatewayKeyServiceMintResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MintGatewayKeyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MintGatewayKeyResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Revoke +// Revoke revokes an LLM gateway API key by ID. The key immediately stops +// +// authenticating gateway requests. +func (s *GatewayKey) Revoke(ctx context.Context, request operations.C1APILlmGatewayV1GatewayKeyServiceRevokeRequest, opts ...operations.Option) (*operations.C1APILlmGatewayV1GatewayKeyServiceRevokeResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/llm-gateway/keys/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.llm_gateway.v1.GatewayKeyService.Revoke", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RevokeGatewayKeyRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APILlmGatewayV1GatewayKeyServiceRevokeResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.RevokeGatewayKeyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.RevokeGatewayKeyResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/gen.yaml b/vendor/github.com/conductorone/conductorone-sdk-go/gen.yaml index 8baad450..2a9fbce0 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/gen.yaml +++ b/vendor/github.com/conductorone/conductorone-sdk-go/gen.yaml @@ -26,7 +26,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false go: - version: 1.29.0 + version: 1.29.1 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false baseErrorName: ConductoroneAPIError @@ -37,6 +37,7 @@ go: flattenGlobalSecurity: true forwardCompatibleEnumsByDefault: false forwardCompatibleUnionsByDefault: "false" + idiomaticMethodCollisionNames: false imports: option: openapi paths: @@ -53,10 +54,12 @@ go: modulePath: "" multipartArrayFormat: legacy nullableOptionalWrapper: false + optionalMethodArguments: pointers outputModelSuffix: output packageName: github.com/conductorone/conductorone-sdk-go respectRequiredFields: false respectTitlesForPrimitiveUnionMembers: false responseFormat: envelope sdkPackageName: "" + unionGenerics: false unionStrategy: left-to-right diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/hooks.go b/vendor/github.com/conductorone/conductorone-sdk-go/hooks.go index 42ac61ca..b2fedf77 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/hooks.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/hooks.go @@ -32,7 +32,10 @@ func newHooks(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks } // Create -// Invokes the c1.api.hooks.v1.HooksService.Create method. +// Create creates a hook. The hook fires on the configured event, optionally +// +// filtered by a CEL expression. Creating a Patch tool input hook requires the +// preview feature to be enabled for the tenant. func (s *Hooks) Create(ctx context.Context, request *shared.HooksServiceCreateRequest, opts ...operations.Option) (*operations.C1APIHooksV1HooksServiceCreateResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -244,7 +247,9 @@ func (s *Hooks) Create(ctx context.Context, request *shared.HooksServiceCreateRe } // Delete -// Invokes the c1.api.hooks.v1.HooksService.Delete method. +// Delete removes a hook by ID. A hook referenced by a guardrail rule cannot +// +// be deleted until the reference is removed. func (s *Hooks) Delete(ctx context.Context, request operations.C1APIHooksV1HooksServiceDeleteRequest, opts ...operations.Option) (*operations.C1APIHooksV1HooksServiceDeleteResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -456,7 +461,7 @@ func (s *Hooks) Delete(ctx context.Context, request operations.C1APIHooksV1Hooks } // Get -// Invokes the c1.api.hooks.v1.HooksService.Get method. +// Get returns a hook by ID. func (s *Hooks) Get(ctx context.Context, request operations.C1APIHooksV1HooksServiceGetRequest, opts ...operations.Option) (*operations.C1APIHooksV1HooksServiceGetResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -661,7 +666,7 @@ func (s *Hooks) Get(ctx context.Context, request operations.C1APIHooksV1HooksSer } // List -// Invokes the c1.api.hooks.v1.HooksService.List method. +// List returns all hooks for the tenant, paginated. func (s *Hooks) List(ctx context.Context, request operations.C1APIHooksV1HooksServiceListRequest, opts ...operations.Option) (*operations.C1APIHooksV1HooksServiceListResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -870,7 +875,10 @@ func (s *Hooks) List(ctx context.Context, request operations.C1APIHooksV1HooksSe } // Update -// Invokes the c1.api.hooks.v1.HooksService.Update method. +// Update modifies a hook's display name, description, event, filter, priority, +// +// or configuration. A hook referenced by a guardrail rule cannot stop being +// managed by guardrails until the reference is removed. func (s *Hooks) Update(ctx context.Context, request operations.C1APIHooksV1HooksServiceUpdateRequest, opts ...operations.Option) (*operations.C1APIHooksV1HooksServiceUpdateResponse, error) { o := operations.Options{} supportedOptions := []string{ diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/hookssearch.go b/vendor/github.com/conductorone/conductorone-sdk-go/hookssearch.go index b9b97ffd..8312eb39 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/hookssearch.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/hookssearch.go @@ -32,7 +32,9 @@ func newHooksSearch(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, } // Search -// Invokes the c1.api.hooks.v1.HooksSearch.Search method. +// Search returns hooks for the tenant, paginated. Setting query or refs +// +// returns UNIMPLEMENTED; filtering is not yet supported. func (s *HooksSearch) Search(ctx context.Context, request *shared.HooksSearchRequest, opts ...operations.Option) (*operations.C1APIHooksV1HooksSearchSearchResponse, error) { o := operations.Options{} supportedOptions := []string{ diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/mcpaccessprofile.go b/vendor/github.com/conductorone/conductorone-sdk-go/mcpaccessprofile.go index c0218b94..44406524 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/mcpaccessprofile.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/mcpaccessprofile.go @@ -14,6 +14,7 @@ import ( "github.com/conductorone/conductorone-sdk-go/pkg/retry" "github.com/conductorone/conductorone-sdk-go/pkg/utils" "net/http" + "net/url" ) type MCPAccessProfile struct { @@ -1292,6 +1293,219 @@ func (s *MCPAccessProfile) ListRequestableConnectors(ctx context.Context, reques } +// SearchAccessProfiles - Search Access Profiles +// SearchAccessProfiles returns the tenant's MCP toolsets (access profiles) +// +// across every (app_id, connector_id), filtered by a case-insensitive search +// over display_name and paginated. Backs the agent-config multi-select that +// binds toolsets to a ClawAgent. +func (s *MCPAccessProfile) SearchAccessProfiles(ctx context.Context, request operations.C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesRequest, opts ...operations.Option) (*operations.C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/mcp_toolsets/search") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.ai_governance.v1.MCPAccessProfileService.SearchAccessProfiles", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MCPAccessProfileServiceSearchAccessProfilesResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MCPAccessProfileServiceSearchAccessProfilesResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // SearchRequestableConnectors - Search Requestable Connectors // SearchRequestableConnectors returns card-ready entries — one per MCP // diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/mcpresource.go b/vendor/github.com/conductorone/conductorone-sdk-go/mcpresource.go new file mode 100644 index 00000000..e0132ca5 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/mcpresource.go @@ -0,0 +1,1093 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" +) + +type MCPResource struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newMCPResource(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *MCPResource { + return &MCPResource{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Get +// Get retrieves a single discovered MCP resource by app_id + connector_id + +// +// id, including its approval state, kind, URI or URI template, and bound +// app_entitlement_id. +func (s *MCPResource) Get(ctx context.Context, request operations.C1APIAiGovernanceV1MCPResourceServiceGetRequest, opts ...operations.Option) (*operations.C1APIAiGovernanceV1MCPResourceServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/connectors/{connector_id}/mcp_resources/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.ai_governance.v1.MCPResourceService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAiGovernanceV1MCPResourceServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MCPResourceServiceGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MCPResourceServiceGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// List +// List returns the MCP resources discovered for a single (app_id, +// +// connector_id), paginated. To filter by kind or state, use Search. +func (s *MCPResource) List(ctx context.Context, request operations.C1APIAiGovernanceV1MCPResourceServiceListRequest, opts ...operations.Option) (*operations.C1APIAiGovernanceV1MCPResourceServiceListResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/connectors/{connector_id}/mcp_resources", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.ai_governance.v1.MCPResourceService.List", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAiGovernanceV1MCPResourceServiceListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MCPResourceServiceListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MCPResourceServiceListResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHistory - List History +// ListHistory returns the change history (newest first) for a single MCP +// +// resource — each entry is a snapshot plus who/when metadata. +func (s *MCPResource) ListHistory(ctx context.Context, request operations.C1APIAiGovernanceV1MCPResourceServiceListHistoryRequest, opts ...operations.Option) (*operations.C1APIAiGovernanceV1MCPResourceServiceListHistoryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/connectors/{connector_id}/mcp_resources/{id}/history", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.ai_governance.v1.MCPResourceService.ListHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAiGovernanceV1MCPResourceServiceListHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MCPResourceServiceListHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MCPResourceServiceListHistoryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Search +// Search returns a connector's MCP resources filtered by kind, state, or +// +// text query. Filter on MCP_RESOURCE_STATE_PENDING_REVIEW to find resources +// awaiting approval, then approve them with Update. +func (s *MCPResource) Search(ctx context.Context, request operations.C1APIAiGovernanceV1MCPResourceServiceSearchRequest, opts ...operations.Option) (*operations.C1APIAiGovernanceV1MCPResourceServiceSearchResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/connectors/{connector_id}/mcp_resources/search", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.ai_governance.v1.MCPResourceService.Search", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "MCPResourceServiceSearchRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAiGovernanceV1MCPResourceServiceSearchResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MCPResourceServiceSearchResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MCPResourceServiceSearchResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Update +// Update modifies a resource's lifecycle state via update_mask. Set +// +// resource.state = MCP_RESOURCE_STATE_APPROVED with update_mask "state" to +// move it out of PENDING_REVIEW (or DISABLED to block it). Resource metadata +// is discovery-owned and read-only. resource must include id, app_id, and +// connector_id. +func (s *MCPResource) Update(ctx context.Context, request operations.C1APIAiGovernanceV1MCPResourceServiceUpdateRequest, opts ...operations.Option) (*operations.C1APIAiGovernanceV1MCPResourceServiceUpdateResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/connectors/{connector_id}/mcp_resources/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.ai_governance.v1.MCPResourceService.Update", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "MCPResourceServiceUpdateRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIAiGovernanceV1MCPResourceServiceUpdateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MCPResourceServiceUpdateResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MCPResourceServiceUpdateResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/mcpserver.go b/vendor/github.com/conductorone/conductorone-sdk-go/mcpserver.go index 3701079c..9303343a 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/mcpserver.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/mcpserver.go @@ -871,7 +871,7 @@ func (s *MCPServer) GetCatalog(ctx context.Context, request operations.C1APIAiGo } // List -// List retrieves MCP servers for an app. +// List retrieves MCP servers, optionally narrowed to an app. func (s *MCPServer) List(ctx context.Context, request operations.C1APIAiGovernanceV1MCPServerServiceListRequest, opts ...operations.Option) (*operations.C1APIAiGovernanceV1MCPServerServiceListResponse, error) { o := operations.Options{} supportedOptions := []string{ diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/myfundlimits.go b/vendor/github.com/conductorone/conductorone-sdk-go/myfundlimits.go new file mode 100644 index 00000000..ba732597 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/myfundlimits.go @@ -0,0 +1,1312 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type MyFundLimits struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newMyFundLimits(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *MyFundLimits { + return &MyFundLimits{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Delete +// Remove the caller's limit on this app entirely. The app is then bounded +// +// only by the fund and by any tenant-wide cap. +func (s *MyFundLimits) Delete(ctx context.Context, request operations.C1APIFundsV1MyFundLimitsServiceDeleteRequest, opts ...operations.Option) (*operations.C1APIFundsV1MyFundLimitsServiceDeleteResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/my/app-limits/{app_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.MyFundLimitsService.Delete", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "MyFundLimitsServiceDeleteRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1MyFundLimitsServiceDeleteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MyFundLimitsServiceDeleteResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MyFundLimitsServiceDeleteResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// List +// List the caller's own per-app limits. +func (s *MyFundLimits) List(ctx context.Context, request operations.C1APIFundsV1MyFundLimitsServiceListRequest, opts ...operations.Option) (*operations.C1APIFundsV1MyFundLimitsServiceListResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/my/app-limits") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.MyFundLimitsService.List", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1MyFundLimitsServiceListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MyFundLimitsServiceListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MyFundLimitsServiceListResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHistory - List History +// List the change history for one of the caller's own per-app limits, newest +// +// first. Removing the last control deletes the row, so this is where a subject +// reads back the pause they lifted and when they lifted it. +// +// VIEWER, not the OWNER the two admin-plane history RPCs use. This service +// carries no user id in any request, so it can only ever return the caller's +// own rows: gating it at OWNER would put an owner role in front of the +// caller's own data and still return nothing but that. An admin auditing +// another subject's app limits needs an admin-plane read, which this service +// is not and deliberately does not become. +func (s *MyFundLimits) ListHistory(ctx context.Context, request operations.C1APIFundsV1MyFundLimitsServiceListHistoryRequest, opts ...operations.Option) (*operations.C1APIFundsV1MyFundLimitsServiceListHistoryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/my/app-limits/{app_id}/history", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.MyFundLimitsService.ListHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1MyFundLimitsServiceListHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MyFundLimitsServiceListHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MyFundLimitsServiceListHistoryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Pause +// Pause one app on the caller's own fund. The limit underneath is preserved +// +// and restored by Resume. Denials name this as paused by you. +func (s *MyFundLimits) Pause(ctx context.Context, request operations.C1APIFundsV1MyFundLimitsServicePauseRequest, opts ...operations.Option) (*operations.C1APIFundsV1MyFundLimitsServicePauseResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/my/app-limits/{app_id}/suspension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.MyFundLimitsService.Pause", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "MyFundLimitsServicePauseRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1MyFundLimitsServicePauseResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MyFundLimitsServicePauseResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MyFundLimitsServicePauseResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Resume +// Un-pause the app, restoring the limit it froze. +func (s *MyFundLimits) Resume(ctx context.Context, request operations.C1APIFundsV1MyFundLimitsServiceResumeRequest, opts ...operations.Option) (*operations.C1APIFundsV1MyFundLimitsServiceResumeResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/my/app-limits/{app_id}/suspension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.MyFundLimitsService.Resume", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "MyFundLimitsServiceResumeRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1MyFundLimitsServiceResumeResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MyFundLimitsServiceResumeResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MyFundLimitsServiceResumeResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetLimit - Set Limit +// Cap what one app may take from the caller's own fund. Amount arm only. +func (s *MyFundLimits) SetLimit(ctx context.Context, request operations.C1APIFundsV1MyFundLimitsServiceSetLimitRequest, opts ...operations.Option) (*operations.C1APIFundsV1MyFundLimitsServiceSetLimitResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/my/app-limits/{app_id}/limit", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.MyFundLimitsService.SetLimit", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "MyFundLimitsServiceSetLimitRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1MyFundLimitsServiceSetLimitResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.MyFundLimitsServiceSetLimitResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MyFundLimitsServiceSetLimitResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/papersecret.go b/vendor/github.com/conductorone/conductorone-sdk-go/papersecret.go index c09d547c..b646c87b 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/papersecret.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/papersecret.go @@ -1724,6 +1724,223 @@ func (s *PaperSecret) SearchMySecrets(ctx context.Context, request *shared.Paper } +// SearchSecretsSharedWithMe - Search Secrets Shared With Me +// SearchSecretsSharedWithMe returns secrets shared with the current user. +// +// Automatically scoped to current user - no user_id filter parameter. +// INTERNAL secrets only: EXTERNAL secrets are addressed by email and are never +// viewable through an authenticated C1 session, so returning them here would +// surface rows that GetContent then denies. +func (s *PaperSecret) SearchSecretsSharedWithMe(ctx context.Context, request *shared.PaperSecretServiceSearchSecretsSharedWithMeRequest, opts ...operations.Option) (*operations.C1APISecretsV1PaperSecretServiceSearchSecretsSharedWithMeResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/search/secrets/shared_with_me") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.secrets.v1.PaperSecretService.SearchSecretsSharedWithMe", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISecretsV1PaperSecretServiceSearchSecretsSharedWithMeResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.PaperSecretServiceSearchResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PaperSecretServiceSearchResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // SetTextContent - Set Text Content // SetTextContent sets the encrypted content for a text secret. // diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apia2uiv1a2uiservicegetsurfaceprovenance.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apia2uiv1a2uiservicegetsurfaceprovenance.go new file mode 100644 index 00000000..d258b3be --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apia2uiv1a2uiservicegetsurfaceprovenance.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIA2uiV1A2UIServiceGetSurfaceProvenanceRequest struct { + ConversationID string `pathParam:"style=simple,explode=false,name=conversation_id"` + SurfaceID string `pathParam:"style=simple,explode=false,name=surface_id"` +} + +func (c *C1APIA2uiV1A2UIServiceGetSurfaceProvenanceRequest) GetConversationID() string { + if c == nil { + return "" + } + return c.ConversationID +} + +func (c *C1APIA2uiV1A2UIServiceGetSurfaceProvenanceRequest) GetSurfaceID() string { + if c == nil { + return "" + } + return c.SurfaceID +} + +// #region class-body-c1apia2uiv1a2uiservicegetsurfaceprovenancerequest +// #endregion class-body-c1apia2uiv1a2uiservicegetsurfaceprovenancerequest + +type C1APIA2uiV1A2UIServiceGetSurfaceProvenanceResponse struct { + // A2UIServiceGetSurfaceProvenanceResponse returns what a surface was built + // from: the steps its program ran, and the sources its components report. + A2UIServiceGetSurfaceProvenanceResponse *shared.A2UIServiceGetSurfaceProvenanceResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIA2uiV1A2UIServiceGetSurfaceProvenanceResponse) GetA2UIServiceGetSurfaceProvenanceResponse() *shared.A2UIServiceGetSurfaceProvenanceResponse { + if c == nil { + return nil + } + return c.A2UIServiceGetSurfaceProvenanceResponse +} + +func (c *C1APIA2uiV1A2UIServiceGetSurfaceProvenanceResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIA2uiV1A2UIServiceGetSurfaceProvenanceResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIA2uiV1A2UIServiceGetSurfaceProvenanceResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apia2uiv1a2uiservicegetsurfaceprovenanceresponse +// #endregion class-body-c1apia2uiv1a2uiservicegetsurfaceprovenanceresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaccessreviewv1accessreviewactionsservicegeneratereport.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaccessreviewv1accessreviewactionsservicegeneratereport.go new file mode 100644 index 00000000..ab755c41 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaccessreviewv1accessreviewactionsservicegeneratereport.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportRequest struct { + AccessReviewActionsServiceGenerateReportRequest *shared.AccessReviewActionsServiceGenerateReportRequest `request:"mediaType=application/json"` + AccessReviewID string `pathParam:"style=simple,explode=false,name=access_review_id"` +} + +func (c *C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportRequest) GetAccessReviewActionsServiceGenerateReportRequest() *shared.AccessReviewActionsServiceGenerateReportRequest { + if c == nil { + return nil + } + return c.AccessReviewActionsServiceGenerateReportRequest +} + +func (c *C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportRequest) GetAccessReviewID() string { + if c == nil { + return "" + } + return c.AccessReviewID +} + +// #region class-body-c1apiaccessreviewv1accessreviewactionsservicegeneratereportrequest +// #endregion class-body-c1apiaccessreviewv1accessreviewactionsservicegeneratereportrequest + +type C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportResponse struct { + // Successful response + AccessReviewActionsServiceGenerateReportResponse *shared.AccessReviewActionsServiceGenerateReportResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportResponse) GetAccessReviewActionsServiceGenerateReportResponse() *shared.AccessReviewActionsServiceGenerateReportResponse { + if c == nil { + return nil + } + return c.AccessReviewActionsServiceGenerateReportResponse +} + +func (c *C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAccessreviewV1AccessReviewActionsServiceGenerateReportResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiaccessreviewv1accessreviewactionsservicegeneratereportresponse +// #endregion class-body-c1apiaccessreviewv1accessreviewactionsservicegeneratereportresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaccessreviewv1accessreviewreportservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaccessreviewv1accessreviewreportservicelist.go new file mode 100644 index 00000000..e7eef699 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaccessreviewv1accessreviewreportservicelist.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAccessreviewV1AccessReviewReportServiceListRequest struct { + AccessReviewID string `pathParam:"style=simple,explode=false,name=access_review_id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIAccessreviewV1AccessReviewReportServiceListRequest) GetAccessReviewID() string { + if c == nil { + return "" + } + return c.AccessReviewID +} + +func (c *C1APIAccessreviewV1AccessReviewReportServiceListRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIAccessreviewV1AccessReviewReportServiceListRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apiaccessreviewv1accessreviewreportservicelistrequest +// #endregion class-body-c1apiaccessreviewv1accessreviewreportservicelistrequest + +type C1APIAccessreviewV1AccessReviewReportServiceListResponse struct { + // Successful response + AccessReviewReportServiceListResponse *shared.AccessReviewReportServiceListResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAccessreviewV1AccessReviewReportServiceListResponse) GetAccessReviewReportServiceListResponse() *shared.AccessReviewReportServiceListResponse { + if c == nil { + return nil + } + return c.AccessReviewReportServiceListResponse +} + +func (c *C1APIAccessreviewV1AccessReviewReportServiceListResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAccessreviewV1AccessReviewReportServiceListResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAccessreviewV1AccessReviewReportServiceListResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiaccessreviewv1accessreviewreportservicelistresponse +// #endregion class-body-c1apiaccessreviewv1accessreviewreportservicelistresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpaccessprofileservicesearchaccessprofiles.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpaccessprofileservicesearchaccessprofiles.go new file mode 100644 index 00000000..dc9a83cf --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpaccessprofileservicesearchaccessprofiles.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesRequest struct { + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` + Query *string `queryParam:"style=form,explode=true,name=query"` +} + +func (c *C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +func (c *C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesRequest) GetQuery() *string { + if c == nil { + return nil + } + return c.Query +} + +// #region class-body-c1apiaigovernancev1mcpaccessprofileservicesearchaccessprofilesrequest +// #endregion class-body-c1apiaigovernancev1mcpaccessprofileservicesearchaccessprofilesrequest + +type C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesResponse struct { + // HTTP response content type for this operation + ContentType string + // MCPAccessProfileServiceSearchAccessProfilesResponse returns one page of + // tenant-wide MCP access profiles. + MCPAccessProfileServiceSearchAccessProfilesResponse *shared.MCPAccessProfileServiceSearchAccessProfilesResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesResponse) GetMCPAccessProfileServiceSearchAccessProfilesResponse() *shared.MCPAccessProfileServiceSearchAccessProfilesResponse { + if c == nil { + return nil + } + return c.MCPAccessProfileServiceSearchAccessProfilesResponse +} + +func (c *C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAiGovernanceV1MCPAccessProfileServiceSearchAccessProfilesResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiaigovernancev1mcpaccessprofileservicesearchaccessprofilesresponse +// #endregion class-body-c1apiaigovernancev1mcpaccessprofileservicesearchaccessprofilesresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceserviceget.go new file mode 100644 index 00000000..74f69e41 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceserviceget.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAiGovernanceV1MCPResourceServiceGetRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ConnectorID string `pathParam:"style=simple,explode=false,name=connector_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceGetRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceGetRequest) GetConnectorID() string { + if c == nil { + return "" + } + return c.ConnectorID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceGetRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apiaigovernancev1mcpresourceservicegetrequest +// #endregion class-body-c1apiaigovernancev1mcpresourceservicegetrequest + +type C1APIAiGovernanceV1MCPResourceServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // MCPResourceServiceGetResponse returns a single MCP resource. + MCPResourceServiceGetResponse *shared.MCPResourceServiceGetResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceGetResponse) GetMCPResourceServiceGetResponse() *shared.MCPResourceServiceGetResponse { + if c == nil { + return nil + } + return c.MCPResourceServiceGetResponse +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiaigovernancev1mcpresourceservicegetresponse +// #endregion class-body-c1apiaigovernancev1mcpresourceservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicelist.go new file mode 100644 index 00000000..81d98c24 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicelist.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAiGovernanceV1MCPResourceServiceListRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ConnectorID string `pathParam:"style=simple,explode=false,name=connector_id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListRequest) GetConnectorID() string { + if c == nil { + return "" + } + return c.ConnectorID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apiaigovernancev1mcpresourceservicelistrequest +// #endregion class-body-c1apiaigovernancev1mcpresourceservicelistrequest + +type C1APIAiGovernanceV1MCPResourceServiceListResponse struct { + // HTTP response content type for this operation + ContentType string + // MCPResourceServiceListResponse returns a list of MCP resources. + MCPResourceServiceListResponse *shared.MCPResourceServiceListResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListResponse) GetMCPResourceServiceListResponse() *shared.MCPResourceServiceListResponse { + if c == nil { + return nil + } + return c.MCPResourceServiceListResponse +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiaigovernancev1mcpresourceservicelistresponse +// #endregion class-body-c1apiaigovernancev1mcpresourceservicelistresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicelisthistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicelisthistory.go new file mode 100644 index 00000000..61fc9945 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicelisthistory.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAiGovernanceV1MCPResourceServiceListHistoryRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ConnectorID string `pathParam:"style=simple,explode=false,name=connector_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListHistoryRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListHistoryRequest) GetConnectorID() string { + if c == nil { + return "" + } + return c.ConnectorID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListHistoryRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListHistoryRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListHistoryRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apiaigovernancev1mcpresourceservicelisthistoryrequest +// #endregion class-body-c1apiaigovernancev1mcpresourceservicelisthistoryrequest + +type C1APIAiGovernanceV1MCPResourceServiceListHistoryResponse struct { + // HTTP response content type for this operation + ContentType string + // MCPResourceServiceListHistoryResponse returns MCP resource history entries. + MCPResourceServiceListHistoryResponse *shared.MCPResourceServiceListHistoryResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListHistoryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListHistoryResponse) GetMCPResourceServiceListHistoryResponse() *shared.MCPResourceServiceListHistoryResponse { + if c == nil { + return nil + } + return c.MCPResourceServiceListHistoryResponse +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListHistoryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceListHistoryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiaigovernancev1mcpresourceservicelisthistoryresponse +// #endregion class-body-c1apiaigovernancev1mcpresourceservicelisthistoryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicesearch.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicesearch.go new file mode 100644 index 00000000..18bfde07 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceservicesearch.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAiGovernanceV1MCPResourceServiceSearchRequest struct { + MCPResourceServiceSearchRequest *shared.MCPResourceServiceSearchRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ConnectorID string `pathParam:"style=simple,explode=false,name=connector_id"` +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceSearchRequest) GetMCPResourceServiceSearchRequest() *shared.MCPResourceServiceSearchRequest { + if c == nil { + return nil + } + return c.MCPResourceServiceSearchRequest +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceSearchRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceSearchRequest) GetConnectorID() string { + if c == nil { + return "" + } + return c.ConnectorID +} + +// #region class-body-c1apiaigovernancev1mcpresourceservicesearchrequest +// #endregion class-body-c1apiaigovernancev1mcpresourceservicesearchrequest + +type C1APIAiGovernanceV1MCPResourceServiceSearchResponse struct { + // HTTP response content type for this operation + ContentType string + // MCPResourceServiceSearchResponse returns matching MCP resources. + MCPResourceServiceSearchResponse *shared.MCPResourceServiceSearchResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceSearchResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceSearchResponse) GetMCPResourceServiceSearchResponse() *shared.MCPResourceServiceSearchResponse { + if c == nil { + return nil + } + return c.MCPResourceServiceSearchResponse +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceSearchResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceSearchResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiaigovernancev1mcpresourceservicesearchresponse +// #endregion class-body-c1apiaigovernancev1mcpresourceservicesearchresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceserviceupdate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceserviceupdate.go new file mode 100644 index 00000000..b7fea1d1 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpresourceserviceupdate.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAiGovernanceV1MCPResourceServiceUpdateRequest struct { + MCPResourceServiceUpdateRequest *shared.MCPResourceServiceUpdateRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ConnectorID string `pathParam:"style=simple,explode=false,name=connector_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceUpdateRequest) GetMCPResourceServiceUpdateRequest() *shared.MCPResourceServiceUpdateRequest { + if c == nil { + return nil + } + return c.MCPResourceServiceUpdateRequest +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceUpdateRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceUpdateRequest) GetConnectorID() string { + if c == nil { + return "" + } + return c.ConnectorID +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceUpdateRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apiaigovernancev1mcpresourceserviceupdaterequest +// #endregion class-body-c1apiaigovernancev1mcpresourceserviceupdaterequest + +type C1APIAiGovernanceV1MCPResourceServiceUpdateResponse struct { + // HTTP response content type for this operation + ContentType string + // MCPResourceServiceUpdateResponse returns the updated MCP resource. + MCPResourceServiceUpdateResponse *shared.MCPResourceServiceUpdateResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceUpdateResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceUpdateResponse) GetMCPResourceServiceUpdateResponse() *shared.MCPResourceServiceUpdateResponse { + if c == nil { + return nil + } + return c.MCPResourceServiceUpdateResponse +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceUpdateResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAiGovernanceV1MCPResourceServiceUpdateResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiaigovernancev1mcpresourceserviceupdateresponse +// #endregion class-body-c1apiaigovernancev1mcpresourceserviceupdateresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpserverservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpserverservicelist.go index 3afdf80c..0e6c33af 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpserverservicelist.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiaigovernancev1mcpserverservicelist.go @@ -11,6 +11,7 @@ type C1APIAiGovernanceV1MCPServerServiceListRequest struct { AppID string `pathParam:"style=simple,explode=false,name=app_id"` PageSize *int `queryParam:"style=form,explode=true,name=page_size"` PageToken *string `queryParam:"style=form,explode=true,name=page_token"` + Query *string `queryParam:"style=form,explode=true,name=query"` } func (c *C1APIAiGovernanceV1MCPServerServiceListRequest) GetAppID() string { @@ -34,6 +35,13 @@ func (c *C1APIAiGovernanceV1MCPServerServiceListRequest) GetPageToken() *string return c.PageToken } +func (c *C1APIAiGovernanceV1MCPServerServiceListRequest) GetQuery() *string { + if c == nil { + return nil + } + return c.Query +} + // #region class-body-c1apiaigovernancev1mcpserverservicelistrequest // #endregion class-body-c1apiaigovernancev1mcpserverservicelistrequest diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appentitlementsearchservicesearchreachableresourcesforuser.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appentitlementsearchservicesearchreachableresourcesforuser.go new file mode 100644 index 00000000..8e166ef7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appentitlementsearchservicesearchreachableresourcesforuser.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAppV1AppEntitlementSearchServiceSearchReachableResourcesForUserResponse struct { + // SearchReachableResourcesForUser response. Resources are deduplicated: a + // resource reachable through more than one grant or entitlement appears once. + AppEntitlementSearchServiceSearchReachableResourcesForUserResponse *shared.AppEntitlementSearchServiceSearchReachableResourcesForUserResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAppV1AppEntitlementSearchServiceSearchReachableResourcesForUserResponse) GetAppEntitlementSearchServiceSearchReachableResourcesForUserResponse() *shared.AppEntitlementSearchServiceSearchReachableResourcesForUserResponse { + if c == nil { + return nil + } + return c.AppEntitlementSearchServiceSearchReachableResourcesForUserResponse +} + +func (c *C1APIAppV1AppEntitlementSearchServiceSearchReachableResourcesForUserResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAppV1AppEntitlementSearchServiceSearchReachableResourcesForUserResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAppV1AppEntitlementSearchServiceSearchReachableResourcesForUserResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiappv1appentitlementsearchservicesearchreachableresourcesforuserresponse +// #endregion class-body-c1apiappv1appentitlementsearchservicesearchreachableresourcesforuserresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appentitlementslist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appentitlementslist.go index e7242ef4..32333740 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appentitlementslist.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appentitlementslist.go @@ -9,8 +9,10 @@ import ( type C1APIAppV1AppEntitlementsListRequest struct { AppID string `pathParam:"style=simple,explode=false,name=app_id"` + AppUserID *string `queryParam:"style=form,explode=true,name=app_user_id"` PageSize *int `queryParam:"style=form,explode=true,name=page_size"` PageToken *string `queryParam:"style=form,explode=true,name=page_token"` + Q *string `queryParam:"style=form,explode=true,name=q"` } func (c *C1APIAppV1AppEntitlementsListRequest) GetAppID() string { @@ -20,6 +22,13 @@ func (c *C1APIAppV1AppEntitlementsListRequest) GetAppID() string { return c.AppID } +func (c *C1APIAppV1AppEntitlementsListRequest) GetAppUserID() *string { + if c == nil { + return nil + } + return c.AppUserID +} + func (c *C1APIAppV1AppEntitlementsListRequest) GetPageSize() *int { if c == nil { return nil @@ -34,6 +43,13 @@ func (c *C1APIAppV1AppEntitlementsListRequest) GetPageToken() *string { return c.PageToken } +func (c *C1APIAppV1AppEntitlementsListRequest) GetQ() *string { + if c == nil { + return nil + } + return c.Q +} + // #region class-body-c1apiappv1appentitlementslistrequest // #endregion class-body-c1apiappv1appentitlementslistrequest diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateserviceget.go new file mode 100644 index 00000000..5ac20779 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateserviceget.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAppV1AppManagedStateServiceGetRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ResourceID string `pathParam:"style=simple,explode=false,name=resource_id"` + ResourceTypeID string `pathParam:"style=simple,explode=false,name=resource_type_id"` +} + +func (c *C1APIAppV1AppManagedStateServiceGetRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIAppV1AppManagedStateServiceGetRequest) GetResourceID() string { + if c == nil { + return "" + } + return c.ResourceID +} + +func (c *C1APIAppV1AppManagedStateServiceGetRequest) GetResourceTypeID() string { + if c == nil { + return "" + } + return c.ResourceTypeID +} + +// #region class-body-c1apiappv1appmanagedstateservicegetrequest +// #endregion class-body-c1apiappv1appmanagedstateservicegetrequest + +type C1APIAppV1AppManagedStateServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // GetAppManagedStateBindingResponse contains the managed state of a discovered application. + GetAppManagedStateBindingResponse *shared.GetAppManagedStateBindingResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAppV1AppManagedStateServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAppV1AppManagedStateServiceGetResponse) GetGetAppManagedStateBindingResponse() *shared.GetAppManagedStateBindingResponse { + if c == nil { + return nil + } + return c.GetAppManagedStateBindingResponse +} + +func (c *C1APIAppV1AppManagedStateServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAppV1AppManagedStateServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiappv1appmanagedstateservicegetresponse +// #endregion class-body-c1apiappv1appmanagedstateservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateservicelist.go new file mode 100644 index 00000000..a7a5ef79 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateservicelist.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAppV1AppManagedStateServiceListRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` + ResourceTypeID string `pathParam:"style=simple,explode=false,name=resource_type_id"` +} + +func (c *C1APIAppV1AppManagedStateServiceListRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIAppV1AppManagedStateServiceListRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIAppV1AppManagedStateServiceListRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +func (c *C1APIAppV1AppManagedStateServiceListRequest) GetResourceTypeID() string { + if c == nil { + return "" + } + return c.ResourceTypeID +} + +// #region class-body-c1apiappv1appmanagedstateservicelistrequest +// #endregion class-body-c1apiappv1appmanagedstateservicelistrequest + +type C1APIAppV1AppManagedStateServiceListResponse struct { + // HTTP response content type for this operation + ContentType string + // ListAppManagedStateBindingsResponse contains one page of discovered application managed states. + ListAppManagedStateBindingsResponse *shared.ListAppManagedStateBindingsResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAppV1AppManagedStateServiceListResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAppV1AppManagedStateServiceListResponse) GetListAppManagedStateBindingsResponse() *shared.ListAppManagedStateBindingsResponse { + if c == nil { + return nil + } + return c.ListAppManagedStateBindingsResponse +} + +func (c *C1APIAppV1AppManagedStateServiceListResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAppV1AppManagedStateServiceListResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiappv1appmanagedstateservicelistresponse +// #endregion class-body-c1apiappv1appmanagedstateservicelistresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateservicepromote.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateservicepromote.go new file mode 100644 index 00000000..2f08a265 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appmanagedstateservicepromote.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIAppV1AppManagedStateServicePromoteRequest struct { + PromoteAppManagedStateBindingRequest *shared.PromoteAppManagedStateBindingRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ResourceID string `pathParam:"style=simple,explode=false,name=resource_id"` + ResourceTypeID string `pathParam:"style=simple,explode=false,name=resource_type_id"` +} + +func (c *C1APIAppV1AppManagedStateServicePromoteRequest) GetPromoteAppManagedStateBindingRequest() *shared.PromoteAppManagedStateBindingRequest { + if c == nil { + return nil + } + return c.PromoteAppManagedStateBindingRequest +} + +func (c *C1APIAppV1AppManagedStateServicePromoteRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIAppV1AppManagedStateServicePromoteRequest) GetResourceID() string { + if c == nil { + return "" + } + return c.ResourceID +} + +func (c *C1APIAppV1AppManagedStateServicePromoteRequest) GetResourceTypeID() string { + if c == nil { + return "" + } + return c.ResourceTypeID +} + +// #region class-body-c1apiappv1appmanagedstateservicepromoterequest +// #endregion class-body-c1apiappv1appmanagedstateservicepromoterequest + +type C1APIAppV1AppManagedStateServicePromoteResponse struct { + // HTTP response content type for this operation + ContentType string + // GetAppManagedStateBindingResponse contains the managed state of a discovered application. + GetAppManagedStateBindingResponse *shared.GetAppManagedStateBindingResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIAppV1AppManagedStateServicePromoteResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIAppV1AppManagedStateServicePromoteResponse) GetGetAppManagedStateBindingResponse() *shared.GetAppManagedStateBindingResponse { + if c == nil { + return nil + } + return c.GetAppManagedStateBindingResponse +} + +func (c *C1APIAppV1AppManagedStateServicePromoteResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIAppV1AppManagedStateServicePromoteResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiappv1appmanagedstateservicepromoteresponse +// #endregion class-body-c1apiappv1appmanagedstateservicepromoteresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appscreate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appscreate.go index 7938303e..f79d8654 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appscreate.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1appscreate.go @@ -10,7 +10,7 @@ import ( type C1APIAppV1AppsCreateResponse struct { // HTTP response content type for this operation ContentType string - // Returns the new app's values. + // CreateAppResponse contains the newly created application. CreateAppResponse *shared.CreateAppResponse // HTTP response status code for this operation StatusCode int diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1connectorserviceforcesync.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1connectorserviceforcesync.go index a1e60cc2..0e569754 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1connectorserviceforcesync.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiappv1connectorserviceforcesync.go @@ -40,7 +40,8 @@ func (c *C1APIAppV1ConnectorServiceForceSyncRequest) GetConnectorID() string { type C1APIAppV1ConnectorServiceForceSyncResponse struct { // HTTP response content type for this operation ContentType string - // Empty response body. Status code indicates success. + // Empty response body. Status code indicates success. Poll the connector sync status + // for progress after ForceSync accepts the request. ForceSyncResponse *shared.ForceSyncResponse // HTTP response status code for this operation StatusCode int diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiconversationsv1uiconversationsserviceensureonboardingsession.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiconversationsv1uiconversationsserviceensureonboardingsession.go new file mode 100644 index 00000000..49e1ec05 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiconversationsv1uiconversationsserviceensureonboardingsession.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIConversationsV1UIConversationsServiceEnsureOnboardingSessionResponse struct { + // HTTP response content type for this operation + ContentType string + // Returns the active onboarding conversation and whether this call created it. + EnsureOnboardingSessionResponse *shared.EnsureOnboardingSessionResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIConversationsV1UIConversationsServiceEnsureOnboardingSessionResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIConversationsV1UIConversationsServiceEnsureOnboardingSessionResponse) GetEnsureOnboardingSessionResponse() *shared.EnsureOnboardingSessionResponse { + if c == nil { + return nil + } + return c.EnsureOnboardingSessionResponse +} + +func (c *C1APIConversationsV1UIConversationsServiceEnsureOnboardingSessionResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIConversationsV1UIConversationsServiceEnsureOnboardingSessionResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiconversationsv1uiconversationsserviceensureonboardingsessionresponse +// #endregion class-body-c1apiconversationsv1uiconversationsserviceensureonboardingsessionresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifeedbackv1feedbackservicecreatefeedback.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifeedbackv1feedbackservicecreatefeedback.go new file mode 100644 index 00000000..96f34930 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifeedbackv1feedbackservicecreatefeedback.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFeedbackV1FeedbackServiceCreateFeedbackResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + CreateFeedbackResponse *shared.CreateFeedbackResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFeedbackV1FeedbackServiceCreateFeedbackResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFeedbackV1FeedbackServiceCreateFeedbackResponse) GetCreateFeedbackResponse() *shared.CreateFeedbackResponse { + if c == nil { + return nil + } + return c.CreateFeedbackResponse +} + +func (c *C1APIFeedbackV1FeedbackServiceCreateFeedbackResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFeedbackV1FeedbackServiceCreateFeedbackResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifeedbackv1feedbackservicecreatefeedbackresponse +// #endregion class-body-c1apifeedbackv1feedbackservicecreatefeedbackresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingserviceupdatefindingassignee.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingserviceupdatefindingassignee.go new file mode 100644 index 00000000..785ce80b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingserviceupdatefindingassignee.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFindingV1FindingServiceUpdateFindingAssigneeRequest struct { + UpdateFindingAssigneeRequest *shared.UpdateFindingAssigneeRequest `request:"mediaType=application/json"` + FindingID string `pathParam:"style=simple,explode=false,name=finding_id"` +} + +func (c *C1APIFindingV1FindingServiceUpdateFindingAssigneeRequest) GetUpdateFindingAssigneeRequest() *shared.UpdateFindingAssigneeRequest { + if c == nil { + return nil + } + return c.UpdateFindingAssigneeRequest +} + +func (c *C1APIFindingV1FindingServiceUpdateFindingAssigneeRequest) GetFindingID() string { + if c == nil { + return "" + } + return c.FindingID +} + +// #region class-body-c1apifindingv1findingserviceupdatefindingassigneerequest +// #endregion class-body-c1apifindingv1findingserviceupdatefindingassigneerequest + +type C1APIFindingV1FindingServiceUpdateFindingAssigneeResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + UpdateFindingAssigneeResponse *shared.UpdateFindingAssigneeResponse +} + +func (c *C1APIFindingV1FindingServiceUpdateFindingAssigneeResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFindingV1FindingServiceUpdateFindingAssigneeResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFindingV1FindingServiceUpdateFindingAssigneeResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APIFindingV1FindingServiceUpdateFindingAssigneeResponse) GetUpdateFindingAssigneeResponse() *shared.UpdateFindingAssigneeResponse { + if c == nil { + return nil + } + return c.UpdateFindingAssigneeResponse +} + +// #region class-body-c1apifindingv1findingserviceupdatefindingassigneeresponse +// #endregion class-body-c1apifindingv1findingserviceupdatefindingassigneeresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingsettingsservicelistfindingsettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingsettingsservicelistfindingsettings.go new file mode 100644 index 00000000..fb574cf7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingsettingsservicelistfindingsettings.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFindingV1FindingSettingsServiceListFindingSettingsResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ListFindingSettingsResponse *shared.ListFindingSettingsResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFindingV1FindingSettingsServiceListFindingSettingsResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFindingV1FindingSettingsServiceListFindingSettingsResponse) GetListFindingSettingsResponse() *shared.ListFindingSettingsResponse { + if c == nil { + return nil + } + return c.ListFindingSettingsResponse +} + +func (c *C1APIFindingV1FindingSettingsServiceListFindingSettingsResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFindingV1FindingSettingsServiceListFindingSettingsResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifindingv1findingsettingsservicelistfindingsettingsresponse +// #endregion class-body-c1apifindingv1findingsettingsservicelistfindingsettingsresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingsettingsserviceupdatefindingsettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingsettingsserviceupdatefindingsettings.go new file mode 100644 index 00000000..9775aa49 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifindingv1findingsettingsserviceupdatefindingsettings.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFindingV1FindingSettingsServiceUpdateFindingSettingsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + UpdateFindingSettingsResponse *shared.UpdateFindingSettingsResponse +} + +func (c *C1APIFindingV1FindingSettingsServiceUpdateFindingSettingsResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFindingV1FindingSettingsServiceUpdateFindingSettingsResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFindingV1FindingSettingsServiceUpdateFindingSettingsResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APIFindingV1FindingSettingsServiceUpdateFindingSettingsResponse) GetUpdateFindingSettingsResponse() *shared.UpdateFindingSettingsResponse { + if c == nil { + return nil + } + return c.UpdateFindingSettingsResponse +} + +// #region class-body-c1apifindingv1findingsettingsserviceupdatefindingsettingsresponse +// #endregion class-body-c1apifindingv1findingsettingsserviceupdatefindingsettingsresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifunctionsv1functionsinvocationservicegetresultdownloadurl.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifunctionsv1functionsinvocationservicegetresultdownloadurl.go new file mode 100644 index 00000000..a7ec5f01 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifunctionsv1functionsinvocationservicegetresultdownloadurl.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLRequest struct { + FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLRequest) GetFunctionID() string { + if c == nil { + return "" + } + return c.FunctionID +} + +func (c *C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apifunctionsv1functionsinvocationservicegetresultdownloadurlrequest +// #endregion class-body-c1apifunctionsv1functionsinvocationservicegetresultdownloadurlrequest + +type C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FunctionsInvocationServiceGetResultDownloadURLResponse *shared.FunctionsInvocationServiceGetResultDownloadURLResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLResponse) GetFunctionsInvocationServiceGetResultDownloadURLResponse() *shared.FunctionsInvocationServiceGetResultDownloadURLResponse { + if c == nil { + return nil + } + return c.FunctionsInvocationServiceGetResultDownloadURLResponse +} + +func (c *C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFunctionsV1FunctionsInvocationServiceGetResultDownloadURLResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifunctionsv1functionsinvocationservicegetresultdownloadurlresponse +// #endregion class-body-c1apifunctionsv1functionsinvocationservicegetresultdownloadurlresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicedelete.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicedelete.go new file mode 100644 index 00000000..2fde51ca --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicedelete.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1AppCapServiceDeleteRequest struct { + AppCapServiceDeleteRequest *shared.AppCapServiceDeleteRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APIFundsV1AppCapServiceDeleteRequest) GetAppCapServiceDeleteRequest() *shared.AppCapServiceDeleteRequest { + if c == nil { + return nil + } + return c.AppCapServiceDeleteRequest +} + +func (c *C1APIFundsV1AppCapServiceDeleteRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apifundsv1appcapservicedeleterequest +// #endregion class-body-c1apifundsv1appcapservicedeleterequest + +type C1APIFundsV1AppCapServiceDeleteResponse struct { + // Successful response + AppCapServiceDeleteResponse *shared.AppCapServiceDeleteResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1AppCapServiceDeleteResponse) GetAppCapServiceDeleteResponse() *shared.AppCapServiceDeleteResponse { + if c == nil { + return nil + } + return c.AppCapServiceDeleteResponse +} + +func (c *C1APIFundsV1AppCapServiceDeleteResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1AppCapServiceDeleteResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1AppCapServiceDeleteResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1appcapservicedeleteresponse +// #endregion class-body-c1apifundsv1appcapservicedeleteresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapserviceget.go new file mode 100644 index 00000000..1e0b0e24 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapserviceget.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1AppCapServiceGetRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APIFundsV1AppCapServiceGetRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apifundsv1appcapservicegetrequest +// #endregion class-body-c1apifundsv1appcapservicegetrequest + +type C1APIFundsV1AppCapServiceGetResponse struct { + // Successful response + AppCapServiceGetResponse *shared.AppCapServiceGetResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1AppCapServiceGetResponse) GetAppCapServiceGetResponse() *shared.AppCapServiceGetResponse { + if c == nil { + return nil + } + return c.AppCapServiceGetResponse +} + +func (c *C1APIFundsV1AppCapServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1AppCapServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1AppCapServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1appcapservicegetresponse +// #endregion class-body-c1apifundsv1appcapservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicelist.go new file mode 100644 index 00000000..61eb15a8 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicelist.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1AppCapServiceListRequest struct { + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIFundsV1AppCapServiceListRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIFundsV1AppCapServiceListRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apifundsv1appcapservicelistrequest +// #endregion class-body-c1apifundsv1appcapservicelistrequest + +type C1APIFundsV1AppCapServiceListResponse struct { + // Successful response + AppCapServiceListResponse *shared.AppCapServiceListResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1AppCapServiceListResponse) GetAppCapServiceListResponse() *shared.AppCapServiceListResponse { + if c == nil { + return nil + } + return c.AppCapServiceListResponse +} + +func (c *C1APIFundsV1AppCapServiceListResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1AppCapServiceListResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1AppCapServiceListResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1appcapservicelistresponse +// #endregion class-body-c1apifundsv1appcapservicelistresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicelisthistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicelisthistory.go new file mode 100644 index 00000000..7aa4064a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicelisthistory.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1AppCapServiceListHistoryRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIFundsV1AppCapServiceListHistoryRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIFundsV1AppCapServiceListHistoryRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIFundsV1AppCapServiceListHistoryRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apifundsv1appcapservicelisthistoryrequest +// #endregion class-body-c1apifundsv1appcapservicelisthistoryrequest + +type C1APIFundsV1AppCapServiceListHistoryResponse struct { + // Successful response + AppCapServiceListHistoryResponse *shared.AppCapServiceListHistoryResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1AppCapServiceListHistoryResponse) GetAppCapServiceListHistoryResponse() *shared.AppCapServiceListHistoryResponse { + if c == nil { + return nil + } + return c.AppCapServiceListHistoryResponse +} + +func (c *C1APIFundsV1AppCapServiceListHistoryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1AppCapServiceListHistoryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1AppCapServiceListHistoryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1appcapservicelisthistoryresponse +// #endregion class-body-c1apifundsv1appcapservicelisthistoryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicesetlimit.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicesetlimit.go new file mode 100644 index 00000000..4e5f4630 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicesetlimit.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1AppCapServiceSetLimitRequest struct { + AppCapServiceSetLimitRequest *shared.AppCapServiceSetLimitRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APIFundsV1AppCapServiceSetLimitRequest) GetAppCapServiceSetLimitRequest() *shared.AppCapServiceSetLimitRequest { + if c == nil { + return nil + } + return c.AppCapServiceSetLimitRequest +} + +func (c *C1APIFundsV1AppCapServiceSetLimitRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apifundsv1appcapservicesetlimitrequest +// #endregion class-body-c1apifundsv1appcapservicesetlimitrequest + +type C1APIFundsV1AppCapServiceSetLimitResponse struct { + // Successful response + AppCapServiceSetLimitResponse *shared.AppCapServiceSetLimitResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1AppCapServiceSetLimitResponse) GetAppCapServiceSetLimitResponse() *shared.AppCapServiceSetLimitResponse { + if c == nil { + return nil + } + return c.AppCapServiceSetLimitResponse +} + +func (c *C1APIFundsV1AppCapServiceSetLimitResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1AppCapServiceSetLimitResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1AppCapServiceSetLimitResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1appcapservicesetlimitresponse +// #endregion class-body-c1apifundsv1appcapservicesetlimitresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicesuspend.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicesuspend.go new file mode 100644 index 00000000..46a04a4e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapservicesuspend.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1AppCapServiceSuspendRequest struct { + AppCapServiceSuspendRequest *shared.AppCapServiceSuspendRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APIFundsV1AppCapServiceSuspendRequest) GetAppCapServiceSuspendRequest() *shared.AppCapServiceSuspendRequest { + if c == nil { + return nil + } + return c.AppCapServiceSuspendRequest +} + +func (c *C1APIFundsV1AppCapServiceSuspendRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apifundsv1appcapservicesuspendrequest +// #endregion class-body-c1apifundsv1appcapservicesuspendrequest + +type C1APIFundsV1AppCapServiceSuspendResponse struct { + // Successful response + AppCapServiceSuspendResponse *shared.AppCapServiceSuspendResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1AppCapServiceSuspendResponse) GetAppCapServiceSuspendResponse() *shared.AppCapServiceSuspendResponse { + if c == nil { + return nil + } + return c.AppCapServiceSuspendResponse +} + +func (c *C1APIFundsV1AppCapServiceSuspendResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1AppCapServiceSuspendResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1AppCapServiceSuspendResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1appcapservicesuspendresponse +// #endregion class-body-c1apifundsv1appcapservicesuspendresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapserviceunsuspend.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapserviceunsuspend.go new file mode 100644 index 00000000..a56c83d0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1appcapserviceunsuspend.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1AppCapServiceUnsuspendRequest struct { + AppCapServiceUnsuspendRequest *shared.AppCapServiceUnsuspendRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APIFundsV1AppCapServiceUnsuspendRequest) GetAppCapServiceUnsuspendRequest() *shared.AppCapServiceUnsuspendRequest { + if c == nil { + return nil + } + return c.AppCapServiceUnsuspendRequest +} + +func (c *C1APIFundsV1AppCapServiceUnsuspendRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apifundsv1appcapserviceunsuspendrequest +// #endregion class-body-c1apifundsv1appcapserviceunsuspendrequest + +type C1APIFundsV1AppCapServiceUnsuspendResponse struct { + // Successful response + AppCapServiceUnsuspendResponse *shared.AppCapServiceUnsuspendResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1AppCapServiceUnsuspendResponse) GetAppCapServiceUnsuspendResponse() *shared.AppCapServiceUnsuspendResponse { + if c == nil { + return nil + } + return c.AppCapServiceUnsuspendResponse +} + +func (c *C1APIFundsV1AppCapServiceUnsuspendResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1AppCapServiceUnsuspendResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1AppCapServiceUnsuspendResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1appcapserviceunsuspendresponse +// #endregion class-body-c1apifundsv1appcapserviceunsuspendresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceclearextension.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceclearextension.go new file mode 100644 index 00000000..d84ed8f7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceclearextension.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundAssignmentServiceClearExtensionRequest struct { + FundAssignmentServiceClearExtensionRequest *shared.FundAssignmentServiceClearExtensionRequest `request:"mediaType=application/json"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1FundAssignmentServiceClearExtensionRequest) GetFundAssignmentServiceClearExtensionRequest() *shared.FundAssignmentServiceClearExtensionRequest { + if c == nil { + return nil + } + return c.FundAssignmentServiceClearExtensionRequest +} + +func (c *C1APIFundsV1FundAssignmentServiceClearExtensionRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1fundassignmentserviceclearextensionrequest +// #endregion class-body-c1apifundsv1fundassignmentserviceclearextensionrequest + +type C1APIFundsV1FundAssignmentServiceClearExtensionResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundAssignmentServiceClearExtensionResponse *shared.FundAssignmentServiceClearExtensionResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundAssignmentServiceClearExtensionResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundAssignmentServiceClearExtensionResponse) GetFundAssignmentServiceClearExtensionResponse() *shared.FundAssignmentServiceClearExtensionResponse { + if c == nil { + return nil + } + return c.FundAssignmentServiceClearExtensionResponse +} + +func (c *C1APIFundsV1FundAssignmentServiceClearExtensionResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundAssignmentServiceClearExtensionResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundassignmentserviceclearextensionresponse +// #endregion class-body-c1apifundsv1fundassignmentserviceclearextensionresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicedelete.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicedelete.go new file mode 100644 index 00000000..9cfca098 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicedelete.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundAssignmentServiceDeleteRequest struct { + FundAssignmentServiceDeleteRequest *shared.FundAssignmentServiceDeleteRequest `request:"mediaType=application/json"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1FundAssignmentServiceDeleteRequest) GetFundAssignmentServiceDeleteRequest() *shared.FundAssignmentServiceDeleteRequest { + if c == nil { + return nil + } + return c.FundAssignmentServiceDeleteRequest +} + +func (c *C1APIFundsV1FundAssignmentServiceDeleteRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1fundassignmentservicedeleterequest +// #endregion class-body-c1apifundsv1fundassignmentservicedeleterequest + +type C1APIFundsV1FundAssignmentServiceDeleteResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundAssignmentServiceDeleteResponse *shared.FundAssignmentServiceDeleteResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundAssignmentServiceDeleteResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundAssignmentServiceDeleteResponse) GetFundAssignmentServiceDeleteResponse() *shared.FundAssignmentServiceDeleteResponse { + if c == nil { + return nil + } + return c.FundAssignmentServiceDeleteResponse +} + +func (c *C1APIFundsV1FundAssignmentServiceDeleteResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundAssignmentServiceDeleteResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundassignmentservicedeleteresponse +// #endregion class-body-c1apifundsv1fundassignmentservicedeleteresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceget.go new file mode 100644 index 00000000..c4ae3a83 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceget.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundAssignmentServiceGetRequest struct { + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1FundAssignmentServiceGetRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1fundassignmentservicegetrequest +// #endregion class-body-c1apifundsv1fundassignmentservicegetrequest + +type C1APIFundsV1FundAssignmentServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundAssignmentServiceGetResponse *shared.FundAssignmentServiceGetResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundAssignmentServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundAssignmentServiceGetResponse) GetFundAssignmentServiceGetResponse() *shared.FundAssignmentServiceGetResponse { + if c == nil { + return nil + } + return c.FundAssignmentServiceGetResponse +} + +func (c *C1APIFundsV1FundAssignmentServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundAssignmentServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundassignmentservicegetresponse +// #endregion class-body-c1apifundsv1fundassignmentservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicegrantextension.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicegrantextension.go new file mode 100644 index 00000000..14b1419b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicegrantextension.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundAssignmentServiceGrantExtensionRequest struct { + FundAssignmentServiceGrantExtensionRequest *shared.FundAssignmentServiceGrantExtensionRequest `request:"mediaType=application/json"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1FundAssignmentServiceGrantExtensionRequest) GetFundAssignmentServiceGrantExtensionRequest() *shared.FundAssignmentServiceGrantExtensionRequest { + if c == nil { + return nil + } + return c.FundAssignmentServiceGrantExtensionRequest +} + +func (c *C1APIFundsV1FundAssignmentServiceGrantExtensionRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1fundassignmentservicegrantextensionrequest +// #endregion class-body-c1apifundsv1fundassignmentservicegrantextensionrequest + +type C1APIFundsV1FundAssignmentServiceGrantExtensionResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundAssignmentServiceGrantExtensionResponse *shared.FundAssignmentServiceGrantExtensionResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundAssignmentServiceGrantExtensionResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundAssignmentServiceGrantExtensionResponse) GetFundAssignmentServiceGrantExtensionResponse() *shared.FundAssignmentServiceGrantExtensionResponse { + if c == nil { + return nil + } + return c.FundAssignmentServiceGrantExtensionResponse +} + +func (c *C1APIFundsV1FundAssignmentServiceGrantExtensionResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundAssignmentServiceGrantExtensionResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundassignmentservicegrantextensionresponse +// #endregion class-body-c1apifundsv1fundassignmentservicegrantextensionresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicelisthistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicelisthistory.go new file mode 100644 index 00000000..806b0ca9 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicelisthistory.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundAssignmentServiceListHistoryRequest struct { + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1FundAssignmentServiceListHistoryRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIFundsV1FundAssignmentServiceListHistoryRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +func (c *C1APIFundsV1FundAssignmentServiceListHistoryRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1fundassignmentservicelisthistoryrequest +// #endregion class-body-c1apifundsv1fundassignmentservicelisthistoryrequest + +type C1APIFundsV1FundAssignmentServiceListHistoryResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundAssignmentServiceListHistoryResponse *shared.FundAssignmentServiceListHistoryResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundAssignmentServiceListHistoryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundAssignmentServiceListHistoryResponse) GetFundAssignmentServiceListHistoryResponse() *shared.FundAssignmentServiceListHistoryResponse { + if c == nil { + return nil + } + return c.FundAssignmentServiceListHistoryResponse +} + +func (c *C1APIFundsV1FundAssignmentServiceListHistoryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundAssignmentServiceListHistoryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundassignmentservicelisthistoryresponse +// #endregion class-body-c1apifundsv1fundassignmentservicelisthistoryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesearch.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesearch.go new file mode 100644 index 00000000..fdf8def8 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesearch.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundAssignmentServiceSearchResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundAssignmentServiceSearchResponse *shared.FundAssignmentServiceSearchResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundAssignmentServiceSearchResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundAssignmentServiceSearchResponse) GetFundAssignmentServiceSearchResponse() *shared.FundAssignmentServiceSearchResponse { + if c == nil { + return nil + } + return c.FundAssignmentServiceSearchResponse +} + +func (c *C1APIFundsV1FundAssignmentServiceSearchResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundAssignmentServiceSearchResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundassignmentservicesearchresponse +// #endregion class-body-c1apifundsv1fundassignmentservicesearchresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesetlimit.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesetlimit.go new file mode 100644 index 00000000..8182b9f8 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesetlimit.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundAssignmentServiceSetLimitRequest struct { + FundAssignmentServiceSetLimitRequest *shared.FundAssignmentServiceSetLimitRequest `request:"mediaType=application/json"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1FundAssignmentServiceSetLimitRequest) GetFundAssignmentServiceSetLimitRequest() *shared.FundAssignmentServiceSetLimitRequest { + if c == nil { + return nil + } + return c.FundAssignmentServiceSetLimitRequest +} + +func (c *C1APIFundsV1FundAssignmentServiceSetLimitRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1fundassignmentservicesetlimitrequest +// #endregion class-body-c1apifundsv1fundassignmentservicesetlimitrequest + +type C1APIFundsV1FundAssignmentServiceSetLimitResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundAssignmentServiceSetLimitResponse *shared.FundAssignmentServiceSetLimitResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundAssignmentServiceSetLimitResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundAssignmentServiceSetLimitResponse) GetFundAssignmentServiceSetLimitResponse() *shared.FundAssignmentServiceSetLimitResponse { + if c == nil { + return nil + } + return c.FundAssignmentServiceSetLimitResponse +} + +func (c *C1APIFundsV1FundAssignmentServiceSetLimitResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundAssignmentServiceSetLimitResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundassignmentservicesetlimitresponse +// #endregion class-body-c1apifundsv1fundassignmentservicesetlimitresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesuspend.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesuspend.go new file mode 100644 index 00000000..9ca3c1f6 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentservicesuspend.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundAssignmentServiceSuspendRequest struct { + FundAssignmentServiceSuspendRequest *shared.FundAssignmentServiceSuspendRequest `request:"mediaType=application/json"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1FundAssignmentServiceSuspendRequest) GetFundAssignmentServiceSuspendRequest() *shared.FundAssignmentServiceSuspendRequest { + if c == nil { + return nil + } + return c.FundAssignmentServiceSuspendRequest +} + +func (c *C1APIFundsV1FundAssignmentServiceSuspendRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1fundassignmentservicesuspendrequest +// #endregion class-body-c1apifundsv1fundassignmentservicesuspendrequest + +type C1APIFundsV1FundAssignmentServiceSuspendResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundAssignmentServiceSuspendResponse *shared.FundAssignmentServiceSuspendResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundAssignmentServiceSuspendResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundAssignmentServiceSuspendResponse) GetFundAssignmentServiceSuspendResponse() *shared.FundAssignmentServiceSuspendResponse { + if c == nil { + return nil + } + return c.FundAssignmentServiceSuspendResponse +} + +func (c *C1APIFundsV1FundAssignmentServiceSuspendResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundAssignmentServiceSuspendResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundassignmentservicesuspendresponse +// #endregion class-body-c1apifundsv1fundassignmentservicesuspendresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceunsuspend.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceunsuspend.go new file mode 100644 index 00000000..5d617a71 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundassignmentserviceunsuspend.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundAssignmentServiceUnsuspendRequest struct { + FundAssignmentServiceUnsuspendRequest *shared.FundAssignmentServiceUnsuspendRequest `request:"mediaType=application/json"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1FundAssignmentServiceUnsuspendRequest) GetFundAssignmentServiceUnsuspendRequest() *shared.FundAssignmentServiceUnsuspendRequest { + if c == nil { + return nil + } + return c.FundAssignmentServiceUnsuspendRequest +} + +func (c *C1APIFundsV1FundAssignmentServiceUnsuspendRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1fundassignmentserviceunsuspendrequest +// #endregion class-body-c1apifundsv1fundassignmentserviceunsuspendrequest + +type C1APIFundsV1FundAssignmentServiceUnsuspendResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundAssignmentServiceUnsuspendResponse *shared.FundAssignmentServiceUnsuspendResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundAssignmentServiceUnsuspendResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundAssignmentServiceUnsuspendResponse) GetFundAssignmentServiceUnsuspendResponse() *shared.FundAssignmentServiceUnsuspendResponse { + if c == nil { + return nil + } + return c.FundAssignmentServiceUnsuspendResponse +} + +func (c *C1APIFundsV1FundAssignmentServiceUnsuspendResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundAssignmentServiceUnsuspendResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundassignmentserviceunsuspendresponse +// #endregion class-body-c1apifundsv1fundassignmentserviceunsuspendresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicecreate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicecreate.go new file mode 100644 index 00000000..f74b9118 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicecreate.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundPolicyServiceCreateResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundPolicyServiceCreateResponse *shared.FundPolicyServiceCreateResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundPolicyServiceCreateResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundPolicyServiceCreateResponse) GetFundPolicyServiceCreateResponse() *shared.FundPolicyServiceCreateResponse { + if c == nil { + return nil + } + return c.FundPolicyServiceCreateResponse +} + +func (c *C1APIFundsV1FundPolicyServiceCreateResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundPolicyServiceCreateResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundpolicyservicecreateresponse +// #endregion class-body-c1apifundsv1fundpolicyservicecreateresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicedelete.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicedelete.go new file mode 100644 index 00000000..1bf5397d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicedelete.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundPolicyServiceDeleteResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundPolicyServiceDeleteResponse *shared.FundPolicyServiceDeleteResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundPolicyServiceDeleteResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundPolicyServiceDeleteResponse) GetFundPolicyServiceDeleteResponse() *shared.FundPolicyServiceDeleteResponse { + if c == nil { + return nil + } + return c.FundPolicyServiceDeleteResponse +} + +func (c *C1APIFundsV1FundPolicyServiceDeleteResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundPolicyServiceDeleteResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundpolicyservicedeleteresponse +// #endregion class-body-c1apifundsv1fundpolicyservicedeleteresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicefreezetenant.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicefreezetenant.go new file mode 100644 index 00000000..e8c43050 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicefreezetenant.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundPolicyServiceFreezeTenantResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundPolicyServiceFreezeTenantResponse *shared.FundPolicyServiceFreezeTenantResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundPolicyServiceFreezeTenantResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundPolicyServiceFreezeTenantResponse) GetFundPolicyServiceFreezeTenantResponse() *shared.FundPolicyServiceFreezeTenantResponse { + if c == nil { + return nil + } + return c.FundPolicyServiceFreezeTenantResponse +} + +func (c *C1APIFundsV1FundPolicyServiceFreezeTenantResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundPolicyServiceFreezeTenantResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundpolicyservicefreezetenantresponse +// #endregion class-body-c1apifundsv1fundpolicyservicefreezetenantresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceget.go new file mode 100644 index 00000000..80332cb0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceget.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundPolicyServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundPolicyServiceGetResponse *shared.FundPolicyServiceGetResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundPolicyServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundPolicyServiceGetResponse) GetFundPolicyServiceGetResponse() *shared.FundPolicyServiceGetResponse { + if c == nil { + return nil + } + return c.FundPolicyServiceGetResponse +} + +func (c *C1APIFundsV1FundPolicyServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundPolicyServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundpolicyservicegetresponse +// #endregion class-body-c1apifundsv1fundpolicyservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicelisthistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicelisthistory.go new file mode 100644 index 00000000..e30e7afe --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicelisthistory.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundPolicyServiceListHistoryRequest struct { + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIFundsV1FundPolicyServiceListHistoryRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIFundsV1FundPolicyServiceListHistoryRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apifundsv1fundpolicyservicelisthistoryrequest +// #endregion class-body-c1apifundsv1fundpolicyservicelisthistoryrequest + +type C1APIFundsV1FundPolicyServiceListHistoryResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundPolicyServiceListHistoryResponse *shared.FundPolicyServiceListHistoryResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundPolicyServiceListHistoryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundPolicyServiceListHistoryResponse) GetFundPolicyServiceListHistoryResponse() *shared.FundPolicyServiceListHistoryResponse { + if c == nil { + return nil + } + return c.FundPolicyServiceListHistoryResponse +} + +func (c *C1APIFundsV1FundPolicyServiceListHistoryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundPolicyServiceListHistoryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundpolicyservicelisthistoryresponse +// #endregion class-body-c1apifundsv1fundpolicyservicelisthistoryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicesetorgceiling.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicesetorgceiling.go new file mode 100644 index 00000000..825c524a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyservicesetorgceiling.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundPolicyServiceSetOrgCeilingResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundPolicyServiceSetOrgCeilingResponse *shared.FundPolicyServiceSetOrgCeilingResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundPolicyServiceSetOrgCeilingResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundPolicyServiceSetOrgCeilingResponse) GetFundPolicyServiceSetOrgCeilingResponse() *shared.FundPolicyServiceSetOrgCeilingResponse { + if c == nil { + return nil + } + return c.FundPolicyServiceSetOrgCeilingResponse +} + +func (c *C1APIFundsV1FundPolicyServiceSetOrgCeilingResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundPolicyServiceSetOrgCeilingResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundpolicyservicesetorgceilingresponse +// #endregion class-body-c1apifundsv1fundpolicyservicesetorgceilingresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceunfreezetenant.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceunfreezetenant.go new file mode 100644 index 00000000..43faf6f7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceunfreezetenant.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundPolicyServiceUnfreezeTenantResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundPolicyServiceUnfreezeTenantResponse *shared.FundPolicyServiceUnfreezeTenantResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundPolicyServiceUnfreezeTenantResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundPolicyServiceUnfreezeTenantResponse) GetFundPolicyServiceUnfreezeTenantResponse() *shared.FundPolicyServiceUnfreezeTenantResponse { + if c == nil { + return nil + } + return c.FundPolicyServiceUnfreezeTenantResponse +} + +func (c *C1APIFundsV1FundPolicyServiceUnfreezeTenantResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundPolicyServiceUnfreezeTenantResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundpolicyserviceunfreezetenantresponse +// #endregion class-body-c1apifundsv1fundpolicyserviceunfreezetenantresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceupdate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceupdate.go new file mode 100644 index 00000000..4373ab15 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundpolicyserviceupdate.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundPolicyServiceUpdateResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundPolicyServiceUpdateResponse *shared.FundPolicyServiceUpdateResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundPolicyServiceUpdateResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundPolicyServiceUpdateResponse) GetFundPolicyServiceUpdateResponse() *shared.FundPolicyServiceUpdateResponse { + if c == nil { + return nil + } + return c.FundPolicyServiceUpdateResponse +} + +func (c *C1APIFundsV1FundPolicyServiceUpdateResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundPolicyServiceUpdateResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundpolicyserviceupdateresponse +// #endregion class-body-c1apifundsv1fundpolicyserviceupdateresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicecreate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicecreate.go new file mode 100644 index 00000000..4d6429c0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicecreate.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundRuleServiceCreateResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundRuleServiceCreateResponse *shared.FundRuleServiceCreateResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundRuleServiceCreateResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundRuleServiceCreateResponse) GetFundRuleServiceCreateResponse() *shared.FundRuleServiceCreateResponse { + if c == nil { + return nil + } + return c.FundRuleServiceCreateResponse +} + +func (c *C1APIFundsV1FundRuleServiceCreateResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundRuleServiceCreateResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundruleservicecreateresponse +// #endregion class-body-c1apifundsv1fundruleservicecreateresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicedelete.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicedelete.go new file mode 100644 index 00000000..407f1bd8 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicedelete.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundRuleServiceDeleteRequest struct { + FundRuleServiceDeleteRequest *shared.FundRuleServiceDeleteRequest `request:"mediaType=application/json"` + RuleID string `pathParam:"style=simple,explode=false,name=rule_id"` +} + +func (c *C1APIFundsV1FundRuleServiceDeleteRequest) GetFundRuleServiceDeleteRequest() *shared.FundRuleServiceDeleteRequest { + if c == nil { + return nil + } + return c.FundRuleServiceDeleteRequest +} + +func (c *C1APIFundsV1FundRuleServiceDeleteRequest) GetRuleID() string { + if c == nil { + return "" + } + return c.RuleID +} + +// #region class-body-c1apifundsv1fundruleservicedeleterequest +// #endregion class-body-c1apifundsv1fundruleservicedeleterequest + +type C1APIFundsV1FundRuleServiceDeleteResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundRuleServiceDeleteResponse *shared.FundRuleServiceDeleteResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundRuleServiceDeleteResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundRuleServiceDeleteResponse) GetFundRuleServiceDeleteResponse() *shared.FundRuleServiceDeleteResponse { + if c == nil { + return nil + } + return c.FundRuleServiceDeleteResponse +} + +func (c *C1APIFundsV1FundRuleServiceDeleteResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundRuleServiceDeleteResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundruleservicedeleteresponse +// #endregion class-body-c1apifundsv1fundruleservicedeleteresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleserviceget.go new file mode 100644 index 00000000..aa461677 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleserviceget.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundRuleServiceGetRequest struct { + RuleID string `pathParam:"style=simple,explode=false,name=rule_id"` +} + +func (c *C1APIFundsV1FundRuleServiceGetRequest) GetRuleID() string { + if c == nil { + return "" + } + return c.RuleID +} + +// #region class-body-c1apifundsv1fundruleservicegetrequest +// #endregion class-body-c1apifundsv1fundruleservicegetrequest + +type C1APIFundsV1FundRuleServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundRuleServiceGetResponse *shared.FundRuleServiceGetResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundRuleServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundRuleServiceGetResponse) GetFundRuleServiceGetResponse() *shared.FundRuleServiceGetResponse { + if c == nil { + return nil + } + return c.FundRuleServiceGetResponse +} + +func (c *C1APIFundsV1FundRuleServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundRuleServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundruleservicegetresponse +// #endregion class-body-c1apifundsv1fundruleservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicelist.go new file mode 100644 index 00000000..cd5b0bcd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicelist.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundRuleServiceListRequest struct { + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIFundsV1FundRuleServiceListRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIFundsV1FundRuleServiceListRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apifundsv1fundruleservicelistrequest +// #endregion class-body-c1apifundsv1fundruleservicelistrequest + +type C1APIFundsV1FundRuleServiceListResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundRuleServiceListResponse *shared.FundRuleServiceListResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundRuleServiceListResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundRuleServiceListResponse) GetFundRuleServiceListResponse() *shared.FundRuleServiceListResponse { + if c == nil { + return nil + } + return c.FundRuleServiceListResponse +} + +func (c *C1APIFundsV1FundRuleServiceListResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundRuleServiceListResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundruleservicelistresponse +// #endregion class-body-c1apifundsv1fundruleservicelistresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicelisthistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicelisthistory.go new file mode 100644 index 00000000..85d3d06b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicelisthistory.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundRuleServiceListHistoryRequest struct { + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` + RuleID string `pathParam:"style=simple,explode=false,name=rule_id"` +} + +func (c *C1APIFundsV1FundRuleServiceListHistoryRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIFundsV1FundRuleServiceListHistoryRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +func (c *C1APIFundsV1FundRuleServiceListHistoryRequest) GetRuleID() string { + if c == nil { + return "" + } + return c.RuleID +} + +// #region class-body-c1apifundsv1fundruleservicelisthistoryrequest +// #endregion class-body-c1apifundsv1fundruleservicelisthistoryrequest + +type C1APIFundsV1FundRuleServiceListHistoryResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundRuleServiceListHistoryResponse *shared.FundRuleServiceListHistoryResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundRuleServiceListHistoryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundRuleServiceListHistoryResponse) GetFundRuleServiceListHistoryResponse() *shared.FundRuleServiceListHistoryResponse { + if c == nil { + return nil + } + return c.FundRuleServiceListHistoryResponse +} + +func (c *C1APIFundsV1FundRuleServiceListHistoryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundRuleServiceListHistoryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundruleservicelisthistoryresponse +// #endregion class-body-c1apifundsv1fundruleservicelisthistoryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicesearch.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicesearch.go new file mode 100644 index 00000000..e06c7e33 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleservicesearch.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundRuleServiceSearchResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundRuleServiceSearchResponse *shared.FundRuleServiceSearchResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundRuleServiceSearchResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundRuleServiceSearchResponse) GetFundRuleServiceSearchResponse() *shared.FundRuleServiceSearchResponse { + if c == nil { + return nil + } + return c.FundRuleServiceSearchResponse +} + +func (c *C1APIFundsV1FundRuleServiceSearchResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundRuleServiceSearchResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundruleservicesearchresponse +// #endregion class-body-c1apifundsv1fundruleservicesearchresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleserviceupdate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleserviceupdate.go new file mode 100644 index 00000000..6c621552 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1fundruleserviceupdate.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1FundRuleServiceUpdateRequest struct { + FundRuleServiceUpdateRequest *shared.FundRuleServiceUpdateRequest `request:"mediaType=application/json"` + RuleID string `pathParam:"style=simple,explode=false,name=rule_id"` +} + +func (c *C1APIFundsV1FundRuleServiceUpdateRequest) GetFundRuleServiceUpdateRequest() *shared.FundRuleServiceUpdateRequest { + if c == nil { + return nil + } + return c.FundRuleServiceUpdateRequest +} + +func (c *C1APIFundsV1FundRuleServiceUpdateRequest) GetRuleID() string { + if c == nil { + return "" + } + return c.RuleID +} + +// #region class-body-c1apifundsv1fundruleserviceupdaterequest +// #endregion class-body-c1apifundsv1fundruleserviceupdaterequest + +type C1APIFundsV1FundRuleServiceUpdateResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + FundRuleServiceUpdateResponse *shared.FundRuleServiceUpdateResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1FundRuleServiceUpdateResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1FundRuleServiceUpdateResponse) GetFundRuleServiceUpdateResponse() *shared.FundRuleServiceUpdateResponse { + if c == nil { + return nil + } + return c.FundRuleServiceUpdateResponse +} + +func (c *C1APIFundsV1FundRuleServiceUpdateResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1FundRuleServiceUpdateResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1fundruleserviceupdateresponse +// #endregion class-body-c1apifundsv1fundruleserviceupdateresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicedelete.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicedelete.go new file mode 100644 index 00000000..0c414db4 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicedelete.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1MyFundLimitsServiceDeleteRequest struct { + MyFundLimitsServiceDeleteRequest *shared.MyFundLimitsServiceDeleteRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APIFundsV1MyFundLimitsServiceDeleteRequest) GetMyFundLimitsServiceDeleteRequest() *shared.MyFundLimitsServiceDeleteRequest { + if c == nil { + return nil + } + return c.MyFundLimitsServiceDeleteRequest +} + +func (c *C1APIFundsV1MyFundLimitsServiceDeleteRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apifundsv1myfundlimitsservicedeleterequest +// #endregion class-body-c1apifundsv1myfundlimitsservicedeleterequest + +type C1APIFundsV1MyFundLimitsServiceDeleteResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + MyFundLimitsServiceDeleteResponse *shared.MyFundLimitsServiceDeleteResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1MyFundLimitsServiceDeleteResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1MyFundLimitsServiceDeleteResponse) GetMyFundLimitsServiceDeleteResponse() *shared.MyFundLimitsServiceDeleteResponse { + if c == nil { + return nil + } + return c.MyFundLimitsServiceDeleteResponse +} + +func (c *C1APIFundsV1MyFundLimitsServiceDeleteResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1MyFundLimitsServiceDeleteResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1myfundlimitsservicedeleteresponse +// #endregion class-body-c1apifundsv1myfundlimitsservicedeleteresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicelist.go new file mode 100644 index 00000000..c60fc978 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicelist.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1MyFundLimitsServiceListRequest struct { + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIFundsV1MyFundLimitsServiceListRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIFundsV1MyFundLimitsServiceListRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apifundsv1myfundlimitsservicelistrequest +// #endregion class-body-c1apifundsv1myfundlimitsservicelistrequest + +type C1APIFundsV1MyFundLimitsServiceListResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + MyFundLimitsServiceListResponse *shared.MyFundLimitsServiceListResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1MyFundLimitsServiceListResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1MyFundLimitsServiceListResponse) GetMyFundLimitsServiceListResponse() *shared.MyFundLimitsServiceListResponse { + if c == nil { + return nil + } + return c.MyFundLimitsServiceListResponse +} + +func (c *C1APIFundsV1MyFundLimitsServiceListResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1MyFundLimitsServiceListResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1myfundlimitsservicelistresponse +// #endregion class-body-c1apifundsv1myfundlimitsservicelistresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicelisthistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicelisthistory.go new file mode 100644 index 00000000..a27c380d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicelisthistory.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1MyFundLimitsServiceListHistoryRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIFundsV1MyFundLimitsServiceListHistoryRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIFundsV1MyFundLimitsServiceListHistoryRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIFundsV1MyFundLimitsServiceListHistoryRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apifundsv1myfundlimitsservicelisthistoryrequest +// #endregion class-body-c1apifundsv1myfundlimitsservicelisthistoryrequest + +type C1APIFundsV1MyFundLimitsServiceListHistoryResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + MyFundLimitsServiceListHistoryResponse *shared.MyFundLimitsServiceListHistoryResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1MyFundLimitsServiceListHistoryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1MyFundLimitsServiceListHistoryResponse) GetMyFundLimitsServiceListHistoryResponse() *shared.MyFundLimitsServiceListHistoryResponse { + if c == nil { + return nil + } + return c.MyFundLimitsServiceListHistoryResponse +} + +func (c *C1APIFundsV1MyFundLimitsServiceListHistoryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1MyFundLimitsServiceListHistoryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1myfundlimitsservicelisthistoryresponse +// #endregion class-body-c1apifundsv1myfundlimitsservicelisthistoryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicepause.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicepause.go new file mode 100644 index 00000000..87f79d72 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicepause.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1MyFundLimitsServicePauseRequest struct { + MyFundLimitsServicePauseRequest *shared.MyFundLimitsServicePauseRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APIFundsV1MyFundLimitsServicePauseRequest) GetMyFundLimitsServicePauseRequest() *shared.MyFundLimitsServicePauseRequest { + if c == nil { + return nil + } + return c.MyFundLimitsServicePauseRequest +} + +func (c *C1APIFundsV1MyFundLimitsServicePauseRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apifundsv1myfundlimitsservicepauserequest +// #endregion class-body-c1apifundsv1myfundlimitsservicepauserequest + +type C1APIFundsV1MyFundLimitsServicePauseResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + MyFundLimitsServicePauseResponse *shared.MyFundLimitsServicePauseResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1MyFundLimitsServicePauseResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1MyFundLimitsServicePauseResponse) GetMyFundLimitsServicePauseResponse() *shared.MyFundLimitsServicePauseResponse { + if c == nil { + return nil + } + return c.MyFundLimitsServicePauseResponse +} + +func (c *C1APIFundsV1MyFundLimitsServicePauseResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1MyFundLimitsServicePauseResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1myfundlimitsservicepauseresponse +// #endregion class-body-c1apifundsv1myfundlimitsservicepauseresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsserviceresume.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsserviceresume.go new file mode 100644 index 00000000..980d507c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsserviceresume.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1MyFundLimitsServiceResumeRequest struct { + MyFundLimitsServiceResumeRequest *shared.MyFundLimitsServiceResumeRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APIFundsV1MyFundLimitsServiceResumeRequest) GetMyFundLimitsServiceResumeRequest() *shared.MyFundLimitsServiceResumeRequest { + if c == nil { + return nil + } + return c.MyFundLimitsServiceResumeRequest +} + +func (c *C1APIFundsV1MyFundLimitsServiceResumeRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apifundsv1myfundlimitsserviceresumerequest +// #endregion class-body-c1apifundsv1myfundlimitsserviceresumerequest + +type C1APIFundsV1MyFundLimitsServiceResumeResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + MyFundLimitsServiceResumeResponse *shared.MyFundLimitsServiceResumeResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1MyFundLimitsServiceResumeResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1MyFundLimitsServiceResumeResponse) GetMyFundLimitsServiceResumeResponse() *shared.MyFundLimitsServiceResumeResponse { + if c == nil { + return nil + } + return c.MyFundLimitsServiceResumeResponse +} + +func (c *C1APIFundsV1MyFundLimitsServiceResumeResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1MyFundLimitsServiceResumeResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1myfundlimitsserviceresumeresponse +// #endregion class-body-c1apifundsv1myfundlimitsserviceresumeresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicesetlimit.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicesetlimit.go new file mode 100644 index 00000000..fecfe6f7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1myfundlimitsservicesetlimit.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1MyFundLimitsServiceSetLimitRequest struct { + MyFundLimitsServiceSetLimitRequest *shared.MyFundLimitsServiceSetLimitRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APIFundsV1MyFundLimitsServiceSetLimitRequest) GetMyFundLimitsServiceSetLimitRequest() *shared.MyFundLimitsServiceSetLimitRequest { + if c == nil { + return nil + } + return c.MyFundLimitsServiceSetLimitRequest +} + +func (c *C1APIFundsV1MyFundLimitsServiceSetLimitRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apifundsv1myfundlimitsservicesetlimitrequest +// #endregion class-body-c1apifundsv1myfundlimitsservicesetlimitrequest + +type C1APIFundsV1MyFundLimitsServiceSetLimitResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + MyFundLimitsServiceSetLimitResponse *shared.MyFundLimitsServiceSetLimitResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIFundsV1MyFundLimitsServiceSetLimitResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1MyFundLimitsServiceSetLimitResponse) GetMyFundLimitsServiceSetLimitResponse() *shared.MyFundLimitsServiceSetLimitResponse { + if c == nil { + return nil + } + return c.MyFundLimitsServiceSetLimitResponse +} + +func (c *C1APIFundsV1MyFundLimitsServiceSetLimitResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1MyFundLimitsServiceSetLimitResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apifundsv1myfundlimitsservicesetlimitresponse +// #endregion class-body-c1apifundsv1myfundlimitsservicesetlimitresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicedelete.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicedelete.go new file mode 100644 index 00000000..72ffefe7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicedelete.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1SubjectAppLimitServiceDeleteRequest struct { + SubjectAppLimitServiceDeleteRequest *shared.SubjectAppLimitServiceDeleteRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1SubjectAppLimitServiceDeleteRequest) GetSubjectAppLimitServiceDeleteRequest() *shared.SubjectAppLimitServiceDeleteRequest { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceDeleteRequest +} + +func (c *C1APIFundsV1SubjectAppLimitServiceDeleteRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIFundsV1SubjectAppLimitServiceDeleteRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1subjectapplimitservicedeleterequest +// #endregion class-body-c1apifundsv1subjectapplimitservicedeleterequest + +type C1APIFundsV1SubjectAppLimitServiceDeleteResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + SubjectAppLimitServiceDeleteResponse *shared.SubjectAppLimitServiceDeleteResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceDeleteResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1SubjectAppLimitServiceDeleteResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1SubjectAppLimitServiceDeleteResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceDeleteResponse) GetSubjectAppLimitServiceDeleteResponse() *shared.SubjectAppLimitServiceDeleteResponse { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceDeleteResponse +} + +// #region class-body-c1apifundsv1subjectapplimitservicedeleteresponse +// #endregion class-body-c1apifundsv1subjectapplimitservicedeleteresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitserviceget.go new file mode 100644 index 00000000..ebe77c38 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitserviceget.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1SubjectAppLimitServiceGetRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1SubjectAppLimitServiceGetRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIFundsV1SubjectAppLimitServiceGetRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1subjectapplimitservicegetrequest +// #endregion class-body-c1apifundsv1subjectapplimitservicegetrequest + +type C1APIFundsV1SubjectAppLimitServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + SubjectAppLimitServiceGetResponse *shared.SubjectAppLimitServiceGetResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1SubjectAppLimitServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1SubjectAppLimitServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceGetResponse) GetSubjectAppLimitServiceGetResponse() *shared.SubjectAppLimitServiceGetResponse { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceGetResponse +} + +// #region class-body-c1apifundsv1subjectapplimitservicegetresponse +// #endregion class-body-c1apifundsv1subjectapplimitservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicelisthistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicelisthistory.go new file mode 100644 index 00000000..6a8e52de --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicelisthistory.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1SubjectAppLimitServiceListHistoryRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1SubjectAppLimitServiceListHistoryRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIFundsV1SubjectAppLimitServiceListHistoryRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIFundsV1SubjectAppLimitServiceListHistoryRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +func (c *C1APIFundsV1SubjectAppLimitServiceListHistoryRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1subjectapplimitservicelisthistoryrequest +// #endregion class-body-c1apifundsv1subjectapplimitservicelisthistoryrequest + +type C1APIFundsV1SubjectAppLimitServiceListHistoryResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + SubjectAppLimitServiceListHistoryResponse *shared.SubjectAppLimitServiceListHistoryResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceListHistoryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1SubjectAppLimitServiceListHistoryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1SubjectAppLimitServiceListHistoryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceListHistoryResponse) GetSubjectAppLimitServiceListHistoryResponse() *shared.SubjectAppLimitServiceListHistoryResponse { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceListHistoryResponse +} + +// #region class-body-c1apifundsv1subjectapplimitservicelisthistoryresponse +// #endregion class-body-c1apifundsv1subjectapplimitservicelisthistoryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesearch.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesearch.go new file mode 100644 index 00000000..ca6aa102 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesearch.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1SubjectAppLimitServiceSearchResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + SubjectAppLimitServiceSearchResponse *shared.SubjectAppLimitServiceSearchResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSearchResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSearchResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSearchResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSearchResponse) GetSubjectAppLimitServiceSearchResponse() *shared.SubjectAppLimitServiceSearchResponse { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceSearchResponse +} + +// #region class-body-c1apifundsv1subjectapplimitservicesearchresponse +// #endregion class-body-c1apifundsv1subjectapplimitservicesearchresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesetlimit.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesetlimit.go new file mode 100644 index 00000000..b9a316da --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesetlimit.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1SubjectAppLimitServiceSetLimitRequest struct { + SubjectAppLimitServiceSetLimitRequest *shared.SubjectAppLimitServiceSetLimitRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSetLimitRequest) GetSubjectAppLimitServiceSetLimitRequest() *shared.SubjectAppLimitServiceSetLimitRequest { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceSetLimitRequest +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSetLimitRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSetLimitRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1subjectapplimitservicesetlimitrequest +// #endregion class-body-c1apifundsv1subjectapplimitservicesetlimitrequest + +type C1APIFundsV1SubjectAppLimitServiceSetLimitResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + SubjectAppLimitServiceSetLimitResponse *shared.SubjectAppLimitServiceSetLimitResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSetLimitResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSetLimitResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSetLimitResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSetLimitResponse) GetSubjectAppLimitServiceSetLimitResponse() *shared.SubjectAppLimitServiceSetLimitResponse { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceSetLimitResponse +} + +// #region class-body-c1apifundsv1subjectapplimitservicesetlimitresponse +// #endregion class-body-c1apifundsv1subjectapplimitservicesetlimitresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesuspend.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesuspend.go new file mode 100644 index 00000000..421d5693 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitservicesuspend.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1SubjectAppLimitServiceSuspendRequest struct { + SubjectAppLimitServiceSuspendRequest *shared.SubjectAppLimitServiceSuspendRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSuspendRequest) GetSubjectAppLimitServiceSuspendRequest() *shared.SubjectAppLimitServiceSuspendRequest { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceSuspendRequest +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSuspendRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSuspendRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1subjectapplimitservicesuspendrequest +// #endregion class-body-c1apifundsv1subjectapplimitservicesuspendrequest + +type C1APIFundsV1SubjectAppLimitServiceSuspendResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + SubjectAppLimitServiceSuspendResponse *shared.SubjectAppLimitServiceSuspendResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSuspendResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSuspendResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSuspendResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceSuspendResponse) GetSubjectAppLimitServiceSuspendResponse() *shared.SubjectAppLimitServiceSuspendResponse { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceSuspendResponse +} + +// #region class-body-c1apifundsv1subjectapplimitservicesuspendresponse +// #endregion class-body-c1apifundsv1subjectapplimitservicesuspendresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitserviceunsuspend.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitserviceunsuspend.go new file mode 100644 index 00000000..3267405b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apifundsv1subjectapplimitserviceunsuspend.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIFundsV1SubjectAppLimitServiceUnsuspendRequest struct { + SubjectAppLimitServiceUnsuspendRequest *shared.SubjectAppLimitServiceUnsuspendRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APIFundsV1SubjectAppLimitServiceUnsuspendRequest) GetSubjectAppLimitServiceUnsuspendRequest() *shared.SubjectAppLimitServiceUnsuspendRequest { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceUnsuspendRequest +} + +func (c *C1APIFundsV1SubjectAppLimitServiceUnsuspendRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APIFundsV1SubjectAppLimitServiceUnsuspendRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apifundsv1subjectapplimitserviceunsuspendrequest +// #endregion class-body-c1apifundsv1subjectapplimitserviceunsuspendrequest + +type C1APIFundsV1SubjectAppLimitServiceUnsuspendResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + SubjectAppLimitServiceUnsuspendResponse *shared.SubjectAppLimitServiceUnsuspendResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceUnsuspendResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIFundsV1SubjectAppLimitServiceUnsuspendResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIFundsV1SubjectAppLimitServiceUnsuspendResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APIFundsV1SubjectAppLimitServiceUnsuspendResponse) GetSubjectAppLimitServiceUnsuspendResponse() *shared.SubjectAppLimitServiceUnsuspendResponse { + if c == nil { + return nil + } + return c.SubjectAppLimitServiceUnsuspendResponse +} + +// #region class-body-c1apifundsv1subjectapplimitserviceunsuspendresponse +// #endregion class-body-c1apifundsv1subjectapplimitserviceunsuspendresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicelist.go new file mode 100644 index 00000000..47edd258 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicelist.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APILlmGatewayV1GatewayKeyServiceListResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ListGatewayKeysResponse *shared.ListGatewayKeysResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceListResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceListResponse) GetListGatewayKeysResponse() *shared.ListGatewayKeysResponse { + if c == nil { + return nil + } + return c.ListGatewayKeysResponse +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceListResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceListResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apillmgatewayv1gatewaykeyservicelistresponse +// #endregion class-body-c1apillmgatewayv1gatewaykeyservicelistresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicemint.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicemint.go new file mode 100644 index 00000000..285e151b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicemint.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APILlmGatewayV1GatewayKeyServiceMintResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + MintGatewayKeyResponse *shared.MintGatewayKeyResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceMintResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceMintResponse) GetMintGatewayKeyResponse() *shared.MintGatewayKeyResponse { + if c == nil { + return nil + } + return c.MintGatewayKeyResponse +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceMintResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceMintResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apillmgatewayv1gatewaykeyservicemintresponse +// #endregion class-body-c1apillmgatewayv1gatewaykeyservicemintresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicerevoke.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicerevoke.go new file mode 100644 index 00000000..fa2e5076 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1gatewaykeyservicerevoke.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APILlmGatewayV1GatewayKeyServiceRevokeRequest struct { + RevokeGatewayKeyRequest *shared.RevokeGatewayKeyRequest `request:"mediaType=application/json"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceRevokeRequest) GetRevokeGatewayKeyRequest() *shared.RevokeGatewayKeyRequest { + if c == nil { + return nil + } + return c.RevokeGatewayKeyRequest +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceRevokeRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apillmgatewayv1gatewaykeyservicerevokerequest +// #endregion class-body-c1apillmgatewayv1gatewaykeyservicerevokerequest + +type C1APILlmGatewayV1GatewayKeyServiceRevokeResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + RevokeGatewayKeyResponse *shared.RevokeGatewayKeyResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceRevokeResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceRevokeResponse) GetRevokeGatewayKeyResponse() *shared.RevokeGatewayKeyResponse { + if c == nil { + return nil + } + return c.RevokeGatewayKeyResponse +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceRevokeResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APILlmGatewayV1GatewayKeyServiceRevokeResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apillmgatewayv1gatewaykeyservicerevokeresponse +// #endregion class-body-c1apillmgatewayv1gatewaykeyservicerevokeresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceclear.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceclear.go new file mode 100644 index 00000000..1db108f8 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceclear.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APILlmGatewayV1ProviderCredentialServiceClearRequest struct { + ClearProviderCredentialRequest *shared.ClearProviderCredentialRequest `request:"mediaType=application/json"` + SlotID string `pathParam:"style=simple,explode=false,name=slot_id"` +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceClearRequest) GetClearProviderCredentialRequest() *shared.ClearProviderCredentialRequest { + if c == nil { + return nil + } + return c.ClearProviderCredentialRequest +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceClearRequest) GetSlotID() string { + if c == nil { + return "" + } + return c.SlotID +} + +// #region class-body-c1apillmgatewayv1providercredentialserviceclearrequest +// #endregion class-body-c1apillmgatewayv1providercredentialserviceclearrequest + +type C1APILlmGatewayV1ProviderCredentialServiceClearResponse struct { + // Successful response + ClearProviderCredentialResponse *shared.ClearProviderCredentialResponse + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceClearResponse) GetClearProviderCredentialResponse() *shared.ClearProviderCredentialResponse { + if c == nil { + return nil + } + return c.ClearProviderCredentialResponse +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceClearResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceClearResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceClearResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apillmgatewayv1providercredentialserviceclearresponse +// #endregion class-body-c1apillmgatewayv1providercredentialserviceclearresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceget.go new file mode 100644 index 00000000..33d1e86c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceget.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APILlmGatewayV1ProviderCredentialServiceGetRequest struct { + SlotID string `pathParam:"style=simple,explode=false,name=slot_id"` +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceGetRequest) GetSlotID() string { + if c == nil { + return "" + } + return c.SlotID +} + +// #region class-body-c1apillmgatewayv1providercredentialservicegetrequest +// #endregion class-body-c1apillmgatewayv1providercredentialservicegetrequest + +type C1APILlmGatewayV1ProviderCredentialServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + GetProviderCredentialResponse *shared.GetProviderCredentialResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceGetResponse) GetGetProviderCredentialResponse() *shared.GetProviderCredentialResponse { + if c == nil { + return nil + } + return c.GetProviderCredentialResponse +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apillmgatewayv1providercredentialservicegetresponse +// #endregion class-body-c1apillmgatewayv1providercredentialservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceset.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceset.go new file mode 100644 index 00000000..940bb453 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apillmgatewayv1providercredentialserviceset.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APILlmGatewayV1ProviderCredentialServiceSetRequest struct { + SetProviderCredentialRequest *shared.SetProviderCredentialRequest `request:"mediaType=application/json"` + SlotID string `pathParam:"style=simple,explode=false,name=slot_id"` +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceSetRequest) GetSetProviderCredentialRequest() *shared.SetProviderCredentialRequest { + if c == nil { + return nil + } + return c.SetProviderCredentialRequest +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceSetRequest) GetSlotID() string { + if c == nil { + return "" + } + return c.SlotID +} + +// #region class-body-c1apillmgatewayv1providercredentialservicesetrequest +// #endregion class-body-c1apillmgatewayv1providercredentialservicesetrequest + +type C1APILlmGatewayV1ProviderCredentialServiceSetResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + SetProviderCredentialResponse *shared.SetProviderCredentialResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceSetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceSetResponse) GetSetProviderCredentialResponse() *shared.SetProviderCredentialResponse { + if c == nil { + return nil + } + return c.SetProviderCredentialResponse +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceSetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APILlmGatewayV1ProviderCredentialServiceSetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apillmgatewayv1providercredentialservicesetresponse +// #endregion class-body-c1apillmgatewayv1providercredentialservicesetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicedelete.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicedelete.go new file mode 100644 index 00000000..da447e15 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicedelete.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIReportingV1ReportingServiceDeleteRequest struct { + ReportingServiceDeleteRequest *shared.ReportingServiceDeleteRequest `request:"mediaType=application/json"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APIReportingV1ReportingServiceDeleteRequest) GetReportingServiceDeleteRequest() *shared.ReportingServiceDeleteRequest { + if c == nil { + return nil + } + return c.ReportingServiceDeleteRequest +} + +func (c *C1APIReportingV1ReportingServiceDeleteRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apireportingv1reportingservicedeleterequest +// #endregion class-body-c1apireportingv1reportingservicedeleterequest + +type C1APIReportingV1ReportingServiceDeleteResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ReportingServiceDeleteResponse *shared.ReportingServiceDeleteResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIReportingV1ReportingServiceDeleteResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIReportingV1ReportingServiceDeleteResponse) GetReportingServiceDeleteResponse() *shared.ReportingServiceDeleteResponse { + if c == nil { + return nil + } + return c.ReportingServiceDeleteResponse +} + +func (c *C1APIReportingV1ReportingServiceDeleteResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIReportingV1ReportingServiceDeleteResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apireportingv1reportingservicedeleteresponse +// #endregion class-body-c1apireportingv1reportingservicedeleteresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingserviceget.go new file mode 100644 index 00000000..665cbb2e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingserviceget.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIReportingV1ReportingServiceGetRequest struct { + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APIReportingV1ReportingServiceGetRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apireportingv1reportingservicegetrequest +// #endregion class-body-c1apireportingv1reportingservicegetrequest + +type C1APIReportingV1ReportingServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ReportingServiceGetResponse *shared.ReportingServiceGetResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIReportingV1ReportingServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIReportingV1ReportingServiceGetResponse) GetReportingServiceGetResponse() *shared.ReportingServiceGetResponse { + if c == nil { + return nil + } + return c.ReportingServiceGetResponse +} + +func (c *C1APIReportingV1ReportingServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIReportingV1ReportingServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apireportingv1reportingservicegetresponse +// #endregion class-body-c1apireportingv1reportingservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicegetprogram.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicegetprogram.go new file mode 100644 index 00000000..701ab9c9 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicegetprogram.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIReportingV1ReportingServiceGetProgramRequest struct { + ID string `pathParam:"style=simple,explode=false,name=id"` + ProgramID *string `queryParam:"style=form,explode=true,name=program_id"` +} + +func (c *C1APIReportingV1ReportingServiceGetProgramRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +func (c *C1APIReportingV1ReportingServiceGetProgramRequest) GetProgramID() *string { + if c == nil { + return nil + } + return c.ProgramID +} + +// #region class-body-c1apireportingv1reportingservicegetprogramrequest +// #endregion class-body-c1apireportingv1reportingservicegetprogramrequest + +type C1APIReportingV1ReportingServiceGetProgramResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ReportingServiceGetProgramResponse *shared.ReportingServiceGetProgramResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIReportingV1ReportingServiceGetProgramResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIReportingV1ReportingServiceGetProgramResponse) GetReportingServiceGetProgramResponse() *shared.ReportingServiceGetProgramResponse { + if c == nil { + return nil + } + return c.ReportingServiceGetProgramResponse +} + +func (c *C1APIReportingV1ReportingServiceGetProgramResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIReportingV1ReportingServiceGetProgramResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apireportingv1reportingservicegetprogramresponse +// #endregion class-body-c1apireportingv1reportingservicegetprogramresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicegetrunprovenance.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicegetrunprovenance.go new file mode 100644 index 00000000..b662ee01 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicegetrunprovenance.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIReportingV1ReportingServiceGetRunProvenanceRequest struct { + ID string `pathParam:"style=simple,explode=false,name=id"` + RunID string `pathParam:"style=simple,explode=false,name=run_id"` +} + +func (c *C1APIReportingV1ReportingServiceGetRunProvenanceRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +func (c *C1APIReportingV1ReportingServiceGetRunProvenanceRequest) GetRunID() string { + if c == nil { + return "" + } + return c.RunID +} + +// #region class-body-c1apireportingv1reportingservicegetrunprovenancerequest +// #endregion class-body-c1apireportingv1reportingservicegetrunprovenancerequest + +type C1APIReportingV1ReportingServiceGetRunProvenanceResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ReportingServiceGetRunProvenanceResponse *shared.ReportingServiceGetRunProvenanceResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIReportingV1ReportingServiceGetRunProvenanceResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIReportingV1ReportingServiceGetRunProvenanceResponse) GetReportingServiceGetRunProvenanceResponse() *shared.ReportingServiceGetRunProvenanceResponse { + if c == nil { + return nil + } + return c.ReportingServiceGetRunProvenanceResponse +} + +func (c *C1APIReportingV1ReportingServiceGetRunProvenanceResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIReportingV1ReportingServiceGetRunProvenanceResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apireportingv1reportingservicegetrunprovenanceresponse +// #endregion class-body-c1apireportingv1reportingservicegetrunprovenanceresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicelist.go new file mode 100644 index 00000000..659c4ff0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicelist.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIReportingV1ReportingServiceListRequest struct { + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APIReportingV1ReportingServiceListRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APIReportingV1ReportingServiceListRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apireportingv1reportingservicelistrequest +// #endregion class-body-c1apireportingv1reportingservicelistrequest + +type C1APIReportingV1ReportingServiceListResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ReportingServiceListResponse *shared.ReportingServiceListResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIReportingV1ReportingServiceListResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIReportingV1ReportingServiceListResponse) GetReportingServiceListResponse() *shared.ReportingServiceListResponse { + if c == nil { + return nil + } + return c.ReportingServiceListResponse +} + +func (c *C1APIReportingV1ReportingServiceListResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIReportingV1ReportingServiceListResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apireportingv1reportingservicelistresponse +// #endregion class-body-c1apireportingv1reportingservicelistresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicerun.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicerun.go new file mode 100644 index 00000000..f36dff36 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicerun.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIReportingV1ReportingServiceRunRequest struct { + ReportingServiceRunRequest *shared.ReportingServiceRunRequest `request:"mediaType=application/json"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APIReportingV1ReportingServiceRunRequest) GetReportingServiceRunRequest() *shared.ReportingServiceRunRequest { + if c == nil { + return nil + } + return c.ReportingServiceRunRequest +} + +func (c *C1APIReportingV1ReportingServiceRunRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apireportingv1reportingservicerunrequest +// #endregion class-body-c1apireportingv1reportingservicerunrequest + +type C1APIReportingV1ReportingServiceRunResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ReportingServiceRunResponse *shared.ReportingServiceRunResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIReportingV1ReportingServiceRunResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIReportingV1ReportingServiceRunResponse) GetReportingServiceRunResponse() *shared.ReportingServiceRunResponse { + if c == nil { + return nil + } + return c.ReportingServiceRunResponse +} + +func (c *C1APIReportingV1ReportingServiceRunResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIReportingV1ReportingServiceRunResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apireportingv1reportingservicerunresponse +// #endregion class-body-c1apireportingv1reportingservicerunresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicesave.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicesave.go new file mode 100644 index 00000000..a87ddd14 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingservicesave.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIReportingV1ReportingServiceSaveResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ReportingServiceSaveResponse *shared.ReportingServiceSaveResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIReportingV1ReportingServiceSaveResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIReportingV1ReportingServiceSaveResponse) GetReportingServiceSaveResponse() *shared.ReportingServiceSaveResponse { + if c == nil { + return nil + } + return c.ReportingServiceSaveResponse +} + +func (c *C1APIReportingV1ReportingServiceSaveResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIReportingV1ReportingServiceSaveResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apireportingv1reportingservicesaveresponse +// #endregion class-body-c1apireportingv1reportingservicesaveresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingserviceupdate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingserviceupdate.go new file mode 100644 index 00000000..b6a1b3fd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apireportingv1reportingserviceupdate.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIReportingV1ReportingServiceUpdateRequest struct { + ReportingServiceUpdateRequest *shared.ReportingServiceUpdateRequest `request:"mediaType=application/json"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APIReportingV1ReportingServiceUpdateRequest) GetReportingServiceUpdateRequest() *shared.ReportingServiceUpdateRequest { + if c == nil { + return nil + } + return c.ReportingServiceUpdateRequest +} + +func (c *C1APIReportingV1ReportingServiceUpdateRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apireportingv1reportingserviceupdaterequest +// #endregion class-body-c1apireportingv1reportingserviceupdaterequest + +type C1APIReportingV1ReportingServiceUpdateResponse struct { + // HTTP response content type for this operation + ContentType string + // Successful response + ReportingServiceUpdateResponse *shared.ReportingServiceUpdateResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIReportingV1ReportingServiceUpdateResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIReportingV1ReportingServiceUpdateResponse) GetReportingServiceUpdateResponse() *shared.ReportingServiceUpdateResponse { + if c == nil { + return nil + } + return c.ReportingServiceUpdateResponse +} + +func (c *C1APIReportingV1ReportingServiceUpdateResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIReportingV1ReportingServiceUpdateResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apireportingv1reportingserviceupdateresponse +// #endregion class-body-c1apireportingv1reportingserviceupdateresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apirequestcatalogv1requestcatalogmanagementserviceplantypechange.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apirequestcatalogv1requestcatalogmanagementserviceplantypechange.go new file mode 100644 index 00000000..704aa2af --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apirequestcatalogv1requestcatalogmanagementserviceplantypechange.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeRequest struct { + RequestCatalogManagementServicePlanTypeChangeRequest *shared.RequestCatalogManagementServicePlanTypeChangeRequest `request:"mediaType=application/json"` + RequestCatalogID string `pathParam:"style=simple,explode=false,name=request_catalog_id"` +} + +func (c *C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeRequest) GetRequestCatalogManagementServicePlanTypeChangeRequest() *shared.RequestCatalogManagementServicePlanTypeChangeRequest { + if c == nil { + return nil + } + return c.RequestCatalogManagementServicePlanTypeChangeRequest +} + +func (c *C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeRequest) GetRequestCatalogID() string { + if c == nil { + return "" + } + return c.RequestCatalogID +} + +// #region class-body-c1apirequestcatalogv1requestcatalogmanagementserviceplantypechangerequest +// #endregion class-body-c1apirequestcatalogv1requestcatalogmanagementserviceplantypechangerequest + +type C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeResponse struct { + // HTTP response content type for this operation + ContentType string + // Describes behavior affected by an access profile type change. + RequestCatalogManagementServicePlanTypeChangeResponse *shared.RequestCatalogManagementServicePlanTypeChangeResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeResponse) GetRequestCatalogManagementServicePlanTypeChangeResponse() *shared.RequestCatalogManagementServicePlanTypeChangeResponse { + if c == nil { + return nil + } + return c.RequestCatalogManagementServicePlanTypeChangeResponse +} + +func (c *C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apirequestcatalogv1requestcatalogmanagementserviceplantypechangeresponse +// #endregion class-body-c1apirequestcatalogv1requestcatalogmanagementserviceplantypechangeresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiroleminingmanagementv1roleminingmanagementserviceevaluateentitlementselection.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiroleminingmanagementv1roleminingmanagementserviceevaluateentitlementselection.go new file mode 100644 index 00000000..d75fa11f --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apiroleminingmanagementv1roleminingmanagementserviceevaluateentitlementselection.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionRequest struct { + EvaluateEntitlementSelectionRequest *shared.EvaluateEntitlementSelectionRequest `request:"mediaType=application/json"` + AnalysisID string `pathParam:"style=simple,explode=false,name=analysis_id"` +} + +func (c *C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionRequest) GetEvaluateEntitlementSelectionRequest() *shared.EvaluateEntitlementSelectionRequest { + if c == nil { + return nil + } + return c.EvaluateEntitlementSelectionRequest +} + +func (c *C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionRequest) GetAnalysisID() string { + if c == nil { + return "" + } + return c.AnalysisID +} + +// #region class-body-c1apiroleminingmanagementv1roleminingmanagementserviceevaluateentitlementselectionrequest +// #endregion class-body-c1apiroleminingmanagementv1roleminingmanagementserviceevaluateentitlementselectionrequest + +type C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionResponse struct { + // HTTP response content type for this operation + ContentType string + // EvaluateEntitlementSelectionResponse contains the exact impact of the + // resolved entitlement selection. + EvaluateEntitlementSelectionResponse *shared.EvaluateEntitlementSelectionResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionResponse) GetEvaluateEntitlementSelectionResponse() *shared.EvaluateEntitlementSelectionResponse { + if c == nil { + return nil + } + return c.EvaluateEntitlementSelectionResponse +} + +func (c *C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apiroleminingmanagementv1roleminingmanagementserviceevaluateentitlementselectionresponse +// #endregion class-body-c1apiroleminingmanagementv1roleminingmanagementserviceevaluateentitlementselectionresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisecretsv1papersecretservicesearchsecretssharedwithme.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisecretsv1papersecretservicesearchsecretssharedwithme.go new file mode 100644 index 00000000..9527e432 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisecretsv1papersecretservicesearchsecretssharedwithme.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISecretsV1PaperSecretServiceSearchSecretsSharedWithMeResponse struct { + // HTTP response content type for this operation + ContentType string + // Search response for user's own secrets + PaperSecretServiceSearchResponse *shared.PaperSecretServiceSearchResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISecretsV1PaperSecretServiceSearchSecretsSharedWithMeResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISecretsV1PaperSecretServiceSearchSecretsSharedWithMeResponse) GetPaperSecretServiceSearchResponse() *shared.PaperSecretServiceSearchResponse { + if c == nil { + return nil + } + return c.PaperSecretServiceSearchResponse +} + +func (c *C1APISecretsV1PaperSecretServiceSearchSecretsSharedWithMeResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISecretsV1PaperSecretServiceSearchSecretsSharedWithMeResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apisecretsv1papersecretservicesearchsecretssharedwithmeresponse +// #endregion class-body-c1apisecretsv1papersecretservicesearchsecretssharedwithmeresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicegeteffectivesessionpolicy.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicegeteffectivesessionpolicy.go new file mode 100644 index 00000000..853603c2 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicegeteffectivesessionpolicy.go @@ -0,0 +1,65 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyRequest struct { + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apisessionpolicyv1sessionpolicyservicegeteffectivesessionpolicyrequest +// #endregion class-body-c1apisessionpolicyv1sessionpolicyservicegeteffectivesessionpolicyrequest + +type C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyResponse struct { + // HTTP response content type for this operation + ContentType string + // SessionPolicyServiceGetEffectiveSessionPolicyResponse carries the effective + // policy and why it applies. + SessionPolicyServiceGetEffectiveSessionPolicyResponse *shared.SessionPolicyServiceGetEffectiveSessionPolicyResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyResponse) GetSessionPolicyServiceGetEffectiveSessionPolicyResponse() *shared.SessionPolicyServiceGetEffectiveSessionPolicyResponse { + if c == nil { + return nil + } + return c.SessionPolicyServiceGetEffectiveSessionPolicyResponse +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apisessionpolicyv1sessionpolicyservicegeteffectivesessionpolicyresponse +// #endregion class-body-c1apisessionpolicyv1sessionpolicyservicegeteffectivesessionpolicyresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicelistuserpolicies.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicelistuserpolicies.go new file mode 100644 index 00000000..acbe93fe --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicelistuserpolicies.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesRequest struct { + UserID string `pathParam:"style=simple,explode=false,name=user_id"` +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesRequest) GetUserID() string { + if c == nil { + return "" + } + return c.UserID +} + +// #region class-body-c1apisessionpolicyv1sessionpolicyservicelistuserpoliciesrequest +// #endregion class-body-c1apisessionpolicyv1sessionpolicyservicelistuserpoliciesrequest + +type C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesResponse struct { + // HTTP response content type for this operation + ContentType string + // SessionPolicyServiceListUserPoliciesResponse carries every policy that + // applies to the user. Unpaginated: the candidate set is the user's assigned + // policies plus at most one tenant default. + SessionPolicyServiceListUserPoliciesResponse *shared.SessionPolicyServiceListUserPoliciesResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesResponse) GetSessionPolicyServiceListUserPoliciesResponse() *shared.SessionPolicyServiceListUserPoliciesResponse { + if c == nil { + return nil + } + return c.SessionPolicyServiceListUserPoliciesResponse +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apisessionpolicyv1sessionpolicyservicelistuserpoliciesresponse +// #endregion class-body-c1apisessionpolicyv1sessionpolicyservicelistuserpoliciesresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicesearchpolicyusers.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicesearchpolicyusers.go new file mode 100644 index 00000000..cf55316e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apisessionpolicyv1sessionpolicyservicesearchpolicyusers.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersRequest struct { + SessionPolicyServiceSearchPolicyUsersRequest *shared.SessionPolicyServiceSearchPolicyUsersRequest `request:"mediaType=application/json"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersRequest) GetSessionPolicyServiceSearchPolicyUsersRequest() *shared.SessionPolicyServiceSearchPolicyUsersRequest { + if c == nil { + return nil + } + return c.SessionPolicyServiceSearchPolicyUsersRequest +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apisessionpolicyv1sessionpolicyservicesearchpolicyusersrequest +// #endregion class-body-c1apisessionpolicyv1sessionpolicyservicesearchpolicyusersrequest + +type C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersResponse struct { + // HTTP response content type for this operation + ContentType string + // SessionPolicyServiceSearchPolicyUsersResponse carries one page of the users + // a policy applies to. + SessionPolicyServiceSearchPolicyUsersResponse *shared.SessionPolicyServiceSearchPolicyUsersResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + + Next func() (*C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersResponse, error) +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersResponse) GetSessionPolicyServiceSearchPolicyUsersResponse() *shared.SessionPolicyServiceSearchPolicyUsersResponse { + if c == nil { + return nil + } + return c.SessionPolicyServiceSearchPolicyUsersResponse +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apisessionpolicyv1sessionpolicyservicesearchpolicyusersresponse +// #endregion class-body-c1apisessionpolicyv1sessionpolicyservicesearchpolicyusersresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicebatchdeletesubjectcompatibility.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicebatchdeletesubjectcompatibility.go new file mode 100644 index 00000000..a581f1b7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicebatchdeletesubjectcompatibility.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest struct { + SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest *shared.SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest) GetSSOApplicationServiceBatchDeleteSubjectCompatibilityRequest() *shared.SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest { + if c == nil { + return nil + } + return c.SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest +} + +func (c *C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apissov1ssoapplicationservicebatchdeletesubjectcompatibilityrequest +// #endregion class-body-c1apissov1ssoapplicationservicebatchdeletesubjectcompatibilityrequest + +type C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse reports bounded + // recovery progress. + SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse *shared.SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse) GetSSOApplicationServiceBatchDeleteSubjectCompatibilityResponse() *shared.SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse +} + +func (c *C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicebatchdeletesubjectcompatibilityresponse +// #endregion class-body-c1apissov1ssoapplicationservicebatchdeletesubjectcompatibilityresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicebatchimportsubjectcompatibility.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicebatchimportsubjectcompatibility.go new file mode 100644 index 00000000..96c94e8a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicebatchimportsubjectcompatibility.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityRequest struct { + SSOApplicationServiceBatchImportSubjectCompatibilityRequest *shared.SSOApplicationServiceBatchImportSubjectCompatibilityRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityRequest) GetSSOApplicationServiceBatchImportSubjectCompatibilityRequest() *shared.SSOApplicationServiceBatchImportSubjectCompatibilityRequest { + if c == nil { + return nil + } + return c.SSOApplicationServiceBatchImportSubjectCompatibilityRequest +} + +func (c *C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apissov1ssoapplicationservicebatchimportsubjectcompatibilityrequest +// #endregion class-body-c1apissov1ssoapplicationservicebatchimportsubjectcompatibilityrequest + +type C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceBatchImportSubjectCompatibilityResponse summarizes one + // bounded validation or apply batch. + SSOApplicationServiceBatchImportSubjectCompatibilityResponse *shared.SSOApplicationServiceBatchImportSubjectCompatibilityResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetSSOApplicationServiceBatchImportSubjectCompatibilityResponse() *shared.SSOApplicationServiceBatchImportSubjectCompatibilityResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceBatchImportSubjectCompatibilityResponse +} + +func (c *C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicebatchimportsubjectcompatibilityresponse +// #endregion class-body-c1apissov1ssoapplicationservicebatchimportsubjectcompatibilityresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicecreate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicecreate.go new file mode 100644 index 00000000..df461212 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicecreate.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceCreateRequest struct { + SSOApplicationServiceCreateRequest *shared.SSOApplicationServiceCreateRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` +} + +func (c *C1APISSOV1SSOApplicationServiceCreateRequest) GetSSOApplicationServiceCreateRequest() *shared.SSOApplicationServiceCreateRequest { + if c == nil { + return nil + } + return c.SSOApplicationServiceCreateRequest +} + +func (c *C1APISSOV1SSOApplicationServiceCreateRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +// #region class-body-c1apissov1ssoapplicationservicecreaterequest +// #endregion class-body-c1apissov1ssoapplicationservicecreaterequest + +type C1APISSOV1SSOApplicationServiceCreateResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceCreateResponse returns the created SSO application. + SSOApplicationServiceCreateResponse *shared.SSOApplicationServiceCreateResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceCreateResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceCreateResponse) GetSSOApplicationServiceCreateResponse() *shared.SSOApplicationServiceCreateResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceCreateResponse +} + +func (c *C1APISSOV1SSOApplicationServiceCreateResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceCreateResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicecreateresponse +// #endregion class-body-c1apissov1ssoapplicationservicecreateresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicecreateclient.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicecreateclient.go new file mode 100644 index 00000000..7b0e713e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicecreateclient.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceCreateClientRequest struct { + SSOApplicationServiceCreateClientRequest *shared.SSOApplicationServiceCreateClientRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISSOV1SSOApplicationServiceCreateClientRequest) GetSSOApplicationServiceCreateClientRequest() *shared.SSOApplicationServiceCreateClientRequest { + if c == nil { + return nil + } + return c.SSOApplicationServiceCreateClientRequest +} + +func (c *C1APISSOV1SSOApplicationServiceCreateClientRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceCreateClientRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apissov1ssoapplicationservicecreateclientrequest +// #endregion class-body-c1apissov1ssoapplicationservicecreateclientrequest + +type C1APISSOV1SSOApplicationServiceCreateClientResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceCreateClientResponse contains the generated client and + // its one-time secret, when applicable. + SSOApplicationServiceCreateClientResponse *shared.SSOApplicationServiceCreateClientResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceCreateClientResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceCreateClientResponse) GetSSOApplicationServiceCreateClientResponse() *shared.SSOApplicationServiceCreateClientResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceCreateClientResponse +} + +func (c *C1APISSOV1SSOApplicationServiceCreateClientResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceCreateClientResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicecreateclientresponse +// #endregion class-body-c1apissov1ssoapplicationservicecreateclientresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicedelete.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicedelete.go new file mode 100644 index 00000000..997fc45a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicedelete.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceDeleteRequest struct { + SSOApplicationServiceDeleteRequest *shared.SSOApplicationServiceDeleteRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteRequest) GetSSOApplicationServiceDeleteRequest() *shared.SSOApplicationServiceDeleteRequest { + if c == nil { + return nil + } + return c.SSOApplicationServiceDeleteRequest +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apissov1ssoapplicationservicedeleterequest +// #endregion class-body-c1apissov1ssoapplicationservicedeleterequest + +type C1APISSOV1SSOApplicationServiceDeleteResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceDeleteResponse confirms deletion. + SSOApplicationServiceDeleteResponse *shared.SSOApplicationServiceDeleteResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteResponse) GetSSOApplicationServiceDeleteResponse() *shared.SSOApplicationServiceDeleteResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceDeleteResponse +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicedeleteresponse +// #endregion class-body-c1apissov1ssoapplicationservicedeleteresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicedeleteclient.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicedeleteclient.go new file mode 100644 index 00000000..776753fd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicedeleteclient.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceDeleteClientRequest struct { + SSOApplicationServiceDeleteClientRequest *shared.SSOApplicationServiceDeleteClientRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteClientRequest) GetSSOApplicationServiceDeleteClientRequest() *shared.SSOApplicationServiceDeleteClientRequest { + if c == nil { + return nil + } + return c.SSOApplicationServiceDeleteClientRequest +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteClientRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteClientRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apissov1ssoapplicationservicedeleteclientrequest +// #endregion class-body-c1apissov1ssoapplicationservicedeleteclientrequest + +type C1APISSOV1SSOApplicationServiceDeleteClientResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceDeleteClientResponse confirms deletion. + SSOApplicationServiceDeleteClientResponse *shared.SSOApplicationServiceDeleteClientResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteClientResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteClientResponse) GetSSOApplicationServiceDeleteClientResponse() *shared.SSOApplicationServiceDeleteClientResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceDeleteClientResponse +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteClientResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceDeleteClientResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicedeleteclientresponse +// #endregion class-body-c1apissov1ssoapplicationservicedeleteclientresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceget.go new file mode 100644 index 00000000..e77d8a75 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceget.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceGetRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISSOV1SSOApplicationServiceGetRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceGetRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apissov1ssoapplicationservicegetrequest +// #endregion class-body-c1apissov1ssoapplicationservicegetrequest + +type C1APISSOV1SSOApplicationServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceGetResponse returns a single SSO application. + SSOApplicationServiceGetResponse *shared.SSOApplicationServiceGetResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceGetResponse) GetSSOApplicationServiceGetResponse() *shared.SSOApplicationServiceGetResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceGetResponse +} + +func (c *C1APISSOV1SSOApplicationServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicegetresponse +// #endregion class-body-c1apissov1ssoapplicationservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelist.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelist.go new file mode 100644 index 00000000..12b9ce15 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelist.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceListRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APISSOV1SSOApplicationServiceListRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceListRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APISSOV1SSOApplicationServiceListRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apissov1ssoapplicationservicelistrequest +// #endregion class-body-c1apissov1ssoapplicationservicelistrequest + +type C1APISSOV1SSOApplicationServiceListResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceListResponse returns a page of SSO applications. + SSOApplicationServiceListResponse *shared.SSOApplicationServiceListResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceListResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceListResponse) GetSSOApplicationServiceListResponse() *shared.SSOApplicationServiceListResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceListResponse +} + +func (c *C1APISSOV1SSOApplicationServiceListResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceListResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicelistresponse +// #endregion class-body-c1apissov1ssoapplicationservicelistresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelistclients.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelistclients.go new file mode 100644 index 00000000..7a90b859 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelistclients.go @@ -0,0 +1,89 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceListClientsRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APISSOV1SSOApplicationServiceListClientsRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceListClientsRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +func (c *C1APISSOV1SSOApplicationServiceListClientsRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APISSOV1SSOApplicationServiceListClientsRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apissov1ssoapplicationservicelistclientsrequest +// #endregion class-body-c1apissov1ssoapplicationservicelistclientsrequest + +type C1APISSOV1SSOApplicationServiceListClientsResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceListClientsResponse contains a page of App-owned OAuth + // clients. + SSOApplicationServiceListClientsResponse *shared.SSOApplicationServiceListClientsResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceListClientsResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceListClientsResponse) GetSSOApplicationServiceListClientsResponse() *shared.SSOApplicationServiceListClientsResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceListClientsResponse +} + +func (c *C1APISSOV1SSOApplicationServiceListClientsResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceListClientsResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicelistclientsresponse +// #endregion class-body-c1apissov1ssoapplicationservicelistclientsresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelisthistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelisthistory.go new file mode 100644 index 00000000..b761a8c2 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicelisthistory.go @@ -0,0 +1,89 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceListHistoryRequest struct { + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APISSOV1SSOApplicationServiceListHistoryRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceListHistoryRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +func (c *C1APISSOV1SSOApplicationServiceListHistoryRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APISSOV1SSOApplicationServiceListHistoryRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apissov1ssoapplicationservicelisthistoryrequest +// #endregion class-body-c1apissov1ssoapplicationservicelisthistoryrequest + +type C1APISSOV1SSOApplicationServiceListHistoryResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceListHistoryResponse returns SSO application history + // entries. + SSOApplicationServiceListHistoryResponse *shared.SSOApplicationServiceListHistoryResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceListHistoryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceListHistoryResponse) GetSSOApplicationServiceListHistoryResponse() *shared.SSOApplicationServiceListHistoryResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceListHistoryResponse +} + +func (c *C1APISSOV1SSOApplicationServiceListHistoryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceListHistoryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicelisthistoryresponse +// #endregion class-body-c1apissov1ssoapplicationservicelisthistoryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceparsesamlserviceprovidermetadata.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceparsesamlserviceprovidermetadata.go new file mode 100644 index 00000000..5db0b5b6 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceparsesamlserviceprovidermetadata.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceParseSAMLServiceProviderMetadataResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceParseSAMLServiceProviderMetadataResponse returns the + // SAML configuration derived from one metadata document and every finding the + // parser raised about it. + SSOApplicationServiceParseSAMLServiceProviderMetadataResponse *shared.SSOApplicationServiceParseSAMLServiceProviderMetadataResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceParseSAMLServiceProviderMetadataResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceParseSAMLServiceProviderMetadataResponse) GetSSOApplicationServiceParseSAMLServiceProviderMetadataResponse() *shared.SSOApplicationServiceParseSAMLServiceProviderMetadataResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceParseSAMLServiceProviderMetadataResponse +} + +func (c *C1APISSOV1SSOApplicationServiceParseSAMLServiceProviderMetadataResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceParseSAMLServiceProviderMetadataResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationserviceparsesamlserviceprovidermetadataresponse +// #endregion class-body-c1apissov1ssoapplicationserviceparsesamlserviceprovidermetadataresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicerotateclientsecret.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicerotateclientsecret.go new file mode 100644 index 00000000..d65f8d61 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicerotateclientsecret.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceRotateClientSecretRequest struct { + SSOApplicationServiceRotateClientSecretRequest *shared.SSOApplicationServiceRotateClientSecretRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISSOV1SSOApplicationServiceRotateClientSecretRequest) GetSSOApplicationServiceRotateClientSecretRequest() *shared.SSOApplicationServiceRotateClientSecretRequest { + if c == nil { + return nil + } + return c.SSOApplicationServiceRotateClientSecretRequest +} + +func (c *C1APISSOV1SSOApplicationServiceRotateClientSecretRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceRotateClientSecretRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apissov1ssoapplicationservicerotateclientsecretrequest +// #endregion class-body-c1apissov1ssoapplicationservicerotateclientsecretrequest + +type C1APISSOV1SSOApplicationServiceRotateClientSecretResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceRotateClientSecretResponse contains the replacement + // secret. The value cannot be retrieved again. + SSOApplicationServiceRotateClientSecretResponse *shared.SSOApplicationServiceRotateClientSecretResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceRotateClientSecretResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceRotateClientSecretResponse) GetSSOApplicationServiceRotateClientSecretResponse() *shared.SSOApplicationServiceRotateClientSecretResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceRotateClientSecretResponse +} + +func (c *C1APISSOV1SSOApplicationServiceRotateClientSecretResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceRotateClientSecretResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicerotateclientsecretresponse +// #endregion class-body-c1apissov1ssoapplicationservicerotateclientsecretresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicesearch.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicesearch.go new file mode 100644 index 00000000..977ba4ef --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationservicesearch.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceSearchResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceSearchResponse returns matching SSO applications. + SSOApplicationServiceSearchResponse *shared.SSOApplicationServiceSearchResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceSearchResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceSearchResponse) GetSSOApplicationServiceSearchResponse() *shared.SSOApplicationServiceSearchResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceSearchResponse +} + +func (c *C1APISSOV1SSOApplicationServiceSearchResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceSearchResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationservicesearchresponse +// #endregion class-body-c1apissov1ssoapplicationservicesearchresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceupdate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceupdate.go new file mode 100644 index 00000000..254e56ff --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceupdate.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceUpdateRequest struct { + SSOApplicationServiceUpdateRequest *shared.SSOApplicationServiceUpdateRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateRequest) GetSSOApplicationServiceUpdateRequest() *shared.SSOApplicationServiceUpdateRequest { + if c == nil { + return nil + } + return c.SSOApplicationServiceUpdateRequest +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apissov1ssoapplicationserviceupdaterequest +// #endregion class-body-c1apissov1ssoapplicationserviceupdaterequest + +type C1APISSOV1SSOApplicationServiceUpdateResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceUpdateResponse returns the updated SSO application. + SSOApplicationServiceUpdateResponse *shared.SSOApplicationServiceUpdateResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateResponse) GetSSOApplicationServiceUpdateResponse() *shared.SSOApplicationServiceUpdateResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceUpdateResponse +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationserviceupdateresponse +// #endregion class-body-c1apissov1ssoapplicationserviceupdateresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceupdateclient.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceupdateclient.go new file mode 100644 index 00000000..10aef18d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssoapplicationserviceupdateclient.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOApplicationServiceUpdateClientRequest struct { + SSOApplicationServiceUpdateClientRequest *shared.SSOApplicationServiceUpdateClientRequest `request:"mediaType=application/json"` + AppID string `pathParam:"style=simple,explode=false,name=app_id"` + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateClientRequest) GetSSOApplicationServiceUpdateClientRequest() *shared.SSOApplicationServiceUpdateClientRequest { + if c == nil { + return nil + } + return c.SSOApplicationServiceUpdateClientRequest +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateClientRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateClientRequest) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// #region class-body-c1apissov1ssoapplicationserviceupdateclientrequest +// #endregion class-body-c1apissov1ssoapplicationserviceupdateclientrequest + +type C1APISSOV1SSOApplicationServiceUpdateClientResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOApplicationServiceUpdateClientResponse contains the updated client. + SSOApplicationServiceUpdateClientResponse *shared.SSOApplicationServiceUpdateClientResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateClientResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateClientResponse) GetSSOApplicationServiceUpdateClientResponse() *shared.SSOApplicationServiceUpdateClientResponse { + if c == nil { + return nil + } + return c.SSOApplicationServiceUpdateClientResponse +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateClientResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOApplicationServiceUpdateClientResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssoapplicationserviceupdateclientresponse +// #endregion class-body-c1apissov1ssoapplicationserviceupdateclientresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsserviceget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsserviceget.go new file mode 100644 index 00000000..5fbcb1ca --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsserviceget.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOSettingsServiceGetResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOSettingsServiceGetResponse returns the tenant's SSO provider settings. + SSOSettingsServiceGetResponse *shared.SSOSettingsServiceGetResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOSettingsServiceGetResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOSettingsServiceGetResponse) GetSSOSettingsServiceGetResponse() *shared.SSOSettingsServiceGetResponse { + if c == nil { + return nil + } + return c.SSOSettingsServiceGetResponse +} + +func (c *C1APISSOV1SSOSettingsServiceGetResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOSettingsServiceGetResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssosettingsservicegetresponse +// #endregion class-body-c1apissov1ssosettingsservicegetresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsservicelisthistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsservicelisthistory.go new file mode 100644 index 00000000..7af9c075 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsservicelisthistory.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOSettingsServiceListHistoryRequest struct { + PageSize *int `queryParam:"style=form,explode=true,name=page_size"` + PageToken *string `queryParam:"style=form,explode=true,name=page_token"` +} + +func (c *C1APISSOV1SSOSettingsServiceListHistoryRequest) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1APISSOV1SSOSettingsServiceListHistoryRequest) GetPageToken() *string { + if c == nil { + return nil + } + return c.PageToken +} + +// #region class-body-c1apissov1ssosettingsservicelisthistoryrequest +// #endregion class-body-c1apissov1ssosettingsservicelisthistoryrequest + +type C1APISSOV1SSOSettingsServiceListHistoryResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOSettingsServiceListHistoryResponse returns SSO settings history entries. + SSOSettingsServiceListHistoryResponse *shared.SSOSettingsServiceListHistoryResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOSettingsServiceListHistoryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOSettingsServiceListHistoryResponse) GetSSOSettingsServiceListHistoryResponse() *shared.SSOSettingsServiceListHistoryResponse { + if c == nil { + return nil + } + return c.SSOSettingsServiceListHistoryResponse +} + +func (c *C1APISSOV1SSOSettingsServiceListHistoryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOSettingsServiceListHistoryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssosettingsservicelisthistoryresponse +// #endregion class-body-c1apissov1ssosettingsservicelisthistoryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsserviceupdate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsserviceupdate.go new file mode 100644 index 00000000..88d792f8 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apissov1ssosettingsserviceupdate.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APISSOV1SSOSettingsServiceUpdateResponse struct { + // HTTP response content type for this operation + ContentType string + // SSOSettingsServiceUpdateResponse returns the updated settings. + SSOSettingsServiceUpdateResponse *shared.SSOSettingsServiceUpdateResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (c *C1APISSOV1SSOSettingsServiceUpdateResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APISSOV1SSOSettingsServiceUpdateResponse) GetSSOSettingsServiceUpdateResponse() *shared.SSOSettingsServiceUpdateResponse { + if c == nil { + return nil + } + return c.SSOSettingsServiceUpdateResponse +} + +func (c *C1APISSOV1SSOSettingsServiceUpdateResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APISSOV1SSOSettingsServiceUpdateResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +// #region class-body-c1apissov1ssosettingsserviceupdateresponse +// #endregion class-body-c1apissov1ssosettingsserviceupdateresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitaskv1taskactionsserviceretryprovisioning.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitaskv1taskactionsserviceretryprovisioning.go new file mode 100644 index 00000000..70abf11d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitaskv1taskactionsserviceretryprovisioning.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APITaskV1TaskActionsServiceRetryProvisioningRequest struct { + TaskActionsServiceRetryProvisioningRequest *shared.TaskActionsServiceRetryProvisioningRequest `request:"mediaType=application/json"` + TaskID string `pathParam:"style=simple,explode=false,name=task_id"` +} + +func (c *C1APITaskV1TaskActionsServiceRetryProvisioningRequest) GetTaskActionsServiceRetryProvisioningRequest() *shared.TaskActionsServiceRetryProvisioningRequest { + if c == nil { + return nil + } + return c.TaskActionsServiceRetryProvisioningRequest +} + +func (c *C1APITaskV1TaskActionsServiceRetryProvisioningRequest) GetTaskID() string { + if c == nil { + return "" + } + return c.TaskID +} + +// #region class-body-c1apitaskv1taskactionsserviceretryprovisioningrequest +// #endregion class-body-c1apitaskv1taskactionsserviceretryprovisioningrequest + +type C1APITaskV1TaskActionsServiceRetryProvisioningResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // A generic response for task action endpoints, containing the updated task and the ID of the action that was created. + TaskServiceActionResponse *shared.TaskServiceActionResponse +} + +func (c *C1APITaskV1TaskActionsServiceRetryProvisioningResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APITaskV1TaskActionsServiceRetryProvisioningResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APITaskV1TaskActionsServiceRetryProvisioningResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APITaskV1TaskActionsServiceRetryProvisioningResponse) GetTaskServiceActionResponse() *shared.TaskServiceActionResponse { + if c == nil { + return nil + } + return c.TaskServiceActionResponse +} + +// #region class-body-c1apitaskv1taskactionsserviceretryprovisioningresponse +// #endregion class-body-c1apitaskv1taskactionsserviceretryprovisioningresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicegetdiscoverysnapshot.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicegetdiscoverysnapshot.go new file mode 100644 index 00000000..c2cccb91 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicegetdiscoverysnapshot.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotRequest struct { + TbInstanceID string `pathParam:"style=simple,explode=false,name=tb_instance_id"` +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotRequest) GetTbInstanceID() string { + if c == nil { + return "" + } + return c.TbInstanceID +} + +// #region class-body-c1apitbcontrolplanev1tbcontrolplaneservicegetdiscoverysnapshotrequest +// #endregion class-body-c1apitbcontrolplanev1tbcontrolplaneservicegetdiscoverysnapshotrequest + +type C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + TBControlPlaneServiceGetDiscoverySnapshotResponse *shared.TBControlPlaneServiceGetDiscoverySnapshotResponse +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotResponse) GetTBControlPlaneServiceGetDiscoverySnapshotResponse() *shared.TBControlPlaneServiceGetDiscoverySnapshotResponse { + if c == nil { + return nil + } + return c.TBControlPlaneServiceGetDiscoverySnapshotResponse +} + +// #region class-body-c1apitbcontrolplanev1tbcontrolplaneservicegetdiscoverysnapshotresponse +// #endregion class-body-c1apitbcontrolplanev1tbcontrolplaneservicegetdiscoverysnapshotresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicegetegresspolicy.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicegetegresspolicy.go new file mode 100644 index 00000000..6abaf11e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicegetegresspolicy.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyRequest struct { + TbInstanceID string `pathParam:"style=simple,explode=false,name=tb_instance_id"` +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyRequest) GetTbInstanceID() string { + if c == nil { + return "" + } + return c.TbInstanceID +} + +// #region class-body-c1apitbcontrolplanev1tbcontrolplaneservicegetegresspolicyrequest +// #endregion class-body-c1apitbcontrolplanev1tbcontrolplaneservicegetegresspolicyrequest + +type C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + TBControlPlaneServiceGetEgressPolicyResponse *shared.TBControlPlaneServiceGetEgressPolicyResponse +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyResponse) GetTBControlPlaneServiceGetEgressPolicyResponse() *shared.TBControlPlaneServiceGetEgressPolicyResponse { + if c == nil { + return nil + } + return c.TBControlPlaneServiceGetEgressPolicyResponse +} + +// #region class-body-c1apitbcontrolplanev1tbcontrolplaneservicegetegresspolicyresponse +// #endregion class-body-c1apitbcontrolplanev1tbcontrolplaneservicegetegresspolicyresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicepushdiscovery.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicepushdiscovery.go new file mode 100644 index 00000000..5babd575 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicepushdiscovery.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APITbcontrolplaneV1TBControlPlaneServicePushDiscoveryResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + TBControlPlaneServicePushDiscoveryResponse *shared.TBControlPlaneServicePushDiscoveryResponse +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServicePushDiscoveryResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServicePushDiscoveryResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServicePushDiscoveryResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServicePushDiscoveryResponse) GetTBControlPlaneServicePushDiscoveryResponse() *shared.TBControlPlaneServicePushDiscoveryResponse { + if c == nil { + return nil + } + return c.TBControlPlaneServicePushDiscoveryResponse +} + +// #region class-body-c1apitbcontrolplanev1tbcontrolplaneservicepushdiscoveryresponse +// #endregion class-body-c1apitbcontrolplanev1tbcontrolplaneservicepushdiscoveryresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicesaveegresspolicy.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicesaveegresspolicy.go new file mode 100644 index 00000000..a7c03aec --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/operations/c1apitbcontrolplanev1tbcontrolplaneservicesaveegresspolicy.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "net/http" +) + +type C1APITbcontrolplaneV1TBControlPlaneServiceSaveEgressPolicyResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successful response + TBControlPlaneServiceSaveEgressPolicyResponse *shared.TBControlPlaneServiceSaveEgressPolicyResponse +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceSaveEgressPolicyResponse) GetContentType() string { + if c == nil { + return "" + } + return c.ContentType +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceSaveEgressPolicyResponse) GetStatusCode() int { + if c == nil { + return 0 + } + return c.StatusCode +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceSaveEgressPolicyResponse) GetRawResponse() *http.Response { + if c == nil { + return nil + } + return c.RawResponse +} + +func (c *C1APITbcontrolplaneV1TBControlPlaneServiceSaveEgressPolicyResponse) GetTBControlPlaneServiceSaveEgressPolicyResponse() *shared.TBControlPlaneServiceSaveEgressPolicyResponse { + if c == nil { + return nil + } + return c.TBControlPlaneServiceSaveEgressPolicyResponse +} + +// #region class-body-c1apitbcontrolplanev1tbcontrolplaneservicesaveegresspolicyresponse +// #endregion class-body-c1apitbcontrolplanev1tbcontrolplaneservicesaveegresspolicyresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uicomponent.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uicomponent.go index ad15aad6..1a4c40d0 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uicomponent.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uicomponent.go @@ -32,6 +32,8 @@ package shared // - c1OnboardingPlan // - c1ConnectorSyncDetail // - c1Chart +// - c1MetricCards +// - c1Table type A2UIComponent struct { Button *ButtonComponent `json:"button,omitempty"` C1Chart *C1ChartComponent `json:"c1Chart,omitempty"` @@ -40,12 +42,14 @@ type A2UIComponent struct { C1ConnectorSyncDetail *C1ConnectorSyncDetailComponent `json:"c1ConnectorSyncDetail,omitempty"` C1ConnectorSyncProgress *C1ConnectorSyncProgressComponent `json:"c1ConnectorSyncProgress,omitempty"` C1DurationPicker *C1DurationPickerComponent `json:"c1DurationPicker,omitempty"` + C1MetricCards *C1MetricCardsComponent `json:"c1MetricCards,omitempty"` C1MsTeamsNotifications *C1MSTeamsNotificationsComponent `json:"c1MsTeamsNotifications,omitempty"` C1OnboardingPlan *C1OnboardingPlanComponent `json:"c1OnboardingPlan,omitempty"` C1OnboardingWelcome *C1OnboardingWelcomeComponent `json:"c1OnboardingWelcome,omitempty"` C1ResourcePicker *C1ResourcePickerComponent `json:"c1ResourcePicker,omitempty"` C1SlackNotifications *C1SlackNotificationsComponent `json:"c1SlackNotifications,omitempty"` C1StatusIndicator *C1StatusIndicatorComponent `json:"c1StatusIndicator,omitempty"` + C1Table *C1TableComponent `json:"c1Table,omitempty"` C1TodoList *C1TodoListComponent `json:"c1TodoList,omitempty"` Card *CardComponent `json:"card,omitempty"` CheckBox *CheckBoxComponent `json:"checkBox,omitempty"` @@ -113,6 +117,13 @@ func (a *A2UIComponent) GetC1DurationPicker() *C1DurationPickerComponent { return a.C1DurationPicker } +func (a *A2UIComponent) GetC1MetricCards() *C1MetricCardsComponent { + if a == nil { + return nil + } + return a.C1MetricCards +} + func (a *A2UIComponent) GetC1MsTeamsNotifications() *C1MSTeamsNotificationsComponent { if a == nil { return nil @@ -155,6 +166,13 @@ func (a *A2UIComponent) GetC1StatusIndicator() *C1StatusIndicatorComponent { return a.C1StatusIndicator } +func (a *A2UIComponent) GetC1Table() *C1TableComponent { + if a == nil { + return nil + } + return a.C1Table +} + func (a *A2UIComponent) GetC1TodoList() *C1TodoListComponent { if a == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenanceobject.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenanceobject.go new file mode 100644 index 00000000..2db07369 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenanceobject.go @@ -0,0 +1,91 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// RecordType - Not always the step's own type: a step over grants can be narrowed to one +// +// app, and the app is the record worth naming. +type RecordType string + +const ( + RecordTypeA2UIProvenanceRecordTypeUnspecified RecordType = "A2UI_PROVENANCE_RECORD_TYPE_UNSPECIFIED" + RecordTypeA2UIProvenanceRecordTypeApp RecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP" + RecordTypeA2UIProvenanceRecordTypeUser RecordType = "A2UI_PROVENANCE_RECORD_TYPE_USER" + RecordTypeA2UIProvenanceRecordTypeGrant RecordType = "A2UI_PROVENANCE_RECORD_TYPE_GRANT" + RecordTypeA2UIProvenanceRecordTypeAppEntitlement RecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_ENTITLEMENT" + RecordTypeA2UIProvenanceRecordTypeAppUser RecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_USER" + RecordTypeA2UIProvenanceRecordTypeAppResource RecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_RESOURCE" + RecordTypeA2UIProvenanceRecordTypeAppResourceType RecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_RESOURCE_TYPE" + RecordTypeA2UIProvenanceRecordTypeTask RecordType = "A2UI_PROVENANCE_RECORD_TYPE_TASK" + RecordTypeA2UIProvenanceRecordTypePolicy RecordType = "A2UI_PROVENANCE_RECORD_TYPE_POLICY" + RecordTypeA2UIProvenanceRecordTypeConnector RecordType = "A2UI_PROVENANCE_RECORD_TYPE_CONNECTOR" + RecordTypeA2UIProvenanceRecordTypeAccessReview RecordType = "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW" + RecordTypeA2UIProvenanceRecordTypeAccessReviewTemplate RecordType = "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW_TEMPLATE" + RecordTypeA2UIProvenanceRecordTypeAccessReviewSelection RecordType = "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW_SELECTION" + RecordTypeA2UIProvenanceRecordTypeConflictMonitor RecordType = "A2UI_PROVENANCE_RECORD_TYPE_CONFLICT_MONITOR" + RecordTypeA2UIProvenanceRecordTypeAccessViolation RecordType = "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_VIOLATION" + RecordTypeA2UIProvenanceRecordTypeRequestCatalog RecordType = "A2UI_PROVENANCE_RECORD_TYPE_REQUEST_CATALOG" + RecordTypeA2UIProvenanceRecordTypeWebhook RecordType = "A2UI_PROVENANCE_RECORD_TYPE_WEBHOOK" + RecordTypeA2UIProvenanceRecordTypeDirectory RecordType = "A2UI_PROVENANCE_RECORD_TYPE_DIRECTORY" + RecordTypeA2UIProvenanceRecordTypeProfileType RecordType = "A2UI_PROVENANCE_RECORD_TYPE_PROFILE_TYPE" + RecordTypeA2UIProvenanceRecordTypeRoleBinding RecordType = "A2UI_PROVENANCE_RECORD_TYPE_ROLE_BINDING" + RecordTypeA2UIProvenanceRecordTypeAutomationExecution RecordType = "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION_EXECUTION" + RecordTypeA2UIProvenanceRecordTypeAutomationExecutionStep RecordType = "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION_EXECUTION_STEP" + RecordTypeA2UIProvenanceRecordTypeFinding RecordType = "A2UI_PROVENANCE_RECORD_TYPE_FINDING" + RecordTypeA2UIProvenanceRecordTypeMetric RecordType = "A2UI_PROVENANCE_RECORD_TYPE_METRIC" + RecordTypeA2UIProvenanceRecordTypeAutomation RecordType = "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION" + RecordTypeA2UIProvenanceRecordTypeGrantHistory RecordType = "A2UI_PROVENANCE_RECORD_TYPE_GRANT_HISTORY" + RecordTypeA2UIProvenanceRecordTypeGrantReason RecordType = "A2UI_PROVENANCE_RECORD_TYPE_GRANT_REASON" + RecordTypeA2UIProvenanceRecordTypeAppOwner RecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_OWNER" +) + +func (e RecordType) ToPointer() *RecordType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *RecordType) IsExact() bool { + if e != nil { + switch *e { + case "A2UI_PROVENANCE_RECORD_TYPE_UNSPECIFIED", "A2UI_PROVENANCE_RECORD_TYPE_APP", "A2UI_PROVENANCE_RECORD_TYPE_USER", "A2UI_PROVENANCE_RECORD_TYPE_GRANT", "A2UI_PROVENANCE_RECORD_TYPE_APP_ENTITLEMENT", "A2UI_PROVENANCE_RECORD_TYPE_APP_USER", "A2UI_PROVENANCE_RECORD_TYPE_APP_RESOURCE", "A2UI_PROVENANCE_RECORD_TYPE_APP_RESOURCE_TYPE", "A2UI_PROVENANCE_RECORD_TYPE_TASK", "A2UI_PROVENANCE_RECORD_TYPE_POLICY", "A2UI_PROVENANCE_RECORD_TYPE_CONNECTOR", "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW", "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW_TEMPLATE", "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW_SELECTION", "A2UI_PROVENANCE_RECORD_TYPE_CONFLICT_MONITOR", "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_VIOLATION", "A2UI_PROVENANCE_RECORD_TYPE_REQUEST_CATALOG", "A2UI_PROVENANCE_RECORD_TYPE_WEBHOOK", "A2UI_PROVENANCE_RECORD_TYPE_DIRECTORY", "A2UI_PROVENANCE_RECORD_TYPE_PROFILE_TYPE", "A2UI_PROVENANCE_RECORD_TYPE_ROLE_BINDING", "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION_EXECUTION", "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION_EXECUTION_STEP", "A2UI_PROVENANCE_RECORD_TYPE_FINDING", "A2UI_PROVENANCE_RECORD_TYPE_METRIC", "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION", "A2UI_PROVENANCE_RECORD_TYPE_GRANT_HISTORY", "A2UI_PROVENANCE_RECORD_TYPE_GRANT_REASON", "A2UI_PROVENANCE_RECORD_TYPE_APP_OWNER": + return true + } + } + return false +} + +// A2UIProvenanceObject names one record a step referred to by id. +type A2UIProvenanceObject struct { + // Empty when the record's type has no name to resolve, or the record is + // gone. The id then stands alone rather than the whole row being dropped. + DisplayName *string `json:"displayName,omitempty"` + // The id field. + ID *string `json:"id,omitempty"` + // Not always the step's own type: a step over grants can be narrowed to one + // app, and the app is the record worth naming. + RecordType *RecordType `json:"recordType,omitempty"` +} + +func (a *A2UIProvenanceObject) GetDisplayName() *string { + if a == nil { + return nil + } + return a.DisplayName +} + +func (a *A2UIProvenanceObject) GetID() *string { + if a == nil { + return nil + } + return a.ID +} + +func (a *A2UIProvenanceObject) GetRecordType() *RecordType { + if a == nil { + return nil + } + return a.RecordType +} + +// #region class-body-a2uiprovenanceobject +// #endregion class-body-a2uiprovenanceobject diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancesource.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancesource.go new file mode 100644 index 00000000..c29efa53 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancesource.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" +) + +// A2UIProvenanceSource is one self-reported source from a reporting component: +// +// what a chart or table says it was drawn from, and how many rows fed it. +type A2UIProvenanceSource struct { + // The componentId field. + ComponentID *string `json:"componentId,omitempty"` + // The count field. + Count *int64 `integer:"string" json:"count,omitempty"` + // The kind field. + Kind *string `json:"kind,omitempty"` + // The label field. + Label *string `json:"label,omitempty"` + // Deprecated: always empty. See verified. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + MatchedToolCall *string `json:"matchedToolCall,omitempty"` + // The ref field. + Ref *string `json:"ref,omitempty"` + // Deprecated: always false. Superseded by + // A2UIServiceGetSurfaceProvenanceResponse.steps, which reports what the + // program did rather than judging it. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Verified *bool `json:"verified,omitempty"` +} + +func (a A2UIProvenanceSource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *A2UIProvenanceSource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *A2UIProvenanceSource) GetComponentID() *string { + if a == nil { + return nil + } + return a.ComponentID +} + +func (a *A2UIProvenanceSource) GetCount() *int64 { + if a == nil { + return nil + } + return a.Count +} + +func (a *A2UIProvenanceSource) GetKind() *string { + if a == nil { + return nil + } + return a.Kind +} + +func (a *A2UIProvenanceSource) GetLabel() *string { + if a == nil { + return nil + } + return a.Label +} + +func (a *A2UIProvenanceSource) GetMatchedToolCall() *string { + if a == nil { + return nil + } + return a.MatchedToolCall +} + +func (a *A2UIProvenanceSource) GetRef() *string { + if a == nil { + return nil + } + return a.Ref +} + +func (a *A2UIProvenanceSource) GetVerified() *bool { + if a == nil { + return nil + } + return a.Verified +} + +// #region class-body-a2uiprovenancesource +// #endregion class-body-a2uiprovenancesource diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancestep.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancestep.go new file mode 100644 index 00000000..d31b5543 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancestep.go @@ -0,0 +1,122 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// Operation - The operation field. +type Operation string + +const ( + OperationA2UIProvenanceOperationUnspecified Operation = "A2UI_PROVENANCE_OPERATION_UNSPECIFIED" + OperationA2UIProvenanceOperationLookedUp Operation = "A2UI_PROVENANCE_OPERATION_LOOKED_UP" + OperationA2UIProvenanceOperationCounted Operation = "A2UI_PROVENANCE_OPERATION_COUNTED" + OperationA2UIProvenanceOperationFetchedRecord Operation = "A2UI_PROVENANCE_OPERATION_FETCHED_RECORD" + OperationA2UIProvenanceOperationSearched Operation = "A2UI_PROVENANCE_OPERATION_SEARCHED" + OperationA2UIProvenanceOperationReadTrend Operation = "A2UI_PROVENANCE_OPERATION_READ_TREND" + OperationA2UIProvenanceOperationCreated Operation = "A2UI_PROVENANCE_OPERATION_CREATED" + OperationA2UIProvenanceOperationUpdated Operation = "A2UI_PROVENANCE_OPERATION_UPDATED" + OperationA2UIProvenanceOperationDeleted Operation = "A2UI_PROVENANCE_OPERATION_DELETED" + OperationA2UIProvenanceOperationRanProgram Operation = "A2UI_PROVENANCE_OPERATION_RAN_PROGRAM" + OperationA2UIProvenanceOperationBuiltReport Operation = "A2UI_PROVENANCE_OPERATION_BUILT_REPORT" +) + +func (e Operation) ToPointer() *Operation { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Operation) IsExact() bool { + if e != nil { + switch *e { + case "A2UI_PROVENANCE_OPERATION_UNSPECIFIED", "A2UI_PROVENANCE_OPERATION_LOOKED_UP", "A2UI_PROVENANCE_OPERATION_COUNTED", "A2UI_PROVENANCE_OPERATION_FETCHED_RECORD", "A2UI_PROVENANCE_OPERATION_SEARCHED", "A2UI_PROVENANCE_OPERATION_READ_TREND", "A2UI_PROVENANCE_OPERATION_CREATED", "A2UI_PROVENANCE_OPERATION_UPDATED", "A2UI_PROVENANCE_OPERATION_DELETED", "A2UI_PROVENANCE_OPERATION_RAN_PROGRAM", "A2UI_PROVENANCE_OPERATION_BUILT_REPORT": + return true + } + } + return false +} + +// A2UIProvenanceStepRecordType - The recordType field. +type A2UIProvenanceStepRecordType string + +const ( + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeUnspecified A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_UNSPECIFIED" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeApp A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeUser A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_USER" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeGrant A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_GRANT" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAppEntitlement A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_ENTITLEMENT" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAppUser A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_USER" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAppResource A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_RESOURCE" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAppResourceType A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_RESOURCE_TYPE" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeTask A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_TASK" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypePolicy A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_POLICY" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeConnector A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_CONNECTOR" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAccessReview A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAccessReviewTemplate A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW_TEMPLATE" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAccessReviewSelection A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW_SELECTION" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeConflictMonitor A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_CONFLICT_MONITOR" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAccessViolation A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_VIOLATION" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeRequestCatalog A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_REQUEST_CATALOG" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeWebhook A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_WEBHOOK" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeDirectory A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_DIRECTORY" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeProfileType A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_PROFILE_TYPE" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeRoleBinding A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_ROLE_BINDING" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAutomationExecution A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION_EXECUTION" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAutomationExecutionStep A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION_EXECUTION_STEP" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeFinding A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_FINDING" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeMetric A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_METRIC" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAutomation A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeGrantHistory A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_GRANT_HISTORY" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeGrantReason A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_GRANT_REASON" + A2UIProvenanceStepRecordTypeA2UIProvenanceRecordTypeAppOwner A2UIProvenanceStepRecordType = "A2UI_PROVENANCE_RECORD_TYPE_APP_OWNER" +) + +func (e A2UIProvenanceStepRecordType) ToPointer() *A2UIProvenanceStepRecordType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *A2UIProvenanceStepRecordType) IsExact() bool { + if e != nil { + switch *e { + case "A2UI_PROVENANCE_RECORD_TYPE_UNSPECIFIED", "A2UI_PROVENANCE_RECORD_TYPE_APP", "A2UI_PROVENANCE_RECORD_TYPE_USER", "A2UI_PROVENANCE_RECORD_TYPE_GRANT", "A2UI_PROVENANCE_RECORD_TYPE_APP_ENTITLEMENT", "A2UI_PROVENANCE_RECORD_TYPE_APP_USER", "A2UI_PROVENANCE_RECORD_TYPE_APP_RESOURCE", "A2UI_PROVENANCE_RECORD_TYPE_APP_RESOURCE_TYPE", "A2UI_PROVENANCE_RECORD_TYPE_TASK", "A2UI_PROVENANCE_RECORD_TYPE_POLICY", "A2UI_PROVENANCE_RECORD_TYPE_CONNECTOR", "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW", "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW_TEMPLATE", "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_REVIEW_SELECTION", "A2UI_PROVENANCE_RECORD_TYPE_CONFLICT_MONITOR", "A2UI_PROVENANCE_RECORD_TYPE_ACCESS_VIOLATION", "A2UI_PROVENANCE_RECORD_TYPE_REQUEST_CATALOG", "A2UI_PROVENANCE_RECORD_TYPE_WEBHOOK", "A2UI_PROVENANCE_RECORD_TYPE_DIRECTORY", "A2UI_PROVENANCE_RECORD_TYPE_PROFILE_TYPE", "A2UI_PROVENANCE_RECORD_TYPE_ROLE_BINDING", "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION_EXECUTION", "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION_EXECUTION_STEP", "A2UI_PROVENANCE_RECORD_TYPE_FINDING", "A2UI_PROVENANCE_RECORD_TYPE_METRIC", "A2UI_PROVENANCE_RECORD_TYPE_AUTOMATION", "A2UI_PROVENANCE_RECORD_TYPE_GRANT_HISTORY", "A2UI_PROVENANCE_RECORD_TYPE_GRANT_REASON", "A2UI_PROVENANCE_RECORD_TYPE_APP_OWNER": + return true + } + } + return false +} + +// A2UIProvenanceStep is one thing the report's program did. Steps are returned +// +// in the order the program performs them. +type A2UIProvenanceStep struct { + // The specific records this step named. Empty when the step names none, and + // withheld wholesale when step_objects_visible is false. + Objects []A2UIProvenanceObject `json:"objects,omitempty"` + // The operation field. + Operation *Operation `json:"operation,omitempty"` + // The recordType field. + RecordType *A2UIProvenanceStepRecordType `json:"recordType,omitempty"` +} + +func (a *A2UIProvenanceStep) GetObjects() []A2UIProvenanceObject { + if a == nil { + return nil + } + return a.Objects +} + +func (a *A2UIProvenanceStep) GetOperation() *Operation { + if a == nil { + return nil + } + return a.Operation +} + +func (a *A2UIProvenanceStep) GetRecordType() *A2UIProvenanceStepRecordType { + if a == nil { + return nil + } + return a.RecordType +} + +// #region class-body-a2uiprovenancestep +// #endregion class-body-a2uiprovenancestep diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancetoolcall.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancetoolcall.go new file mode 100644 index 00000000..104567ef --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiprovenancetoolcall.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// A2UIProvenanceToolCall is one tool call extracted from the transcript. +type A2UIProvenanceToolCall struct { + CalledAt *time.Time `json:"calledAt,omitempty"` + // Leading characters of the tool input, whitespace-collapsed. + InputDigest *string `json:"inputDigest,omitempty"` + // The toolName field. + ToolName *string `json:"toolName,omitempty"` +} + +func (a A2UIProvenanceToolCall) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *A2UIProvenanceToolCall) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *A2UIProvenanceToolCall) GetCalledAt() *time.Time { + if a == nil { + return nil + } + return a.CalledAt +} + +func (a *A2UIProvenanceToolCall) GetInputDigest() *string { + if a == nil { + return nil + } + return a.InputDigest +} + +func (a *A2UIProvenanceToolCall) GetToolName() *string { + if a == nil { + return nil + } + return a.ToolName +} + +// #region class-body-a2uiprovenancetoolcall +// #endregion class-body-a2uiprovenancetoolcall diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uireportedittarget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uireportedittarget.go new file mode 100644 index 00000000..045afddf --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uireportedittarget.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The A2UIReportEditTarget message. +type A2UIReportEditTarget struct { + // Present after this edit result has been durably applied. + AppliedRunID *string `json:"appliedRunId,omitempty"` + // The expectedProgramId field. + ExpectedProgramID *string `json:"expectedProgramId,omitempty"` + // The reportId field. + ReportID *string `json:"reportId,omitempty"` +} + +func (a *A2UIReportEditTarget) GetAppliedRunID() *string { + if a == nil { + return nil + } + return a.AppliedRunID +} + +func (a *A2UIReportEditTarget) GetExpectedProgramID() *string { + if a == nil { + return nil + } + return a.ExpectedProgramID +} + +func (a *A2UIReportEditTarget) GetReportID() *string { + if a == nil { + return nil + } + return a.ReportID +} + +// #region class-body-a2uireportedittarget +// #endregion class-body-a2uireportedittarget diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiservicegetsurfaceprovenanceresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiservicegetsurfaceprovenanceresponse.go new file mode 100644 index 00000000..0278e407 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uiservicegetsurfaceprovenanceresponse.go @@ -0,0 +1,126 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// A2UIServiceGetSurfaceProvenanceResponse returns what a surface was built +// +// from: the steps its program ran, and the sources its components report. +type A2UIServiceGetSurfaceProvenanceResponse struct { + // The program's identity: code mode invokes by explicit commit, so the commit + // — not the function — is what a refresh re-executes. + ProgramCommitID *string `json:"programCommitId,omitempty"` + // The program that produced a reporting surface. Flat rather than a nested + // ref: these five fields are read together by one drawer and nothing else, + // and a saved report's ProgramRef is the type worth converging on later. + // All empty for a surface carrying no report components, and for reports + // emitted before the report-program requirement was enabled for the tenant. + ProgramFunctionID *string `json:"programFunctionId,omitempty"` + // The JSON parameters the program ran with. Empty when the invocation has aged + // out of retention. + ProgramInput *string `json:"programInput,omitempty"` + // The run that produced this surface. + ProgramInvocationID *string `json:"programInvocationId,omitempty"` + // The program's source, read from the pinned commit. Empty when the commit has + // aged out of code-mode retention — the report still renders, but what + // produced it is no longer recoverable. + ProgramSource *string `json:"programSource,omitempty"` + // The sources field. + Sources []A2UIProvenanceSource `json:"sources,omitempty"` + // Whether the caller may see the ids each step named. False withholds every + // A2UIProvenanceStep.objects on the same boundary that withholds + // program_source: those ids are the program's parameters by another name. + StepObjectsVisible *bool `json:"stepObjectsVisible,omitempty"` + // Everything the surface's program did, in the order it does it. + Steps []A2UIProvenanceStep `json:"steps,omitempty"` + // False when neither the pinned program nor the conversation transcript could + // be read, so no record of what was looked at survives. Distinguishes that + // from a record that was read and genuinely contains no steps. + StepsAvailable *bool `json:"stepsAvailable,omitempty"` + // Deprecated: raw tool names, superseded by steps. Still populated for + // clients on the previous shape. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + ToolCalls []A2UIProvenanceToolCall `json:"toolCalls,omitempty"` + // False when the backing session or its transcript steps are gone. + TranscriptAvailable *bool `json:"transcriptAvailable,omitempty"` +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetProgramCommitID() *string { + if a == nil { + return nil + } + return a.ProgramCommitID +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetProgramFunctionID() *string { + if a == nil { + return nil + } + return a.ProgramFunctionID +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetProgramInput() *string { + if a == nil { + return nil + } + return a.ProgramInput +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetProgramInvocationID() *string { + if a == nil { + return nil + } + return a.ProgramInvocationID +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetProgramSource() *string { + if a == nil { + return nil + } + return a.ProgramSource +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetSources() []A2UIProvenanceSource { + if a == nil { + return nil + } + return a.Sources +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetStepObjectsVisible() *bool { + if a == nil { + return nil + } + return a.StepObjectsVisible +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetSteps() []A2UIProvenanceStep { + if a == nil { + return nil + } + return a.Steps +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetStepsAvailable() *bool { + if a == nil { + return nil + } + return a.StepsAvailable +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetToolCalls() []A2UIProvenanceToolCall { + if a == nil { + return nil + } + return a.ToolCalls +} + +func (a *A2UIServiceGetSurfaceProvenanceResponse) GetTranscriptAvailable() *bool { + if a == nil { + return nil + } + return a.TranscriptAvailable +} + +// #region class-body-a2uiservicegetsurfaceprovenanceresponse +// #endregion class-body-a2uiservicegetsurfaceprovenanceresponse diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uisurface.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uisurface.go index 8d1133ec..a70810f4 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uisurface.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/a2uisurface.go @@ -69,6 +69,10 @@ type A2UISurface struct { // The dataModelJson field. DataModelJSON *string `json:"dataModelJson,omitempty"` DeletedAt *time.Time `json:"deletedAt,omitempty"` + // True when this surface has executable report source behind it. The client + // needs only saveability; scratch Function and commit identities stay private. + HasReportProgram *bool `json:"hasReportProgram,omitempty"` + ReportEditTarget *A2UIReportEditTarget `json:"reportEditTarget,omitempty"` // The role field. Role *A2UISurfaceRole `json:"role,omitempty"` // The schemaVersion field. @@ -137,6 +141,20 @@ func (a *A2UISurface) GetDeletedAt() *time.Time { return a.DeletedAt } +func (a *A2UISurface) GetHasReportProgram() *bool { + if a == nil { + return nil + } + return a.HasReportProgram +} + +func (a *A2UISurface) GetReportEditTarget() *A2UIReportEditTarget { + if a == nil { + return nil + } + return a.ReportEditTarget +} + func (a *A2UISurface) GetRole() *A2UISurfaceRole { if a == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewactionsservicegeneratereportrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewactionsservicegeneratereportrequest.go new file mode 100644 index 00000000..f9a121bd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewactionsservicegeneratereportrequest.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// Format - Output format for the report. When unspecified, programmatic public-API +// +// callers (REST gateway and MCP) get JSON and the in-app UI gets XLSX. JSON +// and CSV return the per-decision certification rows; XLSX returns the full +// multi-sheet Excel workbook. +type Format string + +const ( + FormatAccessReviewReportFormatUnspecified Format = "ACCESS_REVIEW_REPORT_FORMAT_UNSPECIFIED" + FormatAccessReviewReportFormatXlsx Format = "ACCESS_REVIEW_REPORT_FORMAT_XLSX" + FormatAccessReviewReportFormatJSON Format = "ACCESS_REVIEW_REPORT_FORMAT_JSON" + FormatAccessReviewReportFormatCsv Format = "ACCESS_REVIEW_REPORT_FORMAT_CSV" +) + +func (e Format) ToPointer() *Format { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Format) IsExact() bool { + if e != nil { + switch *e { + case "ACCESS_REVIEW_REPORT_FORMAT_UNSPECIFIED", "ACCESS_REVIEW_REPORT_FORMAT_XLSX", "ACCESS_REVIEW_REPORT_FORMAT_JSON", "ACCESS_REVIEW_REPORT_FORMAT_CSV": + return true + } + } + return false +} + +// The AccessReviewActionsServiceGenerateReportRequest message. +type AccessReviewActionsServiceGenerateReportRequest struct { + // Output format for the report. When unspecified, programmatic public-API + // callers (REST gateway and MCP) get JSON and the in-app UI gets XLSX. JSON + // and CSV return the per-decision certification rows; XLSX returns the full + // multi-sheet Excel workbook. + Format *Format `json:"format,omitempty"` + ReportColumnConfig *AccessReviewReportColumnConfig `json:"reportColumnConfig,omitempty"` +} + +func (a *AccessReviewActionsServiceGenerateReportRequest) GetFormat() *Format { + if a == nil { + return nil + } + return a.Format +} + +func (a *AccessReviewActionsServiceGenerateReportRequest) GetReportColumnConfig() *AccessReviewReportColumnConfig { + if a == nil { + return nil + } + return a.ReportColumnConfig +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewactionsservicegeneratereportresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewactionsservicegeneratereportresponse.go new file mode 100644 index 00000000..fbfeb4d3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewactionsservicegeneratereportresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AccessReviewActionsServiceGenerateReportResponse message. +type AccessReviewActionsServiceGenerateReportResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewcolumnconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewcolumnconfig.go index 2cd33210..7fb8ad59 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewcolumnconfig.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewcolumnconfig.go @@ -55,9 +55,15 @@ func (e *Columns) IsExact() bool { // AccessReviewColumnConfig - Configuration for which columns are visible in the reviewer task list. type AccessReviewColumnConfig struct { - // Ordered list of columns visible to reviewers. - // If empty, the default column set for the campaign's default_view is used. + // Deprecated: use `ordered_columns`, which can also include app user + // attribute columns. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. Columns []Columns `json:"columns,omitempty"` + // Ordered columns visible to reviewers, built-ins and attributes + // interleaved. Falls back to `columns`, then to the default set for the + // campaign's default_view. + OrderedColumns []AccessReviewTaskColumnRef `json:"orderedColumns,omitempty"` } func (a *AccessReviewColumnConfig) GetColumns() []Columns { @@ -66,3 +72,10 @@ func (a *AccessReviewColumnConfig) GetColumns() []Columns { } return a.Columns } + +func (a *AccessReviewColumnConfig) GetOrderedColumns() []AccessReviewTaskColumnRef { + if a == nil { + return nil + } + return a.OrderedColumns +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreport.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreport.go new file mode 100644 index 00000000..0352c3e0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreport.go @@ -0,0 +1,135 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// AccessReviewReportFormat - Output format of the generated file (XLSX / JSON / CSV). +type AccessReviewReportFormat string + +const ( + AccessReviewReportFormatAccessReviewReportFormatUnspecified AccessReviewReportFormat = "ACCESS_REVIEW_REPORT_FORMAT_UNSPECIFIED" + AccessReviewReportFormatAccessReviewReportFormatXlsx AccessReviewReportFormat = "ACCESS_REVIEW_REPORT_FORMAT_XLSX" + AccessReviewReportFormatAccessReviewReportFormatJSON AccessReviewReportFormat = "ACCESS_REVIEW_REPORT_FORMAT_JSON" + AccessReviewReportFormatAccessReviewReportFormatCsv AccessReviewReportFormat = "ACCESS_REVIEW_REPORT_FORMAT_CSV" +) + +func (e AccessReviewReportFormat) ToPointer() *AccessReviewReportFormat { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AccessReviewReportFormat) IsExact() bool { + if e != nil { + switch *e { + case "ACCESS_REVIEW_REPORT_FORMAT_UNSPECIFIED", "ACCESS_REVIEW_REPORT_FORMAT_XLSX", "ACCESS_REVIEW_REPORT_FORMAT_JSON", "ACCESS_REVIEW_REPORT_FORMAT_CSV": + return true + } + } + return false +} + +// AccessReviewReportState - The state field. +type AccessReviewReportState string + +const ( + AccessReviewReportStateReportStateUnspecified AccessReviewReportState = "REPORT_STATE_UNSPECIFIED" + AccessReviewReportStateReportStatePending AccessReviewReportState = "REPORT_STATE_PENDING" + AccessReviewReportStateReportStateOk AccessReviewReportState = "REPORT_STATE_OK" + AccessReviewReportStateReportStateError AccessReviewReportState = "REPORT_STATE_ERROR" +) + +func (e AccessReviewReportState) ToPointer() *AccessReviewReportState { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AccessReviewReportState) IsExact() bool { + if e != nil { + switch *e { + case "REPORT_STATE_UNSPECIFIED", "REPORT_STATE_PENDING", "REPORT_STATE_OK", "REPORT_STATE_ERROR": + return true + } + } + return false +} + +// The AccessReviewReport message. +type AccessReviewReport struct { + // The accessReviewId field. + AccessReviewID *string `json:"accessReviewId,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The downloadUrl field. + DownloadURL *string `json:"downloadUrl,omitempty"` + // Output format of the generated file (XLSX / JSON / CSV). + Format *AccessReviewReportFormat `json:"format,omitempty"` + // The hashes field. + Hashes map[string]string `json:"hashes,omitempty"` + // The id field. + ID *string `json:"id,omitempty"` + // The state field. + State *AccessReviewReportState `json:"state,omitempty"` +} + +func (a AccessReviewReport) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccessReviewReport) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AccessReviewReport) GetAccessReviewID() *string { + if a == nil { + return nil + } + return a.AccessReviewID +} + +func (a *AccessReviewReport) GetCreatedAt() *time.Time { + if a == nil { + return nil + } + return a.CreatedAt +} + +func (a *AccessReviewReport) GetDownloadURL() *string { + if a == nil { + return nil + } + return a.DownloadURL +} + +func (a *AccessReviewReport) GetFormat() *AccessReviewReportFormat { + if a == nil { + return nil + } + return a.Format +} + +func (a *AccessReviewReport) GetHashes() map[string]string { + if a == nil { + return nil + } + return a.Hashes +} + +func (a *AccessReviewReport) GetID() *string { + if a == nil { + return nil + } + return a.ID +} + +func (a *AccessReviewReport) GetState() *AccessReviewReportState { + if a == nil { + return nil + } + return a.State +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreportcolumnconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreportcolumnconfig.go new file mode 100644 index 00000000..8de38c00 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreportcolumnconfig.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +type AccessReviewReportColumnConfigColumns string + +const ( + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnUnspecified AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_UNSPECIFIED" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnEmployeeID AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_EMPLOYEE_ID" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnJobTitle AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_JOB_TITLE" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnDepartment AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_DEPARTMENT" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnEmploymentStatus AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_EMPLOYMENT_STATUS" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnEmploymentType AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_EMPLOYMENT_TYPE" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnManager AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_MANAGER" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnTask AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_TASK" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnAccount AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_ACCOUNT" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnUserName AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_USER_NAME" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnIdentityType AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_IDENTITY_TYPE" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnAccountOwner AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_ACCOUNT_OWNER" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnAccountOwnerEmail AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_ACCOUNT_OWNER_EMAIL" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnApplication AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_APPLICATION" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnResource AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_RESOURCE" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnResourceType AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_RESOURCE_TYPE" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnEntitlement AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_ENTITLEMENT" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnDescription AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_DESCRIPTION" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnCertificationPolicy AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_CERTIFICATION_POLICY" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnAssignedTo AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_ASSIGNED_TO" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnReassignments AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_REASSIGNMENTS" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnCertifiers AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_CERTIFIERS" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnDecisions AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_DECISIONS" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnResolvedOn AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_RESOLVED_ON" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnComments AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_COMMENTS" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnLastLogin AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_LAST_LOGIN" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnSubmissions AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_SUBMISSIONS" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnExternalTicket AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_EXTERNAL_TICKET" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnExternalTicketStatus AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_EXTERNAL_TICKET_STATUS" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnSubjectUsername AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_SUBJECT_USERNAME" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnAppAccountStatus AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_APP_ACCOUNT_STATUS" + AccessReviewReportColumnConfigColumnsAccessReviewReportColumnAccountOwnerAccountStatus AccessReviewReportColumnConfigColumns = "ACCESS_REVIEW_REPORT_COLUMN_ACCOUNT_OWNER_ACCOUNT_STATUS" +) + +func (e AccessReviewReportColumnConfigColumns) ToPointer() *AccessReviewReportColumnConfigColumns { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AccessReviewReportColumnConfigColumns) IsExact() bool { + if e != nil { + switch *e { + case "ACCESS_REVIEW_REPORT_COLUMN_UNSPECIFIED", "ACCESS_REVIEW_REPORT_COLUMN_EMPLOYEE_ID", "ACCESS_REVIEW_REPORT_COLUMN_JOB_TITLE", "ACCESS_REVIEW_REPORT_COLUMN_DEPARTMENT", "ACCESS_REVIEW_REPORT_COLUMN_EMPLOYMENT_STATUS", "ACCESS_REVIEW_REPORT_COLUMN_EMPLOYMENT_TYPE", "ACCESS_REVIEW_REPORT_COLUMN_MANAGER", "ACCESS_REVIEW_REPORT_COLUMN_TASK", "ACCESS_REVIEW_REPORT_COLUMN_ACCOUNT", "ACCESS_REVIEW_REPORT_COLUMN_USER_NAME", "ACCESS_REVIEW_REPORT_COLUMN_IDENTITY_TYPE", "ACCESS_REVIEW_REPORT_COLUMN_ACCOUNT_OWNER", "ACCESS_REVIEW_REPORT_COLUMN_ACCOUNT_OWNER_EMAIL", "ACCESS_REVIEW_REPORT_COLUMN_APPLICATION", "ACCESS_REVIEW_REPORT_COLUMN_RESOURCE", "ACCESS_REVIEW_REPORT_COLUMN_RESOURCE_TYPE", "ACCESS_REVIEW_REPORT_COLUMN_ENTITLEMENT", "ACCESS_REVIEW_REPORT_COLUMN_DESCRIPTION", "ACCESS_REVIEW_REPORT_COLUMN_CERTIFICATION_POLICY", "ACCESS_REVIEW_REPORT_COLUMN_ASSIGNED_TO", "ACCESS_REVIEW_REPORT_COLUMN_REASSIGNMENTS", "ACCESS_REVIEW_REPORT_COLUMN_CERTIFIERS", "ACCESS_REVIEW_REPORT_COLUMN_DECISIONS", "ACCESS_REVIEW_REPORT_COLUMN_RESOLVED_ON", "ACCESS_REVIEW_REPORT_COLUMN_COMMENTS", "ACCESS_REVIEW_REPORT_COLUMN_LAST_LOGIN", "ACCESS_REVIEW_REPORT_COLUMN_SUBMISSIONS", "ACCESS_REVIEW_REPORT_COLUMN_EXTERNAL_TICKET", "ACCESS_REVIEW_REPORT_COLUMN_EXTERNAL_TICKET_STATUS", "ACCESS_REVIEW_REPORT_COLUMN_SUBJECT_USERNAME", "ACCESS_REVIEW_REPORT_COLUMN_APP_ACCOUNT_STATUS", "ACCESS_REVIEW_REPORT_COLUMN_ACCOUNT_OWNER_ACCOUNT_STATUS": + return true + } + } + return false +} + +// AccessReviewReportColumnConfig - Configuration for columns in the generated access review Excel report. +type AccessReviewReportColumnConfig struct { + // Ordered list of columns to include in the report's "Access Reviews" sheet. + // When non-empty, the report renders exactly these columns in the order given. + // When empty, the default column set is used (the original 19 columns without + // Employee ID or other user-attribute extras). + Columns []AccessReviewReportColumnConfigColumns `json:"columns,omitempty"` +} + +func (a *AccessReviewReportColumnConfig) GetColumns() []AccessReviewReportColumnConfigColumns { + if a == nil { + return nil + } + return a.Columns +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreportservicelistresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreportservicelistresponse.go new file mode 100644 index 00000000..5ae0c699 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewreportservicelistresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AccessReviewReportServiceListResponse message. +type AccessReviewReportServiceListResponse struct { + // The list field. + List []AccessReviewReport `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (a *AccessReviewReportServiceListResponse) GetList() []AccessReviewReport { + if a == nil { + return nil + } + return a.List +} + +func (a *AccessReviewReportServiceListResponse) GetNextPageToken() *string { + if a == nil { + return nil + } + return a.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewtaskcolumnref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewtaskcolumnref.go new file mode 100644 index 00000000..974ccca0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewtaskcolumnref.go @@ -0,0 +1,91 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// Builtin - The builtin field. +// This field is part of the `column` oneof. +// See the documentation for `c1.api.accessreview.v1.AccessReviewTaskColumnRef` for more details. +type Builtin string + +const ( + BuiltinAccessReviewTaskColumnUnspecified Builtin = "ACCESS_REVIEW_TASK_COLUMN_UNSPECIFIED" + BuiltinAccessReviewTaskColumnViewLink Builtin = "ACCESS_REVIEW_TASK_COLUMN_VIEW_LINK" + BuiltinAccessReviewTaskColumnCurrentState Builtin = "ACCESS_REVIEW_TASK_COLUMN_CURRENT_STATE" + BuiltinAccessReviewTaskColumnAccount Builtin = "ACCESS_REVIEW_TASK_COLUMN_ACCOUNT" + BuiltinAccessReviewTaskColumnAccountOwner Builtin = "ACCESS_REVIEW_TASK_COLUMN_ACCOUNT_OWNER" + BuiltinAccessReviewTaskColumnEntitlement Builtin = "ACCESS_REVIEW_TASK_COLUMN_ENTITLEMENT" + BuiltinAccessReviewTaskColumnEntitlementDescription Builtin = "ACCESS_REVIEW_TASK_COLUMN_ENTITLEMENT_DESCRIPTION" + BuiltinAccessReviewTaskColumnResource Builtin = "ACCESS_REVIEW_TASK_COLUMN_RESOURCE" + BuiltinAccessReviewTaskColumnResourceType Builtin = "ACCESS_REVIEW_TASK_COLUMN_RESOURCE_TYPE" + BuiltinAccessReviewTaskColumnInsights Builtin = "ACCESS_REVIEW_TASK_COLUMN_INSIGHTS" + BuiltinAccessReviewTaskColumnRecommendation Builtin = "ACCESS_REVIEW_TASK_COLUMN_RECOMMENDATION" + BuiltinAccessReviewTaskColumnAssignedTo Builtin = "ACCESS_REVIEW_TASK_COLUMN_ASSIGNED_TO" + BuiltinAccessReviewTaskColumnStatus Builtin = "ACCESS_REVIEW_TASK_COLUMN_STATUS" + BuiltinAccessReviewTaskColumnApp Builtin = "ACCESS_REVIEW_TASK_COLUMN_APP" + BuiltinAccessReviewTaskColumnDue Builtin = "ACCESS_REVIEW_TASK_COLUMN_DUE" + BuiltinAccessReviewTaskColumnProject Builtin = "ACCESS_REVIEW_TASK_COLUMN_PROJECT" + BuiltinAccessReviewTaskColumnCreatedOn Builtin = "ACCESS_REVIEW_TASK_COLUMN_CREATED_ON" + BuiltinAccessReviewTaskColumnTaskAge Builtin = "ACCESS_REVIEW_TASK_COLUMN_TASK_AGE" + BuiltinAccessReviewTaskColumnResolvedOn Builtin = "ACCESS_REVIEW_TASK_COLUMN_RESOLVED_ON" + BuiltinAccessReviewTaskColumnEnrollmentStatus Builtin = "ACCESS_REVIEW_TASK_COLUMN_ENROLLMENT_STATUS" + BuiltinAccessReviewTaskColumnInheritedFrom Builtin = "ACCESS_REVIEW_TASK_COLUMN_INHERITED_FROM" + BuiltinAccessReviewTaskColumnDepartment Builtin = "ACCESS_REVIEW_TASK_COLUMN_DEPARTMENT" + BuiltinAccessReviewTaskColumnJobTitle Builtin = "ACCESS_REVIEW_TASK_COLUMN_JOB_TITLE" + BuiltinAccessReviewTaskColumnCreatedBy Builtin = "ACCESS_REVIEW_TASK_COLUMN_CREATED_BY" + BuiltinAccessReviewTaskColumnLastLogin Builtin = "ACCESS_REVIEW_TASK_COLUMN_LAST_LOGIN" + BuiltinAccessReviewTaskColumnResourceParent Builtin = "ACCESS_REVIEW_TASK_COLUMN_RESOURCE_PARENT" + BuiltinAccessReviewTaskColumnResourceChildren Builtin = "ACCESS_REVIEW_TASK_COLUMN_RESOURCE_CHILDREN" + BuiltinAccessReviewTaskColumnAppUserUsername Builtin = "ACCESS_REVIEW_TASK_COLUMN_APP_USER_USERNAME" + BuiltinAccessReviewTaskColumnAccessHolderType Builtin = "ACCESS_REVIEW_TASK_COLUMN_ACCESS_HOLDER_TYPE" + BuiltinAccessReviewTaskColumnRiskLevel Builtin = "ACCESS_REVIEW_TASK_COLUMN_RISK_LEVEL" + BuiltinAccessReviewTaskColumnComplianceFramework Builtin = "ACCESS_REVIEW_TASK_COLUMN_COMPLIANCE_FRAMEWORK" +) + +func (e Builtin) ToPointer() *Builtin { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Builtin) IsExact() bool { + if e != nil { + switch *e { + case "ACCESS_REVIEW_TASK_COLUMN_UNSPECIFIED", "ACCESS_REVIEW_TASK_COLUMN_VIEW_LINK", "ACCESS_REVIEW_TASK_COLUMN_CURRENT_STATE", "ACCESS_REVIEW_TASK_COLUMN_ACCOUNT", "ACCESS_REVIEW_TASK_COLUMN_ACCOUNT_OWNER", "ACCESS_REVIEW_TASK_COLUMN_ENTITLEMENT", "ACCESS_REVIEW_TASK_COLUMN_ENTITLEMENT_DESCRIPTION", "ACCESS_REVIEW_TASK_COLUMN_RESOURCE", "ACCESS_REVIEW_TASK_COLUMN_RESOURCE_TYPE", "ACCESS_REVIEW_TASK_COLUMN_INSIGHTS", "ACCESS_REVIEW_TASK_COLUMN_RECOMMENDATION", "ACCESS_REVIEW_TASK_COLUMN_ASSIGNED_TO", "ACCESS_REVIEW_TASK_COLUMN_STATUS", "ACCESS_REVIEW_TASK_COLUMN_APP", "ACCESS_REVIEW_TASK_COLUMN_DUE", "ACCESS_REVIEW_TASK_COLUMN_PROJECT", "ACCESS_REVIEW_TASK_COLUMN_CREATED_ON", "ACCESS_REVIEW_TASK_COLUMN_TASK_AGE", "ACCESS_REVIEW_TASK_COLUMN_RESOLVED_ON", "ACCESS_REVIEW_TASK_COLUMN_ENROLLMENT_STATUS", "ACCESS_REVIEW_TASK_COLUMN_INHERITED_FROM", "ACCESS_REVIEW_TASK_COLUMN_DEPARTMENT", "ACCESS_REVIEW_TASK_COLUMN_JOB_TITLE", "ACCESS_REVIEW_TASK_COLUMN_CREATED_BY", "ACCESS_REVIEW_TASK_COLUMN_LAST_LOGIN", "ACCESS_REVIEW_TASK_COLUMN_RESOURCE_PARENT", "ACCESS_REVIEW_TASK_COLUMN_RESOURCE_CHILDREN", "ACCESS_REVIEW_TASK_COLUMN_APP_USER_USERNAME", "ACCESS_REVIEW_TASK_COLUMN_ACCESS_HOLDER_TYPE", "ACCESS_REVIEW_TASK_COLUMN_RISK_LEVEL", "ACCESS_REVIEW_TASK_COLUMN_COMPLIANCE_FRAMEWORK": + return true + } + } + return false +} + +// AccessReviewTaskColumnRef - One column in the reviewer task list: a built-in column, or an app user +// +// profile attribute. An attribute only renders for apps whose +// reviewer_attribute_config permits it — that config is the authorization, +// this is the view preference. +// +// This message contains a oneof named column. Only a single field of the following list may be set at a time: +// - builtin +// - appUserAttributeKey +type AccessReviewTaskColumnRef struct { + // The appUserAttributeKey field. + // This field is part of the `column` oneof. + // See the documentation for `c1.api.accessreview.v1.AccessReviewTaskColumnRef` for more details. + AppUserAttributeKey *string `json:"appUserAttributeKey,omitempty"` + // The builtin field. + // This field is part of the `column` oneof. + // See the documentation for `c1.api.accessreview.v1.AccessReviewTaskColumnRef` for more details. + Builtin *Builtin `json:"builtin,omitempty"` +} + +func (a *AccessReviewTaskColumnRef) GetAppUserAttributeKey() *string { + if a == nil { + return nil + } + return a.AppUserAttributeKey +} + +func (a *AccessReviewTaskColumnRef) GetBuiltin() *Builtin { + if a == nil { + return nil + } + return a.Builtin +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewtemplate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewtemplate.go index b852121d..e76a9eaa 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewtemplate.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/accessreviewtemplate.go @@ -115,6 +115,7 @@ func (e *AccessReviewTemplateScopeType) IsExact() bool { // // This message contains a oneof named slack_channel_details. Only a single field of the following list may be set at a time: // - slackChannel +// - msTeamsChannel type AccessReviewTemplate struct { AccessReviewDuration *string `json:"accessReviewDuration,omitempty"` // The accuracyIssueAction field. @@ -154,6 +155,7 @@ type AccessReviewTemplate struct { InclusionScope *AccessReviewInclusionScope `json:"inclusionScope,omitempty"` // Whether automatic campaign creation on the recurrence schedule is enabled. IsCampaignScheduleEnabled *bool `json:"isCampaignScheduleEnabled,omitempty"` + MsTeamsChannel *MSTeamsChannel `json:"msTeamsChannel,omitempty"` NextScheduledCampaignAt *time.Time `json:"nextScheduledCampaignAt,omitempty"` NotificationConfig *NotificationConfig `json:"notificationConfig,omitempty"` // The number of campaigns that have been created from this template. @@ -304,6 +306,13 @@ func (a *AccessReviewTemplate) GetIsCampaignScheduleEnabled() *bool { return a.IsCampaignScheduleEnabled } +func (a *AccessReviewTemplate) GetMsTeamsChannel() *MSTeamsChannel { + if a == nil { + return nil + } + return a.MsTeamsChannel +} + func (a *AccessReviewTemplate) GetNextScheduledCampaignAt() *time.Time { if a == nil { return nil @@ -401,6 +410,7 @@ func (a *AccessReviewTemplate) GetUsePolicyOverride() *bool { // // This message contains a oneof named slack_channel_details. Only a single field of the following list may be set at a time: // - slackChannel +// - msTeamsChannel type AccessReviewTemplateInput struct { AccessReviewDuration *string `json:"accessReviewDuration,omitempty"` // The accuracyIssueAction field. @@ -438,6 +448,7 @@ type AccessReviewTemplateInput struct { InclusionScope *AccessReviewInclusionScope `json:"inclusionScope,omitempty"` // Whether automatic campaign creation on the recurrence schedule is enabled. IsCampaignScheduleEnabled *bool `json:"isCampaignScheduleEnabled,omitempty"` + MsTeamsChannel *MSTeamsChannel `json:"msTeamsChannel,omitempty"` NextScheduledCampaignAt *time.Time `json:"nextScheduledCampaignAt,omitempty"` NotificationConfig *NotificationConfig `json:"notificationConfig,omitempty"` // The number of campaigns that have been created from this template. @@ -573,6 +584,13 @@ func (a *AccessReviewTemplateInput) GetIsCampaignScheduleEnabled() *bool { return a.IsCampaignScheduleEnabled } +func (a *AccessReviewTemplateInput) GetMsTeamsChannel() *MSTeamsChannel { + if a == nil { + return nil + } + return a.MsTeamsChannel +} + func (a *AccessReviewTemplateInput) GetNextScheduledCampaignAt() *time.Time { if a == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/aigovernancesettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/aigovernancesettings.go index e4b83848..a60dc93e 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/aigovernancesettings.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/aigovernancesettings.go @@ -139,8 +139,14 @@ type AIGovernanceSettings struct { // describe entrypoint. Invoking such a tool opens (or reuses) an // access-request ticket and returns a request_created envelope instead of // executing. Defaults to true. - SurfaceRequestableTools *bool `json:"surfaceRequestableTools,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + SurfaceRequestableTools *bool `json:"surfaceRequestableTools,omitempty"` + // When true, the A2 (untrusted-content) judge is skipped and the untrusted + // dimension always scores LOW. When false (the default), the judge scores + // agent turn input and tool output for prompt-injection risk on every turn. + // + // Defaults to false, so the judge runs by default. + UntrustedJudgeDisable *bool `json:"untrustedJudgeDisable,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` } func (a AIGovernanceSettings) MarshalJSON() ([]byte, error) { @@ -252,6 +258,13 @@ func (a *AIGovernanceSettings) GetSurfaceRequestableTools() *bool { return a.SurfaceRequestableTools } +func (a *AIGovernanceSettings) GetUntrustedJudgeDisable() *bool { + if a == nil { + return nil + } + return a.UntrustedJudgeDisable +} + func (a *AIGovernanceSettings) GetUpdatedAt() *time.Time { if a == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/app.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/app.go index ebd33735..7dabae0c 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/app.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/app.go @@ -110,7 +110,8 @@ type App struct { // The isManuallyManaged field. IsManuallyManaged *bool `json:"isManuallyManaged,omitempty"` // The URL of a logo to display for the app. - LogoURI *string `json:"logoUri,omitempty"` + LogoURI *string `json:"logoUri,omitempty"` + MatchBatonRef *AppMatchBatonRef `json:"matchBatonRef,omitempty"` // The cost of an app per-seat, so that total cost can be calculated by the grant count. MonthlyCostUsd *int `json:"monthlyCostUsd,omitempty"` // The ID of the app that created this app, if any. @@ -298,6 +299,13 @@ func (a *App) GetLogoURI() *string { return a.LogoURI } +func (a *App) GetMatchBatonRef() *AppMatchBatonRef { + if a == nil { + return nil + } + return a.MatchBatonRef +} + func (a *App) GetMonthlyCostUsd() *int { if a == nil { return nil @@ -383,7 +391,8 @@ type AppInput struct { // If you add instructions here, they will be shown to users in the access request form when requesting access for this app. Instructions *string `json:"instructions,omitempty"` // The isManuallyManaged field. - IsManuallyManaged *bool `json:"isManuallyManaged,omitempty"` + IsManuallyManaged *bool `json:"isManuallyManaged,omitempty"` + MatchBatonRef *AppMatchBatonRef `json:"matchBatonRef,omitempty"` // The cost of an app per-seat, so that total cost can be calculated by the grant count. MonthlyCostUsd *int `json:"monthlyCostUsd,omitempty"` // When enabled, revoking a grant also revokes the grants that source it. @@ -492,6 +501,13 @@ func (a *AppInput) GetIsManuallyManaged() *bool { return a.IsManuallyManaged } +func (a *AppInput) GetMatchBatonRef() *AppMatchBatonRef { + if a == nil { + return nil + } + return a.MatchBatonRef +} + func (a *AppInput) GetMonthlyCostUsd() *int { if a == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcap.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcap.go new file mode 100644 index 00000000..df87805f --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcap.go @@ -0,0 +1,65 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// AppCap is one app's tenant-wide ceiling as the API renders it. +type AppCap struct { + // The C1 App the spend is attributed to. + AppID *string `json:"appId,omitempty"` + Controls *SpendControls `json:"controls,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The tenantId field. + TenantID *string `json:"tenantId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (a AppCap) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AppCap) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AppCap) GetAppID() *string { + if a == nil { + return nil + } + return a.AppID +} + +func (a *AppCap) GetControls() *SpendControls { + if a == nil { + return nil + } + return a.Controls +} + +func (a *AppCap) GetCreatedAt() *time.Time { + if a == nil { + return nil + } + return a.CreatedAt +} + +func (a *AppCap) GetTenantID() *string { + if a == nil { + return nil + } + return a.TenantID +} + +func (a *AppCap) GetUpdatedAt() *time.Time { + if a == nil { + return nil + } + return a.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcaphistoryentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcaphistoryentry.go new file mode 100644 index 00000000..87b5152d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcaphistoryentry.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapHistoryEntry message. +type AppCapHistoryEntry struct { + Metadata *HistoryEntryMetadata `json:"metadata,omitempty"` + Snapshot *AppCap `json:"snapshot,omitempty"` +} + +func (a *AppCapHistoryEntry) GetMetadata() *HistoryEntryMetadata { + if a == nil { + return nil + } + return a.Metadata +} + +func (a *AppCapHistoryEntry) GetSnapshot() *AppCap { + if a == nil { + return nil + } + return a.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicedeleterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicedeleterequest.go new file mode 100644 index 00000000..ffeb5c36 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicedeleterequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceDeleteRequest message. +type AppCapServiceDeleteRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicedeleteresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicedeleteresponse.go new file mode 100644 index 00000000..7e90f058 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicedeleteresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceDeleteResponse message. +type AppCapServiceDeleteResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicegetresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicegetresponse.go new file mode 100644 index 00000000..f65ea1d5 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicegetresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceGetResponse message. +type AppCapServiceGetResponse struct { + Cap *AppCap `json:"cap,omitempty"` +} + +func (a *AppCapServiceGetResponse) GetCap() *AppCap { + if a == nil { + return nil + } + return a.Cap +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicelisthistoryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicelisthistoryresponse.go new file mode 100644 index 00000000..318f2227 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicelisthistoryresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceListHistoryResponse message. +type AppCapServiceListHistoryResponse struct { + // The list field. + List []AppCapHistoryEntry `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (a *AppCapServiceListHistoryResponse) GetList() []AppCapHistoryEntry { + if a == nil { + return nil + } + return a.List +} + +func (a *AppCapServiceListHistoryResponse) GetNextPageToken() *string { + if a == nil { + return nil + } + return a.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicelistresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicelistresponse.go new file mode 100644 index 00000000..99c96504 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicelistresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceListResponse message. +type AppCapServiceListResponse struct { + // The list field. + List []AppCap `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (a *AppCapServiceListResponse) GetList() []AppCap { + if a == nil { + return nil + } + return a.List +} + +func (a *AppCapServiceListResponse) GetNextPageToken() *string { + if a == nil { + return nil + } + return a.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesetlimitrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesetlimitrequest.go new file mode 100644 index 00000000..156f111b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesetlimitrequest.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// Period - Optional period override. Only valid together with the limit it denominates. +type Period string + +const ( + PeriodPeriodKindUnspecified Period = "PERIOD_KIND_UNSPECIFIED" + PeriodPeriodKindDaily Period = "PERIOD_KIND_DAILY" + PeriodPeriodKindWeekly Period = "PERIOD_KIND_WEEKLY" + PeriodPeriodKindMonthly Period = "PERIOD_KIND_MONTHLY" + PeriodPeriodKindQuarterly Period = "PERIOD_KIND_QUARTERLY" + PeriodPeriodKindYearly Period = "PERIOD_KIND_YEARLY" +) + +func (e Period) ToPointer() *Period { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Period) IsExact() bool { + if e != nil { + switch *e { + case "PERIOD_KIND_UNSPECIFIED", "PERIOD_KIND_DAILY", "PERIOD_KIND_WEEKLY", "PERIOD_KIND_MONTHLY", "PERIOD_KIND_QUARTERLY", "PERIOD_KIND_YEARLY": + return true + } + } + return false +} + +// The AppCapServiceSetLimitRequest message. +type AppCapServiceSetLimitRequest struct { + Limit *SpendLimit `json:"limit,omitempty"` + // Optional period override. Only valid together with the limit it denominates. + Period *Period `json:"period,omitempty"` +} + +func (a *AppCapServiceSetLimitRequest) GetLimit() *SpendLimit { + if a == nil { + return nil + } + return a.Limit +} + +func (a *AppCapServiceSetLimitRequest) GetPeriod() *Period { + if a == nil { + return nil + } + return a.Period +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesetlimitresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesetlimitresponse.go new file mode 100644 index 00000000..170017c9 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesetlimitresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceSetLimitResponse message. +type AppCapServiceSetLimitResponse struct { + Cap *AppCap `json:"cap,omitempty"` +} + +func (a *AppCapServiceSetLimitResponse) GetCap() *AppCap { + if a == nil { + return nil + } + return a.Cap +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesuspendrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesuspendrequest.go new file mode 100644 index 00000000..a9465975 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesuspendrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceSuspendRequest message. +type AppCapServiceSuspendRequest struct { + // The reason field. + Reason *string `json:"reason,omitempty"` +} + +func (a *AppCapServiceSuspendRequest) GetReason() *string { + if a == nil { + return nil + } + return a.Reason +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesuspendresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesuspendresponse.go new file mode 100644 index 00000000..05e54a68 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapservicesuspendresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceSuspendResponse message. +type AppCapServiceSuspendResponse struct { + Cap *AppCap `json:"cap,omitempty"` +} + +func (a *AppCapServiceSuspendResponse) GetCap() *AppCap { + if a == nil { + return nil + } + return a.Cap +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapserviceunsuspendrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapserviceunsuspendrequest.go new file mode 100644 index 00000000..b1d220b0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapserviceunsuspendrequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceUnsuspendRequest message. +type AppCapServiceUnsuspendRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapserviceunsuspendresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapserviceunsuspendresponse.go new file mode 100644 index 00000000..3a93f86c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appcapserviceunsuspendresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The AppCapServiceUnsuspendResponse message. +type AppCapServiceUnsuspendResponse struct { + Cap *AppCap `json:"cap,omitempty"` +} + +func (a *AppCapServiceUnsuspendResponse) GetCap() *AppCap { + if a == nil { + return nil + } + return a.Cap +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementsearchservicesearchreachableresourcesforuserrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementsearchservicesearchreachableresourcesforuserrequest.go new file mode 100644 index 00000000..224a36be --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementsearchservicesearchreachableresourcesforuserrequest.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// AppEntitlementSearchServiceSearchReachableResourcesForUserRequest - SearchReachableResourcesForUser request. +type AppEntitlementSearchServiceSearchReachableResourcesForUserRequest struct { + // Restrict results to resources belonging to these applications. Empty + // searches across every application the user can reach. + AppIds []string `json:"appIds,omitempty"` + // Maximum number of results to return per page. + PageSize *int `json:"pageSize,omitempty"` + // Token for fetching the next page of results. + PageToken *string `json:"pageToken,omitempty"` + // Fuzzy search over the resource display name. + Query *string `json:"query,omitempty"` + // The user whose reachable resources to search. + UserID *string `json:"userId,omitempty"` +} + +func (a *AppEntitlementSearchServiceSearchReachableResourcesForUserRequest) GetAppIds() []string { + if a == nil { + return nil + } + return a.AppIds +} + +func (a *AppEntitlementSearchServiceSearchReachableResourcesForUserRequest) GetPageSize() *int { + if a == nil { + return nil + } + return a.PageSize +} + +func (a *AppEntitlementSearchServiceSearchReachableResourcesForUserRequest) GetPageToken() *string { + if a == nil { + return nil + } + return a.PageToken +} + +func (a *AppEntitlementSearchServiceSearchReachableResourcesForUserRequest) GetQuery() *string { + if a == nil { + return nil + } + return a.Query +} + +func (a *AppEntitlementSearchServiceSearchReachableResourcesForUserRequest) GetUserID() *string { + if a == nil { + return nil + } + return a.UserID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementsearchservicesearchreachableresourcesforuserresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementsearchservicesearchreachableresourcesforuserresponse.go new file mode 100644 index 00000000..2bc7b5e8 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementsearchservicesearchreachableresourcesforuserresponse.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// AppEntitlementSearchServiceSearchReachableResourcesForUserResponse - SearchReachableResourcesForUser response. Resources are deduplicated: a +// +// resource reachable through more than one grant or entitlement appears once. +type AppEntitlementSearchServiceSearchReachableResourcesForUserResponse struct { + // The reachable resources, one GraphNode (type = GRAPH_NODE_TYPE_RESOURCE) + // per distinct resource. Uses the same node representation as SearchGraph. + List []GraphNode `json:"list,omitempty"` + // Token for fetching the next page of results. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (a *AppEntitlementSearchServiceSearchReachableResourcesForUserResponse) GetList() []GraphNode { + if a == nil { + return nil + } + return a.List +} + +func (a *AppEntitlementSearchServiceSearchReachableResourcesForUserResponse) GetNextPageToken() *string { + if a == nil { + return nil + } + return a.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementuserbindinghistory.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementuserbindinghistory.go index 535c58f1..f7cdc590 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementuserbindinghistory.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appentitlementuserbindinghistory.go @@ -16,6 +16,8 @@ type AppEntitlementUserBindingHistory struct { // The ID of the app user that has access to the app entitlement AppUserID *string `json:"appUserId,omitempty"` GrantedAt *time.Time `json:"grantedAt,omitempty"` + // The unique ID of this grant history record + ID *string `json:"id,omitempty"` RevokedAt *time.Time `json:"revokedAt,omitempty"` } @@ -58,6 +60,13 @@ func (a *AppEntitlementUserBindingHistory) GetGrantedAt() *time.Time { return a.GrantedAt } +func (a *AppEntitlementUserBindingHistory) GetID() *string { + if a == nil { + return nil + } + return a.ID +} + func (a *AppEntitlementUserBindingHistory) GetRevokedAt() *time.Time { if a == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstate.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstate.go new file mode 100644 index 00000000..98fece5a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstate.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// AppManagedState identifies whether a discovered application is managed. +// +// This message contains a oneof named state. Only a single field of the following list may be set at a time: +// - unmanaged +// - managed +type AppManagedState struct { + Managed *AppManagedStateManaged `json:"managed,omitempty"` + Unmanaged *AppManagedStateUnmanaged `json:"unmanaged,omitempty"` +} + +func (a *AppManagedState) GetManaged() *AppManagedStateManaged { + if a == nil { + return nil + } + return a.Managed +} + +func (a *AppManagedState) GetUnmanaged() *AppManagedStateUnmanaged { + if a == nil { + return nil + } + return a.Unmanaged +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebinding.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebinding.go new file mode 100644 index 00000000..d0422a7e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebinding.go @@ -0,0 +1,91 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// AppManagedStateBinding records whether a connector-discovered application is managed in ConductorOne. +type AppManagedStateBinding struct { + // Application that owns the connector which discovered this application. + AppID *string `json:"appId,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + // Display name of the discovered application. + DisplayName *string `json:"displayName,omitempty"` + // Resource ID of the discovered application. + ResourceID *string `json:"resourceId,omitempty"` + // Resource type used by the connector to represent discovered applications. + ResourceTypeID *string `json:"resourceTypeId,omitempty"` + State *AppManagedState `json:"state,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (a AppManagedStateBinding) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AppManagedStateBinding) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AppManagedStateBinding) GetAppID() *string { + if a == nil { + return nil + } + return a.AppID +} + +func (a *AppManagedStateBinding) GetCreatedAt() *time.Time { + if a == nil { + return nil + } + return a.CreatedAt +} + +func (a *AppManagedStateBinding) GetDeletedAt() *time.Time { + if a == nil { + return nil + } + return a.DeletedAt +} + +func (a *AppManagedStateBinding) GetDisplayName() *string { + if a == nil { + return nil + } + return a.DisplayName +} + +func (a *AppManagedStateBinding) GetResourceID() *string { + if a == nil { + return nil + } + return a.ResourceID +} + +func (a *AppManagedStateBinding) GetResourceTypeID() *string { + if a == nil { + return nil + } + return a.ResourceTypeID +} + +func (a *AppManagedStateBinding) GetState() *AppManagedState { + if a == nil { + return nil + } + return a.State +} + +func (a *AppManagedStateBinding) GetUpdatedAt() *time.Time { + if a == nil { + return nil + } + return a.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingexpandmask.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingexpandmask.go new file mode 100644 index 00000000..3d29b09e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingexpandmask.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// AppManagedStateBindingExpandMask controls which related objects are included in a response. +type AppManagedStateBindingExpandMask struct { + // Related objects to include. Supported values are `app_id`, `resource_id`, and `*`. + Paths []string `json:"paths,omitempty"` +} + +func (a *AppManagedStateBindingExpandMask) GetPaths() []string { + if a == nil { + return nil + } + return a.Paths +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingref.go index d76e28b1..52cecac9 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingref.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingref.go @@ -2,13 +2,13 @@ package shared -// The AppManagedStateBindingRef message. +// AppManagedStateBindingRef identifies an application discovered by a connector. type AppManagedStateBindingRef struct { - // The appId field. + // ID of the application that owns the connector. AppID *string `json:"appId,omitempty"` - // The resourceId field. + // Resource ID of the discovered application. ResourceID *string `json:"resourceId,omitempty"` - // The resourceTypeId field. + // ID of the resource type used for discovered applications. ResourceTypeID *string `json:"resourceTypeId,omitempty"` } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingview.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingview.go new file mode 100644 index 00000000..c696be27 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatebindingview.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// AppManagedStateBindingView contains a managed-state binding and paths to its related objects. +type AppManagedStateBindingView struct { + AppManagementStateBinding *AppManagedStateBinding `json:"appManagementStateBinding,omitempty"` + // Path of the application that owns the connector. + AppPath *string `json:"appPath,omitempty"` + // Path of the connector resource representing the discovered application. + ResourcePath *string `json:"resourcePath,omitempty"` +} + +func (a *AppManagedStateBindingView) GetAppManagementStateBinding() *AppManagedStateBinding { + if a == nil { + return nil + } + return a.AppManagementStateBinding +} + +func (a *AppManagedStateBindingView) GetAppPath() *string { + if a == nil { + return nil + } + return a.AppPath +} + +func (a *AppManagedStateBindingView) GetResourcePath() *string { + if a == nil { + return nil + } + return a.ResourcePath +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatemanaged.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatemanaged.go new file mode 100644 index 00000000..9c176709 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstatemanaged.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// AppManagedStateManaged identifies the application created by promotion. +type AppManagedStateManaged struct { + // ID of the managed application. + AppID *string `json:"appId,omitempty"` +} + +func (a *AppManagedStateManaged) GetAppID() *string { + if a == nil { + return nil + } + return a.AppID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstateunmanaged.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstateunmanaged.go new file mode 100644 index 00000000..1cb6eb00 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmanagedstateunmanaged.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// AppManagedStateUnmanaged indicates that the discovered application has not been promoted. +type AppManagedStateUnmanaged struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmatchbatonref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmatchbatonref.go new file mode 100644 index 00000000..d4c6a85c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appmatchbatonref.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// AppMatchBatonRef identifies the connector application that should adopt a manually-created application during uplift. +type AppMatchBatonRef struct { + // Application that owns the connector. + AppID string `json:"appId"` + // Connector that discovers the application. + ConnectorID string `json:"connectorId"` + // Canonical connector-v2 application resource ID in + // `::` form (for example, `app::0oa123`). + ExternalID string `json:"externalId"` +} + +func (a *AppMatchBatonRef) GetAppID() string { + if a == nil { + return "" + } + return a.AppID +} + +func (a *AppMatchBatonRef) GetConnectorID() string { + if a == nil { + return "" + } + return a.ConnectorID +} + +func (a *AppMatchBatonRef) GetExternalID() string { + if a == nil { + return "" + } + return a.ExternalID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appuser.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appuser.go index 14969b71..d45c6ed1 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appuser.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appuser.go @@ -7,6 +7,34 @@ import ( "time" ) +// AgentStatus - AI-agent lifecycle status when this app user carries the agent trait. +// +// UNSPECIFIED marks a non-agent account. Read-only; translated from the +// model's agent_trait at the API boundary. +type AgentStatus string + +const ( + AgentStatusAppUserAgentStatusUnspecified AgentStatus = "APP_USER_AGENT_STATUS_UNSPECIFIED" + AgentStatusAppUserAgentStatusReady AgentStatus = "APP_USER_AGENT_STATUS_READY" + AgentStatusAppUserAgentStatusDisabled AgentStatus = "APP_USER_AGENT_STATUS_DISABLED" + AgentStatusAppUserAgentStatusDeleted AgentStatus = "APP_USER_AGENT_STATUS_DELETED" +) + +func (e AgentStatus) ToPointer() *AgentStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AgentStatus) IsExact() bool { + if e != nil { + switch *e { + case "APP_USER_AGENT_STATUS_UNSPECIFIED", "APP_USER_AGENT_STATUS_READY", "APP_USER_AGENT_STATUS_DISABLED", "APP_USER_AGENT_STATUS_DELETED": + return true + } + } + return false +} + // AppUserType - The appplication user type. Type can be user, system or service. type AppUserType string @@ -32,8 +60,39 @@ func (e *AppUserType) IsExact() bool { return false } +// AppUserNhiType - NHI classification when this app user carries the non-human-identity trait. +// +// Read-only; translated from the model's nhi_trait at the API boundary. +type AppUserNhiType string + +const ( + AppUserNhiTypeAppUserNhiTypeUnspecified AppUserNhiType = "APP_USER_NHI_TYPE_UNSPECIFIED" + AppUserNhiTypeAppUserNhiTypeAppRegistration AppUserNhiType = "APP_USER_NHI_TYPE_APP_REGISTRATION" + AppUserNhiTypeAppUserNhiTypeAssumableRole AppUserNhiType = "APP_USER_NHI_TYPE_ASSUMABLE_ROLE" + AppUserNhiTypeAppUserNhiTypeManagedIdentity AppUserNhiType = "APP_USER_NHI_TYPE_MANAGED_IDENTITY" +) + +func (e AppUserNhiType) ToPointer() *AppUserNhiType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AppUserNhiType) IsExact() bool { + if e != nil { + switch *e { + case "APP_USER_NHI_TYPE_UNSPECIFIED", "APP_USER_NHI_TYPE_APP_REGISTRATION", "APP_USER_NHI_TYPE_ASSUMABLE_ROLE", "APP_USER_NHI_TYPE_MANAGED_IDENTITY": + return true + } + } + return false +} + // AppUser - Application User that represents an account in the application. type AppUser struct { + // AI-agent lifecycle status when this app user carries the agent trait. + // UNSPECIFIED marks a non-agent account. Read-only; translated from the + // model's agent_trait at the API boundary. + AgentStatus *AgentStatus `json:"agentStatus,omitempty"` // The ID of the application. AppID *string `json:"appId,omitempty"` // The appplication user type. Type can be user, system or service. @@ -53,10 +112,15 @@ type AppUser struct { // The conductor one user ID of the account owner. IdentityUserID *string `json:"identityUserId,omitempty"` // The isExternal field. - IsExternal *bool `json:"isExternal,omitempty"` - Profile map[string]any `json:"profile,omitempty"` - Status *AppUserStatus `json:"status,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + IsExternal *bool `json:"isExternal,omitempty"` + // Axis-2 detail refining nhi_type (e.g. "aws.role.lambda"). Read-only. + NhiDetail *string `json:"nhiDetail,omitempty"` + // NHI classification when this app user carries the non-human-identity trait. + // Read-only; translated from the model's nhi_trait at the API boundary. + NhiType *AppUserNhiType `json:"nhiType,omitempty"` + Profile map[string]any `json:"profile,omitempty"` + Status *AppUserStatus `json:"status,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` // The username field of the application user. Username *string `json:"username,omitempty"` // The usernames field of the application user. @@ -74,6 +138,13 @@ func (a *AppUser) UnmarshalJSON(data []byte) error { return nil } +func (a *AppUser) GetAgentStatus() *AgentStatus { + if a == nil { + return nil + } + return a.AgentStatus +} + func (a *AppUser) GetAppID() *string { if a == nil { return nil @@ -151,6 +222,20 @@ func (a *AppUser) GetIsExternal() *bool { return a.IsExternal } +func (a *AppUser) GetNhiDetail() *string { + if a == nil { + return nil + } + return a.NhiDetail +} + +func (a *AppUser) GetNhiType() *AppUserNhiType { + if a == nil { + return nil + } + return a.NhiType +} + func (a *AppUser) GetProfile() map[string]any { if a == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appuserservicesearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appuserservicesearchrequest.go index 7ed678e5..038d15e1 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appuserservicesearchrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/appuserservicesearchrequest.go @@ -2,6 +2,30 @@ package shared +type AgentStatuses string + +const ( + AgentStatusesAppUserAgentStatusUnspecified AgentStatuses = "APP_USER_AGENT_STATUS_UNSPECIFIED" + AgentStatusesAppUserAgentStatusReady AgentStatuses = "APP_USER_AGENT_STATUS_READY" + AgentStatusesAppUserAgentStatusDisabled AgentStatuses = "APP_USER_AGENT_STATUS_DISABLED" + AgentStatusesAppUserAgentStatusDeleted AgentStatuses = "APP_USER_AGENT_STATUS_DELETED" +) + +func (e AgentStatuses) ToPointer() *AgentStatuses { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AgentStatuses) IsExact() bool { + if e != nil { + switch *e { + case "APP_USER_AGENT_STATUS_UNSPECIFIED", "APP_USER_AGENT_STATUS_READY", "APP_USER_AGENT_STATUS_DISABLED", "APP_USER_AGENT_STATUS_DELETED": + return true + } + } + return false +} + type AppUserDomains string const ( @@ -73,6 +97,30 @@ func (e *AppUserServiceSearchRequestAppUserTypes) IsExact() bool { return false } +type NhiTypes string + +const ( + NhiTypesAppUserNhiTypeUnspecified NhiTypes = "APP_USER_NHI_TYPE_UNSPECIFIED" + NhiTypesAppUserNhiTypeAppRegistration NhiTypes = "APP_USER_NHI_TYPE_APP_REGISTRATION" + NhiTypesAppUserNhiTypeAssumableRole NhiTypes = "APP_USER_NHI_TYPE_ASSUMABLE_ROLE" + NhiTypesAppUserNhiTypeManagedIdentity NhiTypes = "APP_USER_NHI_TYPE_MANAGED_IDENTITY" +) + +func (e NhiTypes) ToPointer() *NhiTypes { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *NhiTypes) IsExact() bool { + if e != nil { + switch *e { + case "APP_USER_NHI_TYPE_UNSPECIFIED", "APP_USER_NHI_TYPE_APP_REGISTRATION", "APP_USER_NHI_TYPE_ASSUMABLE_ROLE", "APP_USER_NHI_TYPE_MANAGED_IDENTITY": + return true + } + } + return false +} + // SortBy - Ordering of the results. Defaults to display-name ordering. type SortBy string @@ -98,6 +146,9 @@ func (e *SortBy) IsExact() bool { // AppUserServiceSearchRequest - Search App users based on filters specified in the request body type AppUserServiceSearchRequest struct { + // Restrict to app users whose agent trait lifecycle status (agent_status) + // matches one of these values. When empty, agent_status is not used as a filter. + AgentStatuses []AgentStatuses `json:"agentStatuses,omitempty"` // The app ID to restrict the search to. AppID *string `json:"appId,omitempty"` // A list of app IDs to restrict the search to. @@ -117,6 +168,9 @@ type AppUserServiceSearchRequest struct { // When true, excludes app users belonging to soft-deleted apps. ExcludeDeletedApps *bool `json:"excludeDeletedApps,omitempty"` ExpandMask *AppUserExpandMask `json:"expandMask,omitempty"` + // Restrict to app users whose NHI trait classification (nhi_type) matches one of + // these values. When empty, nhi_type is not used as a filter. + NhiTypes []NhiTypes `json:"nhiTypes,omitempty"` // The pageSize where 0 <= pageSize <= 100. Values < 10 will be set to 10. A value of 0 returns the default page size (currently 25) PageSize *int `json:"pageSize,omitempty"` // The pageToken field. @@ -137,6 +191,13 @@ type AppUserServiceSearchRequest struct { WithoutResponsibleParty *bool `json:"withoutResponsibleParty,omitempty"` } +func (a *AppUserServiceSearchRequest) GetAgentStatuses() []AgentStatuses { + if a == nil { + return nil + } + return a.AgentStatuses +} + func (a *AppUserServiceSearchRequest) GetAppID() *string { if a == nil { return nil @@ -207,6 +268,13 @@ func (a *AppUserServiceSearchRequest) GetExpandMask() *AppUserExpandMask { return a.ExpandMask } +func (a *AppUserServiceSearchRequest) GetNhiTypes() []NhiTypes { + if a == nil { + return nil + } + return a.NhiTypes +} + func (a *AppUserServiceSearchRequest) GetPageSize() *int { if a == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/blockoutputconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/blockoutputconfig.go new file mode 100644 index 00000000..d3295a50 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/blockoutputconfig.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +type Surfaces string + +const ( + SurfacesHookOutputSurfaceUnspecified Surfaces = "HOOK_OUTPUT_SURFACE_UNSPECIFIED" + SurfacesHookOutputSurfaceSlack Surfaces = "HOOK_OUTPUT_SURFACE_SLACK" + SurfacesHookOutputSurfaceWeb Surfaces = "HOOK_OUTPUT_SURFACE_WEB" +) + +func (e Surfaces) ToPointer() *Surfaces { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Surfaces) IsExact() bool { + if e != nil { + switch *e { + case "HOOK_OUTPUT_SURFACE_UNSPECIFIED", "HOOK_OUTPUT_SURFACE_SLACK", "HOOK_OUTPUT_SURFACE_WEB": + return true + } + } + return false +} + +// BlockOutputConfig denies the in-flight response chunk when its hook's +// +// filter matches. Only valid for HOOK_EVENT_TYPE_PRE_OUTPUT. +type BlockOutputConfig struct { + // Message shown to the user when this hook blocks the response. Empty + // falls back to the curating AgentGuardrailRule's deny_reason, then to a + // generic default. + Message *string `json:"message,omitempty"` + // Output surfaces this hook applies to. Empty means none — the hook is + // inert until at least one surface is explicitly selected. + Surfaces []Surfaces `json:"surfaces,omitempty"` +} + +func (b *BlockOutputConfig) GetMessage() *string { + if b == nil { + return nil + } + return b.Message +} + +func (b *BlockOutputConfig) GetSurfaces() []Surfaces { + if b == nil { + return nil + } + return b.Surfaces +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/blocktoolcallconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/blocktoolcallconfig.go new file mode 100644 index 00000000..8cae484a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/blocktoolcallconfig.go @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// BlockToolCallConfig unconditionally denies the tool call when its hook's +// +// filter matches. Only valid for HOOK_EVENT_TYPE_POST_TOOL_USE. +type BlockToolCallConfig struct { + // Message shown when the tool call is denied. Empty falls back to a + // generic default. + Message *string `json:"message,omitempty"` +} + +func (b *BlockToolCallConfig) GetMessage() *string { + if b == nil { + return nil + } + return b.Message +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/builtinpattern.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/builtinpattern.go index 697af213..7c4bcd37 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/builtinpattern.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/builtinpattern.go @@ -13,15 +13,43 @@ package shared // - writeAuthorization // - sensitiveFileGuard // - toolOutputSizeGuard +// - secretsMasking +// - linkFilter +// - encodedContentGuard +// - promptInjectionScan +// - blockOutput +// - blockToolCall +// - preToolBlock type BuiltInPattern struct { + BlockOutput *BlockOutputConfig `json:"blockOutput,omitempty"` + BlockToolCall *BlockToolCallConfig `json:"blockToolCall,omitempty"` CreditCardBlocking *CreditCardBlockingConfig `json:"creditCardBlocking,omitempty"` + EncodedContentGuard *EncodedContentGuardConfig `json:"encodedContentGuard,omitempty"` + LinkFilter *LinkFilterConfig `json:"linkFilter,omitempty"` PiiRedaction *PIIRedactionConfig `json:"piiRedaction,omitempty"` + PreToolBlock *PreToolBlockConfig `json:"preToolBlock,omitempty"` + PromptInjectionScan *PromptInjectionScanConfig `json:"promptInjectionScan,omitempty"` QueryScopeLimit *QueryScopeLimitConfig `json:"queryScopeLimit,omitempty"` + SecretsMasking *SecretsMaskingConfig `json:"secretsMasking,omitempty"` SensitiveFileGuard *SensitiveFileGuardConfig `json:"sensitiveFileGuard,omitempty"` ToolOutputSizeGuard *ToolOutputSizeGuardConfig `json:"toolOutputSizeGuard,omitempty"` WriteAuthorization *WriteAuthorizationConfig `json:"writeAuthorization,omitempty"` } +func (b *BuiltInPattern) GetBlockOutput() *BlockOutputConfig { + if b == nil { + return nil + } + return b.BlockOutput +} + +func (b *BuiltInPattern) GetBlockToolCall() *BlockToolCallConfig { + if b == nil { + return nil + } + return b.BlockToolCall +} + func (b *BuiltInPattern) GetCreditCardBlocking() *CreditCardBlockingConfig { if b == nil { return nil @@ -29,6 +57,20 @@ func (b *BuiltInPattern) GetCreditCardBlocking() *CreditCardBlockingConfig { return b.CreditCardBlocking } +func (b *BuiltInPattern) GetEncodedContentGuard() *EncodedContentGuardConfig { + if b == nil { + return nil + } + return b.EncodedContentGuard +} + +func (b *BuiltInPattern) GetLinkFilter() *LinkFilterConfig { + if b == nil { + return nil + } + return b.LinkFilter +} + func (b *BuiltInPattern) GetPiiRedaction() *PIIRedactionConfig { if b == nil { return nil @@ -36,6 +78,20 @@ func (b *BuiltInPattern) GetPiiRedaction() *PIIRedactionConfig { return b.PiiRedaction } +func (b *BuiltInPattern) GetPreToolBlock() *PreToolBlockConfig { + if b == nil { + return nil + } + return b.PreToolBlock +} + +func (b *BuiltInPattern) GetPromptInjectionScan() *PromptInjectionScanConfig { + if b == nil { + return nil + } + return b.PromptInjectionScan +} + func (b *BuiltInPattern) GetQueryScopeLimit() *QueryScopeLimitConfig { if b == nil { return nil @@ -43,6 +99,13 @@ func (b *BuiltInPattern) GetQueryScopeLimit() *QueryScopeLimitConfig { return b.QueryScopeLimit } +func (b *BuiltInPattern) GetSecretsMasking() *SecretsMaskingConfig { + if b == nil { + return nil + } + return b.SecretsMasking +} + func (b *BuiltInPattern) GetSensitiveFileGuard() *SensitiveFileGuardConfig { if b == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkassignowneraction.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkassignowneraction.go index 520a29ae..67f33b69 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkassignowneraction.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkassignowneraction.go @@ -4,7 +4,17 @@ package shared // The BulkAssignOwnerAction message. type BulkAssignOwnerAction struct { - Owner *FindingOwnerRef `json:"owner,omitempty"` + // Empty is allowed: rpc.go falls back to the deprecated owner field's + // identity_user_id arm when this is unset. + AssigneeIdentityUserID *string `json:"assigneeIdentityUserId,omitempty"` + Owner *FindingOwnerRef `json:"owner,omitempty"` +} + +func (b *BulkAssignOwnerAction) GetAssigneeIdentityUserID() *string { + if b == nil { + return nil + } + return b.AssigneeIdentityUserID } func (b *BulkAssignOwnerAction) GetOwner() *FindingOwnerRef { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkreprocessaction.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkreprocessaction.go new file mode 100644 index 00000000..c16370a3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkreprocessaction.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// BulkReprocessAction re-evaluates eligible findings against transformation +// +// and routing rules using each finding's original detector-created state +// (original severity, original annotations) rather than any rule-mutated +// current state. +// +// `override_human_edits` chooses how far re-derivation goes for +// human-attributed edits: +// +// - Open findings are re-derived and re-routed in both modes. +// - Findings parked by a rule (snoozed, suppressed, or risk-accepted by a +// routing rule with no subsequent human action) are released to open, +// re-derived, and re-routed in both modes. +// - Findings parked by a person re-derive their content in both modes, but +// the state is only released, and a human severity override only cleared, +// when `override_human_edits` is true. +// - Findings in progress re-derive their content and keep both their state +// and any linked ticket in both modes. +// - Resolved, archived, and deleted findings are skipped in both modes. +// +// Assigned owners and ticket links are never touched; rules do not derive them. +type BulkReprocessAction struct { + // When false (the default), a person's parked state and severity override + // survive the re-derivation. When true, reprocessing additionally releases + // findings a person parked and clears human severity overrides. + OverrideHumanEdits *bool `json:"overrideHumanEdits,omitempty"` + // When true, matched rules may re-send notification dispatches for + // findings your team may have already seen. Off by default. + RunDispatchers *bool `json:"runDispatchers,omitempty"` +} + +func (b *BulkReprocessAction) GetOverrideHumanEdits() *bool { + if b == nil { + return nil + } + return b.OverrideHumanEdits +} + +func (b *BulkReprocessAction) GetRunDispatchers() *bool { + if b == nil { + return nil + } + return b.RunDispatchers +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkupdatefindingstaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkupdatefindingstaterequest.go index 87f97b62..e11d0ea7 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkupdatefindingstaterequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bulkupdatefindingstaterequest.go @@ -11,12 +11,14 @@ package shared // - unsuppress // - assignOwner // - reopen +// - reprocess type BulkUpdateFindingStateRequest struct { AcceptRisk *BulkAcceptRiskAction `json:"acceptRisk,omitempty"` AssignOwner *BulkAssignOwnerAction `json:"assignOwner,omitempty"` // By-ID mode: specify individual finding refs. Refs []FindingRef `json:"refs,omitempty"` Reopen *BulkReopenAction `json:"reopen,omitempty"` + Reprocess *BulkReprocessAction `json:"reprocess,omitempty"` SearchRequest *FindingSearchRequest `json:"searchRequest,omitempty"` Snooze *BulkSnoozeAction `json:"snooze,omitempty"` Suppress *BulkSuppressAction `json:"suppress,omitempty"` @@ -51,6 +53,13 @@ func (b *BulkUpdateFindingStateRequest) GetReopen() *BulkReopenAction { return b.Reopen } +func (b *BulkUpdateFindingStateRequest) GetReprocess() *BulkReprocessAction { + if b == nil { + return nil + } + return b.Reprocess +} + func (b *BulkUpdateFindingStateRequest) GetSearchRequest() *FindingSearchRequest { if b == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bundleautomationref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bundleautomationref.go new file mode 100644 index 00000000..e22f2636 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/bundleautomationref.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The BundleAutomationRef message. +type BundleAutomationRef struct { + // The requestCatalogId field. + RequestCatalogID *string `json:"requestCatalogId,omitempty"` +} + +func (b *BundleAutomationRef) GetRequestCatalogID() *string { + if b == nil { + return nil + } + return b.RequestCatalogID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1metriccard.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1metriccard.go new file mode 100644 index 00000000..c044277c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1metriccard.go @@ -0,0 +1,82 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// DeltaSentiment - The deltaSentiment field. +type DeltaSentiment string + +const ( + DeltaSentimentC1MetricDeltaSentimentUnspecified DeltaSentiment = "C1_METRIC_DELTA_SENTIMENT_UNSPECIFIED" + DeltaSentimentC1MetricDeltaSentimentPositive DeltaSentiment = "C1_METRIC_DELTA_SENTIMENT_POSITIVE" + DeltaSentimentC1MetricDeltaSentimentNegative DeltaSentiment = "C1_METRIC_DELTA_SENTIMENT_NEGATIVE" + DeltaSentimentC1MetricDeltaSentimentNeutral DeltaSentiment = "C1_METRIC_DELTA_SENTIMENT_NEUTRAL" +) + +func (e DeltaSentiment) ToPointer() *DeltaSentiment { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DeltaSentiment) IsExact() bool { + if e != nil { + switch *e { + case "C1_METRIC_DELTA_SENTIMENT_UNSPECIFIED", "C1_METRIC_DELTA_SENTIMENT_POSITIVE", "C1_METRIC_DELTA_SENTIMENT_NEGATIVE", "C1_METRIC_DELTA_SENTIMENT_NEUTRAL": + return true + } + } + return false +} + +// C1MetricCard is one aggregate stat: label, formatted value, optional delta +// +// and sparkline trend. +type C1MetricCard struct { + // The delta field. + Delta *string `json:"delta,omitempty"` + // The deltaSentiment field. + DeltaSentiment *DeltaSentiment `json:"deltaSentiment,omitempty"` + // The label field. + Label *string `json:"label,omitempty"` + // Optional trend values, oldest first. Bounds double as NaN/Inf rejection. + Sparkline []float64 `json:"sparkline,omitempty"` + // The value field. + Value *string `json:"value,omitempty"` +} + +func (c *C1MetricCard) GetDelta() *string { + if c == nil { + return nil + } + return c.Delta +} + +func (c *C1MetricCard) GetDeltaSentiment() *DeltaSentiment { + if c == nil { + return nil + } + return c.DeltaSentiment +} + +func (c *C1MetricCard) GetLabel() *string { + if c == nil { + return nil + } + return c.Label +} + +func (c *C1MetricCard) GetSparkline() []float64 { + if c == nil { + return nil + } + return c.Sparkline +} + +func (c *C1MetricCard) GetValue() *string { + if c == nil { + return nil + } + return c.Value +} + +// #region class-body-c1metriccard +// #endregion class-body-c1metriccard diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1metriccardscomponent.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1metriccardscomponent.go new file mode 100644 index 00000000..a1eb224d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1metriccardscomponent.go @@ -0,0 +1,36 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// C1MetricCardsComponent renders a row of aggregate stat cards. +type C1MetricCardsComponent struct { + // The cards field. + Cards []C1MetricCard `json:"cards,omitempty"` + // Provenance: the queries the producing function ran. + Sources []C1ChartSource `json:"sources,omitempty"` + Title *DynamicString `json:"title,omitempty"` +} + +func (c *C1MetricCardsComponent) GetCards() []C1MetricCard { + if c == nil { + return nil + } + return c.Cards +} + +func (c *C1MetricCardsComponent) GetSources() []C1ChartSource { + if c == nil { + return nil + } + return c.Sources +} + +func (c *C1MetricCardsComponent) GetTitle() *DynamicString { + if c == nil { + return nil + } + return c.Title +} + +// #region class-body-c1metriccardscomponent +// #endregion class-body-c1metriccardscomponent diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1tablecomponent.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1tablecomponent.go new file mode 100644 index 00000000..0fcd7dfb --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1tablecomponent.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" +) + +// C1TableComponent renders a tabular view: typed columns + rows, capped and +// +// paginated client-side; the full data set lives behind the artifact link. +type C1TableComponent struct { + ArtifactURL *DynamicString `json:"artifactUrl,omitempty"` + // The columns field. + Columns []string `json:"columns,omitempty"` + // Rows per page for client-side pagination; 0 shows all rows on one page. + PageSize *int `json:"pageSize,omitempty"` + // The rows field. + Rows []C1TableRow `json:"rows,omitempty"` + // Provenance: the queries the producing function ran. + Sources []C1ChartSource `json:"sources,omitempty"` + Title *DynamicString `json:"title,omitempty"` + // Full count when rows are truncated. + TotalRows *int64 `integer:"string" json:"totalRows,omitempty"` +} + +func (c C1TableComponent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *C1TableComponent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *C1TableComponent) GetArtifactURL() *DynamicString { + if c == nil { + return nil + } + return c.ArtifactURL +} + +func (c *C1TableComponent) GetColumns() []string { + if c == nil { + return nil + } + return c.Columns +} + +func (c *C1TableComponent) GetPageSize() *int { + if c == nil { + return nil + } + return c.PageSize +} + +func (c *C1TableComponent) GetRows() []C1TableRow { + if c == nil { + return nil + } + return c.Rows +} + +func (c *C1TableComponent) GetSources() []C1ChartSource { + if c == nil { + return nil + } + return c.Sources +} + +func (c *C1TableComponent) GetTitle() *DynamicString { + if c == nil { + return nil + } + return c.Title +} + +func (c *C1TableComponent) GetTotalRows() *int64 { + if c == nil { + return nil + } + return c.TotalRows +} + +// #region class-body-c1tablecomponent +// #endregion class-body-c1tablecomponent diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1tablerow.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1tablerow.go new file mode 100644 index 00000000..dc216026 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1tablerow.go @@ -0,0 +1,21 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// C1TableRow is one row; cells align 1:1 with columns (enforced at the +// +// parse boundary). +type C1TableRow struct { + // The cells field. + Cells []string `json:"cells,omitempty"` +} + +func (c *C1TableRow) GetCells() []string { + if c == nil { + return nil + } + return c.Cells +} + +// #region class-body-c1tablerow +// #endregion class-body-c1tablerow diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1userfilter.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1userfilter.go index d3868856..5965a178 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1userfilter.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/c1userfilter.go @@ -6,6 +6,34 @@ package shared // // This is distinct from AppUserFilter which selects accounts within a connected app. type C1UserFilter struct { + // Remove these users from the selectable set, after user_ids is applied. + ExcludeUserIds []string `json:"excludeUserIds,omitempty"` + // Make deactivated and deleted users selectable. Defaults to enabled-only. + IncludeDeactivated *bool `json:"includeDeactivated,omitempty"` + // Restrict the selectable set to these users. Empty means every user is selectable. + // Capped at the number of refs SearchUsers accepts in one request. + UserIds []string `json:"userIds,omitempty"` +} + +func (c *C1UserFilter) GetExcludeUserIds() []string { + if c == nil { + return nil + } + return c.ExcludeUserIds +} + +func (c *C1UserFilter) GetIncludeDeactivated() *bool { + if c == nil { + return nil + } + return c.IncludeDeactivated +} + +func (c *C1UserFilter) GetUserIds() []string { + if c == nil { + return nil + } + return c.UserIds } // #region class-body-c1userfilter diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clearprovidercredentialrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clearprovidercredentialrequest.go new file mode 100644 index 00000000..2b727b61 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clearprovidercredentialrequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ClearProviderCredentialRequest message. +type ClearProviderCredentialRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clearprovidercredentialresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clearprovidercredentialresponse.go new file mode 100644 index 00000000..e9dd869e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clearprovidercredentialresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ClearProviderCredentialResponse message. +type ClearProviderCredentialResponse struct { + Credential *ProviderCredential `json:"credential,omitempty"` +} + +func (c *ClearProviderCredentialResponse) GetCredential() *ProviderCredential { + if c == nil { + return nil + } + return c.Credential +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clientcontext.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clientcontext.go new file mode 100644 index 00000000..687265a5 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/clientcontext.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ClientContext message. +type ClientContext struct { + // The agentConversationId field. + AgentConversationID *string `json:"agentConversationId,omitempty"` + // The agentSessionId field. + AgentSessionID *string `json:"agentSessionId,omitempty"` + // The appVersion field. + AppVersion *string `json:"appVersion,omitempty"` + // The featureFlags field. + FeatureFlags []string `json:"featureFlags,omitempty"` + // The locale field. + Locale *string `json:"locale,omitempty"` + // The route field. + Route *string `json:"route,omitempty"` + // The url field. + URL *string `json:"url,omitempty"` + // The userAgent field. + UserAgent *string `json:"userAgent,omitempty"` + // The viewport field. + Viewport *string `json:"viewport,omitempty"` +} + +func (c *ClientContext) GetAgentConversationID() *string { + if c == nil { + return nil + } + return c.AgentConversationID +} + +func (c *ClientContext) GetAgentSessionID() *string { + if c == nil { + return nil + } + return c.AgentSessionID +} + +func (c *ClientContext) GetAppVersion() *string { + if c == nil { + return nil + } + return c.AppVersion +} + +func (c *ClientContext) GetFeatureFlags() []string { + if c == nil { + return nil + } + return c.FeatureFlags +} + +func (c *ClientContext) GetLocale() *string { + if c == nil { + return nil + } + return c.Locale +} + +func (c *ClientContext) GetRoute() *string { + if c == nil { + return nil + } + return c.Route +} + +func (c *ClientContext) GetURL() *string { + if c == nil { + return nil + } + return c.URL +} + +func (c *ClientContext) GetUserAgent() *string { + if c == nil { + return nil + } + return c.UserAgent +} + +func (c *ClientContext) GetViewport() *string { + if c == nil { + return nil + } + return c.Viewport +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/composite.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/composite.go index 6142f46e..b45f5530 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/composite.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/composite.go @@ -2,23 +2,23 @@ package shared -// Format - Wire format the provider expects. Defaults to +// CompositeFormat - Wire format the provider expects. Defaults to // // FORMAT_JSON_OBJECT. -type Format string +type CompositeFormat string const ( - FormatFormatJSONObject Format = "FORMAT_JSON_OBJECT" - FormatFormatColonSeparated Format = "FORMAT_COLON_SEPARATED" - FormatFormatUnderscoreSeparated Format = "FORMAT_UNDERSCORE_SEPARATED" + CompositeFormatFormatJSONObject CompositeFormat = "FORMAT_JSON_OBJECT" + CompositeFormatFormatColonSeparated CompositeFormat = "FORMAT_COLON_SEPARATED" + CompositeFormatFormatUnderscoreSeparated CompositeFormat = "FORMAT_UNDERSCORE_SEPARATED" ) -func (e Format) ToPointer() *Format { +func (e CompositeFormat) ToPointer() *CompositeFormat { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Format) IsExact() bool { +func (e *CompositeFormat) IsExact() bool { if e != nil { switch *e { case "FORMAT_JSON_OBJECT", "FORMAT_COLON_SEPARATED", "FORMAT_UNDERSCORE_SEPARATED": @@ -37,7 +37,7 @@ type Composite struct { Fields []CompositeField `json:"fields,omitempty"` // Wire format the provider expects. Defaults to // FORMAT_JSON_OBJECT. - Format *Format `json:"format,omitempty"` + Format *CompositeFormat `json:"format,omitempty"` } func (c *Composite) GetFields() []CompositeField { @@ -47,7 +47,7 @@ func (c *Composite) GetFields() []CompositeField { return c.Fields } -func (c *Composite) GetFormat() *Format { +func (c *Composite) GetFormat() *CompositeFormat { if c == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectoractionref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectoractionref.go index a514e301..5e0aaebb 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectoractionref.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectoractionref.go @@ -2,23 +2,24 @@ package shared -// Operation - Which connector RPC this dispatches to. -type Operation string +// ConnectorActionRefOperation - Which connector RPC this dispatches to. +type ConnectorActionRefOperation string const ( - OperationOperationUnspecified Operation = "OPERATION_UNSPECIFIED" - OperationOperationGrant Operation = "OPERATION_GRANT" + ConnectorActionRefOperationOperationUnspecified ConnectorActionRefOperation = "OPERATION_UNSPECIFIED" + ConnectorActionRefOperationOperationGrant ConnectorActionRefOperation = "OPERATION_GRANT" + ConnectorActionRefOperationOperationIssueCredential ConnectorActionRefOperation = "OPERATION_ISSUE_CREDENTIAL" ) -func (e Operation) ToPointer() *Operation { +func (e ConnectorActionRefOperation) ToPointer() *ConnectorActionRefOperation { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Operation) IsExact() bool { +func (e *ConnectorActionRefOperation) IsExact() bool { if e != nil { switch *e { - case "OPERATION_UNSPECIFIED", "OPERATION_GRANT": + case "OPERATION_UNSPECIFIED", "OPERATION_GRANT", "OPERATION_ISSUE_CREDENTIAL": return true } } @@ -35,7 +36,7 @@ type ConnectorActionRef struct { // The connector that will execute the Grant / Revoke. ConnectorID *string `json:"connectorId,omitempty"` // Which connector RPC this dispatches to. - Operation *Operation `json:"operation,omitempty"` + Operation *ConnectorActionRefOperation `json:"operation,omitempty"` } func (c *ConnectorActionRef) GetAppID() *string { @@ -52,7 +53,7 @@ func (c *ConnectorActionRef) GetConnectorID() *string { return c.ConnectorID } -func (c *ConnectorActionRef) GetOperation() *Operation { +func (c *ConnectorActionRef) GetOperation() *ConnectorActionRefOperation { if c == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorexpandmask.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorexpandmask.go index 9de9e38e..45be187a 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorexpandmask.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorexpandmask.go @@ -4,7 +4,8 @@ package shared // The ConnectorExpandMask is used to expand related objects on a connector. type ConnectorExpandMask struct { - // Paths that you want expanded in the response. Possible values are "app_id" and "*". + // Paths that you want expanded in the response. Possible values are "app_id", + // "user_ids", "capabilities" and "*". Paths []string `json:"paths,omitempty"` } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorsyncfailingevidence.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorsyncfailingevidence.go new file mode 100644 index 00000000..70be14f4 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorsyncfailingevidence.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// ConnectorSyncFailingEvidence describes the failure streak behind a +// +// CONNECTOR_SYNC_FAILING finding, refreshed on every re-observation. +type ConnectorSyncFailingEvidence struct { + // The consecutiveFailureCount field. + ConsecutiveFailureCount *int64 `json:"consecutiveFailureCount,omitempty"` + LastFailedAt *time.Time `json:"lastFailedAt,omitempty"` + // Id of the newest failing sync run, not a copy of its error text -- see the + // c1models message for why the error itself is deliberately not carried here. + LastSyncLifecycleID *string `json:"lastSyncLifecycleId,omitempty"` + StreakStartedAt *time.Time `json:"streakStartedAt,omitempty"` +} + +func (c ConnectorSyncFailingEvidence) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ConnectorSyncFailingEvidence) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ConnectorSyncFailingEvidence) GetConsecutiveFailureCount() *int64 { + if c == nil { + return nil + } + return c.ConsecutiveFailureCount +} + +func (c *ConnectorSyncFailingEvidence) GetLastFailedAt() *time.Time { + if c == nil { + return nil + } + return c.LastFailedAt +} + +func (c *ConnectorSyncFailingEvidence) GetLastSyncLifecycleID() *string { + if c == nil { + return nil + } + return c.LastSyncLifecycleID +} + +func (c *ConnectorSyncFailingEvidence) GetStreakStartedAt() *time.Time { + if c == nil { + return nil + } + return c.StreakStartedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorsyncfailingtype.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorsyncfailingtype.go new file mode 100644 index 00000000..2ff2e3e8 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/connectorsyncfailingtype.go @@ -0,0 +1,10 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// ConnectorSyncFailingType - ConnectorSyncFailingType: a connector's completed sync runs have ended in +// +// error for at least two consecutive runs, with no intervening success. +// Target: ConnectorTarget. +type ConnectorSyncFailingType struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createapprequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createapprequest.go index 313bda08..f7fc7972 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createapprequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createapprequest.go @@ -38,7 +38,7 @@ type CreateAppRequest struct { // Well-known keys: `managed_by`, `iac_workspace`, // `iac_resource_address`, `iac_tool_version`. Annotations map[string]string `json:"annotations,omitempty"` - // Sets entitlement owners on the app. + // Initial entitlement owners for ordinary API creation. Requests with `match_baton_ref` must leave this empty; Terraform manages owners with `conductorone_app_owner_entitlement`. AppEntitlementOwnerRefs []AppEntitlementRef `json:"appEntitlementOwnerRefs,omitempty"` // Creates the app with this certify policy. CertifyPolicyID *string `json:"certifyPolicyId,omitempty"` @@ -51,10 +51,11 @@ type CreateAppRequest struct { // Define the app user identity matching strategy for this app. IdentityMatching *CreateAppRequestIdentityMatching `json:"identityMatching,omitempty"` // Instructions shown to users in the access request form when requesting access for this app. - Instructions *string `json:"instructions,omitempty"` + Instructions *string `json:"instructions,omitempty"` + MatchBatonRef *AppMatchBatonRef `json:"matchBatonRef,omitempty"` // Creates the app with this monthly cost per seat. MonthlyCostUsd *int `json:"monthlyCostUsd,omitempty"` - // Creates the app with this array of user owners. + // Initial user owners for ordinary API creation. Requests with `match_baton_ref` must leave this empty; Terraform manages owners with `conductorone_app_owner_user`. Owners []string `json:"owners,omitempty"` // Creates the app with this revoke policy. RevokePolicyID *string `json:"revokePolicyId,omitempty"` @@ -118,6 +119,13 @@ func (c *CreateAppRequest) GetInstructions() *string { return c.Instructions } +func (c *CreateAppRequest) GetMatchBatonRef() *AppMatchBatonRef { + if c == nil { + return nil + } + return c.MatchBatonRef +} + func (c *CreateAppRequest) GetMonthlyCostUsd() *int { if c == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createappresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createappresponse.go index 04b9807d..8c1a718e 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createappresponse.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createappresponse.go @@ -2,7 +2,7 @@ package shared -// CreateAppResponse - Returns the new app's values. +// CreateAppResponse contains the newly created application. type CreateAppResponse struct { App *App `json:"app,omitempty"` } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createfeedbackrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createfeedbackrequest.go new file mode 100644 index 00000000..b93d51cc --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createfeedbackrequest.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The CreateFeedbackRequest message. +type CreateFeedbackRequest struct { + ClientContext *ClientContext `json:"clientContext,omitempty"` + DatadogContext *DatadogContext `json:"datadogContext,omitempty"` + // The description field. + Description *string `json:"description,omitempty"` + // The screenshots field. + Screenshots []Screenshot `json:"screenshots,omitempty"` +} + +func (c *CreateFeedbackRequest) GetClientContext() *ClientContext { + if c == nil { + return nil + } + return c.ClientContext +} + +func (c *CreateFeedbackRequest) GetDatadogContext() *DatadogContext { + if c == nil { + return nil + } + return c.DatadogContext +} + +func (c *CreateFeedbackRequest) GetDescription() *string { + if c == nil { + return nil + } + return c.Description +} + +func (c *CreateFeedbackRequest) GetScreenshots() []Screenshot { + if c == nil { + return nil + } + return c.Screenshots +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createfeedbackresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createfeedbackresponse.go new file mode 100644 index 00000000..13f29f55 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createfeedbackresponse.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The CreateFeedbackResponse message. +type CreateFeedbackResponse struct { + // The stored feedback ID. + ID *string `json:"id,omitempty"` + // URL of the task created for this feedback. Empty while task delivery is + // unavailable or has not succeeded. + TicketURL *string `json:"ticketUrl,omitempty"` +} + +func (c *CreateFeedbackResponse) GetID() *string { + if c == nil { + return nil + } + return c.ID +} + +func (c *CreateFeedbackResponse) GetTicketURL() *string { + if c == nil { + return nil + } + return c.TicketURL +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createmanuallymanagedresourcetyperequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createmanuallymanagedresourcetyperequest.go index acd8948d..d23d9f5c 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createmanuallymanagedresourcetyperequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createmanuallymanagedresourcetyperequest.go @@ -15,6 +15,7 @@ const ( ResourceTypeVault ResourceType = "VAULT" ResourceTypeProfileType ResourceType = "PROFILE_TYPE" ResourceTypeSessionPolicy ResourceType = "SESSION_POLICY" + ResourceTypeClawAgent ResourceType = "CLAW_AGENT" ) func (e ResourceType) ToPointer() *ResourceType { @@ -25,7 +26,7 @@ func (e ResourceType) ToPointer() *ResourceType { func (e *ResourceType) IsExact() bool { if e != nil { switch *e { - case "ROLE", "GROUP", "LICENSE", "PROJECT", "CATALOG", "CUSTOM", "VAULT", "PROFILE_TYPE", "SESSION_POLICY": + case "ROLE", "GROUP", "LICENSE", "PROJECT", "CATALOG", "CUSTOM", "VAULT", "PROFILE_TYPE", "SESSION_POLICY", "CLAW_AGENT": return true } } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createpolicyrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createpolicyrequest.go index 41f2131f..155a2ec4 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createpolicyrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createpolicyrequest.go @@ -40,6 +40,12 @@ type CreatePolicyRequest struct { // Well-known keys: `managed_by`, `iac_workspace`, // `iac_resource_address`, `iac_tool_version`. Annotations map[string]string `json:"annotations,omitempty"` + // When set, the new policy's baseline defers to another policy of the same + // type when no rule matches, instead of an inline baseline step list. + // Mutually exclusive with the baseline entry in policy_steps. Requires the + // POLICY_REFERENCES_POLICY feature; obeys the same depth/cycle/self rules as + // Rule.policy_id. + BaselinePolicyID *string `json:"baselinePolicyId,omitempty"` // The description of the new policy. Description *string `json:"description,omitempty"` // The display name of the new policy. @@ -57,7 +63,8 @@ type CreatePolicyRequest struct { // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. ReassignTasksToDelegates *bool `json:"reassignTasksToDelegates,omitempty"` // Conditional routing rules. See the Policy message for details on evaluation order. - Rules []Rule `json:"rules,omitempty"` + Rules []Rule `json:"rules,omitempty"` + Scope *PolicyScope `json:"scope,omitempty"` } func (c *CreatePolicyRequest) GetAnnotations() map[string]string { @@ -67,6 +74,13 @@ func (c *CreatePolicyRequest) GetAnnotations() map[string]string { return c.Annotations } +func (c *CreatePolicyRequest) GetBaselinePolicyID() *string { + if c == nil { + return nil + } + return c.BaselinePolicyID +} + func (c *CreatePolicyRequest) GetDescription() *string { if c == nil { return nil @@ -115,3 +129,10 @@ func (c *CreatePolicyRequest) GetRules() []Rule { } return c.Rules } + +func (c *CreatePolicyRequest) GetScope() *PolicyScope { + if c == nil { + return nil + } + return c.Scope +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createrevoketasksv2.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createrevoketasksv2.go index f833a7c4..3c766e4b 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createrevoketasksv2.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/createrevoketasksv2.go @@ -2,6 +2,32 @@ package shared +// GrantSourceFilter - Restricts the step to grants of either DIRECT (grants the user holds directly, +// +// including grants that are also inherited) or UNSPECIFIED (all grants). +// Composes with every inclusion mode, including inclusion_list_cel. +type GrantSourceFilter string + +const ( + GrantSourceFilterGrantSourceFilterUnspecified GrantSourceFilter = "GRANT_SOURCE_FILTER_UNSPECIFIED" + GrantSourceFilterGrantSourceFilterDirect GrantSourceFilter = "GRANT_SOURCE_FILTER_DIRECT" +) + +func (e GrantSourceFilter) ToPointer() *GrantSourceFilter { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *GrantSourceFilter) IsExact() bool { + if e != nil { + switch *e { + case "GRANT_SOURCE_FILTER_UNSPECIFIED", "GRANT_SOURCE_FILTER_DIRECT": + return true + } + } + return false +} + // The CreateRevokeTasksV2 message. // // This message contains a oneof named user. Only a single field of the following list may be set at a time: @@ -22,10 +48,14 @@ package shared // - exclusionCriteria // - exclusionListCel type CreateRevokeTasksV2 struct { - ExclusionCriteria *EntitlementExclusionCriteria `json:"exclusionCriteria,omitempty"` - ExclusionList *EntitlementExclusionList `json:"exclusionList,omitempty"` - ExclusionListCel *EntitlementExclusionListCel `json:"exclusionListCel,omitempty"` - ExclusionNone *EntitlementExclusionNone `json:"exclusionNone,omitempty"` + ExclusionCriteria *EntitlementExclusionCriteria `json:"exclusionCriteria,omitempty"` + ExclusionList *EntitlementExclusionList `json:"exclusionList,omitempty"` + ExclusionListCel *EntitlementExclusionListCel `json:"exclusionListCel,omitempty"` + ExclusionNone *EntitlementExclusionNone `json:"exclusionNone,omitempty"` + // Restricts the step to grants of either DIRECT (grants the user holds directly, + // including grants that are also inherited) or UNSPECIFIED (all grants). + // Composes with every inclusion mode, including inclusion_list_cel. + GrantSourceFilter *GrantSourceFilter `json:"grantSourceFilter,omitempty"` InclusionAccessOnly *EntitlementInclusionAccessOnly `json:"inclusionAccessOnly,omitempty"` InclusionAll *EntitlementInclusionAll `json:"inclusionAll,omitempty"` InclusionCriteria *EntitlementInclusionCriteria `json:"inclusionCriteria,omitempty"` @@ -70,6 +100,13 @@ func (c *CreateRevokeTasksV2) GetExclusionNone() *EntitlementExclusionNone { return c.ExclusionNone } +func (c *CreateRevokeTasksV2) GetGrantSourceFilter() *GrantSourceFilter { + if c == nil { + return nil + } + return c.GrantSourceFilter +} + func (c *CreateRevokeTasksV2) GetInclusionAccessOnly() *EntitlementInclusionAccessOnly { if c == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialexpiringevidence.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialexpiringevidence.go new file mode 100644 index 00000000..28918461 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialexpiringevidence.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// The CredentialExpiringEvidence message. +type CredentialExpiringEvidence struct { + // Whether the expiry was already past when last observed. + Expired *bool `json:"expired,omitempty"` + ExpiresAt *time.Time `json:"expiresAt,omitempty"` +} + +func (c CredentialExpiringEvidence) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CredentialExpiringEvidence) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CredentialExpiringEvidence) GetExpired() *bool { + if c == nil { + return nil + } + return c.Expired +} + +func (c *CredentialExpiringEvidence) GetExpiresAt() *time.Time { + if c == nil { + return nil + } + return c.ExpiresAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialexpiringtype.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialexpiringtype.go new file mode 100644 index 00000000..ce13bfc7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialexpiringtype.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// CredentialExpiringType - CredentialExpiringType: a ConductorOne-managed credential is inside the +// +// detector's expiry warning window, or already past it. Dedup is +// (credential arm, credential_id). Target: IdentityUserTarget -- the identity +// holding the credential. +// +// This message contains a oneof named credential. Only a single field of the following list may be set at a time: +// - userClientId +type CredentialExpiringType struct { + // The credentialDisplayName field. + CredentialDisplayName *string `json:"credentialDisplayName,omitempty"` + // Service-principal credential. + // This field is part of the `credential` oneof. + // See the documentation for `c1.api.finding.v1.CredentialExpiringType` for more details. + UserClientID *string `json:"userClientId,omitempty"` +} + +func (c *CredentialExpiringType) GetCredentialDisplayName() *string { + if c == nil { + return nil + } + return c.CredentialDisplayName +} + +func (c *CredentialExpiringType) GetUserClientID() *string { + if c == nil { + return nil + } + return c.UserClientID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialissuetarget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialissuetarget.go new file mode 100644 index 00000000..9c254a79 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialissuetarget.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// CredentialIssueTarget describes one approved credential request: who receives +// +// the credential, the terms asked for, and the offering it came from. +type CredentialIssueTarget struct { + Duration *string `json:"duration,omitempty"` + // The app user tying the recipient to the connector identity. + IdentityAppUserID *string `json:"identityAppUserId,omitempty"` + // The connector-side identity the credential is minted against. + IdentityResourceID *string `json:"identityResourceId,omitempty"` + // The user who receives the credential and may open its delivery vault. + IdentityUserID *string `json:"identityUserId,omitempty"` + // The offering the requester selected. + OfferingID *string `json:"offeringId,omitempty"` + // The Access Profile that published it. + RequestCatalogID *string `json:"requestCatalogId,omitempty"` + // Provider permissions approved for this credential. + Scopes []string `json:"scopes,omitempty"` +} + +func (c *CredentialIssueTarget) GetDuration() *string { + if c == nil { + return nil + } + return c.Duration +} + +func (c *CredentialIssueTarget) GetIdentityAppUserID() *string { + if c == nil { + return nil + } + return c.IdentityAppUserID +} + +func (c *CredentialIssueTarget) GetIdentityResourceID() *string { + if c == nil { + return nil + } + return c.IdentityResourceID +} + +func (c *CredentialIssueTarget) GetIdentityUserID() *string { + if c == nil { + return nil + } + return c.IdentityUserID +} + +func (c *CredentialIssueTarget) GetOfferingID() *string { + if c == nil { + return nil + } + return c.OfferingID +} + +func (c *CredentialIssueTarget) GetRequestCatalogID() *string { + if c == nil { + return nil + } + return c.RequestCatalogID +} + +func (c *CredentialIssueTarget) GetScopes() []string { + if c == nil { + return nil + } + return c.Scopes +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialissuetargetinput.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialissuetargetinput.go new file mode 100644 index 00000000..904343dd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialissuetargetinput.go @@ -0,0 +1,9 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// CredentialIssueTargetInput - CredentialIssueTarget describes one approved credential request: who receives +// +// the credential, the terms asked for, and the offering it came from. +type CredentialIssueTargetInput struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialpubliclyexposedevidence.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialpubliclyexposedevidence.go new file mode 100644 index 00000000..2c8c22e0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialpubliclyexposedevidence.go @@ -0,0 +1,93 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// CredentialPubliclyExposedEvidence carries scanner attribution for a public exposure. +type CredentialPubliclyExposedEvidence struct { + // The credentialRevoked field. + CredentialRevoked *bool `json:"credentialRevoked,omitempty"` + // The fingerprintPrefix field. + FingerprintPrefix *string `json:"fingerprintPrefix,omitempty"` + FirstObservedAt *time.Time `json:"firstObservedAt,omitempty"` + // The firstScannerId field. + FirstScannerID *string `json:"firstScannerId,omitempty"` + // The reportingScanners field. + ReportingScanners []string `json:"reportingScanners,omitempty"` + RevokedAt *time.Time `json:"revokedAt,omitempty"` + // The sourceKind field. + SourceKind *string `json:"sourceKind,omitempty"` + // The sourceUrl field. + SourceURL *string `json:"sourceUrl,omitempty"` +} + +func (c CredentialPubliclyExposedEvidence) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CredentialPubliclyExposedEvidence) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CredentialPubliclyExposedEvidence) GetCredentialRevoked() *bool { + if c == nil { + return nil + } + return c.CredentialRevoked +} + +func (c *CredentialPubliclyExposedEvidence) GetFingerprintPrefix() *string { + if c == nil { + return nil + } + return c.FingerprintPrefix +} + +func (c *CredentialPubliclyExposedEvidence) GetFirstObservedAt() *time.Time { + if c == nil { + return nil + } + return c.FirstObservedAt +} + +func (c *CredentialPubliclyExposedEvidence) GetFirstScannerID() *string { + if c == nil { + return nil + } + return c.FirstScannerID +} + +func (c *CredentialPubliclyExposedEvidence) GetReportingScanners() []string { + if c == nil { + return nil + } + return c.ReportingScanners +} + +func (c *CredentialPubliclyExposedEvidence) GetRevokedAt() *time.Time { + if c == nil { + return nil + } + return c.RevokedAt +} + +func (c *CredentialPubliclyExposedEvidence) GetSourceKind() *string { + if c == nil { + return nil + } + return c.SourceKind +} + +func (c *CredentialPubliclyExposedEvidence) GetSourceURL() *string { + if c == nil { + return nil + } + return c.SourceURL +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialpubliclyexposedtype.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialpubliclyexposedtype.go new file mode 100644 index 00000000..7bc8bb2e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/credentialpubliclyexposedtype.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// CredentialPubliclyExposedType - CredentialPubliclyExposedType: a live credential was reported as publicly exposed. +// +// Dedup is (credential arm, credential_id). +// +// This message contains a oneof named credential. Only a single field of the following list may be set at a time: +// - userClientId +// - connectorClientId +// - connectorManagedCredentialId +// - functionClientId +type CredentialPubliclyExposedType struct { + // The connectorClientId field. + // This field is part of the `credential` oneof. + // See the documentation for `c1.api.finding.v1.CredentialPubliclyExposedType` for more details. + ConnectorClientID *string `json:"connectorClientId,omitempty"` + // The connectorManagedCredentialId field. + // This field is part of the `credential` oneof. + // See the documentation for `c1.api.finding.v1.CredentialPubliclyExposedType` for more details. + ConnectorManagedCredentialID *string `json:"connectorManagedCredentialId,omitempty"` + // The credentialDisplayName field. + CredentialDisplayName *string `json:"credentialDisplayName,omitempty"` + // The functionClientId field. + // This field is part of the `credential` oneof. + // See the documentation for `c1.api.finding.v1.CredentialPubliclyExposedType` for more details. + FunctionClientID *string `json:"functionClientId,omitempty"` + // The userClientId field. + // This field is part of the `credential` oneof. + // See the documentation for `c1.api.finding.v1.CredentialPubliclyExposedType` for more details. + UserClientID *string `json:"userClientId,omitempty"` +} + +func (c *CredentialPubliclyExposedType) GetConnectorClientID() *string { + if c == nil { + return nil + } + return c.ConnectorClientID +} + +func (c *CredentialPubliclyExposedType) GetConnectorManagedCredentialID() *string { + if c == nil { + return nil + } + return c.ConnectorManagedCredentialID +} + +func (c *CredentialPubliclyExposedType) GetCredentialDisplayName() *string { + if c == nil { + return nil + } + return c.CredentialDisplayName +} + +func (c *CredentialPubliclyExposedType) GetFunctionClientID() *string { + if c == nil { + return nil + } + return c.FunctionClientID +} + +func (c *CredentialPubliclyExposedType) GetUserClientID() *string { + if c == nil { + return nil + } + return c.UserClientID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/datadogcontext.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/datadogcontext.go new file mode 100644 index 00000000..c3ae55fa --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/datadogcontext.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// The DatadogContext message. +type DatadogContext struct { + // The rumSessionId field. + RumSessionID *string `json:"rumSessionId,omitempty"` + // The rumViewId field. + RumViewID *string `json:"rumViewId,omitempty"` + // The rumViewName field. + RumViewName *string `json:"rumViewName,omitempty"` + // The traceIds field. + TraceIds []string `json:"traceIds,omitempty"` + WindowEnd *time.Time `json:"windowEnd,omitempty"` + WindowStart *time.Time `json:"windowStart,omitempty"` +} + +func (d DatadogContext) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DatadogContext) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DatadogContext) GetRumSessionID() *string { + if d == nil { + return nil + } + return d.RumSessionID +} + +func (d *DatadogContext) GetRumViewID() *string { + if d == nil { + return nil + } + return d.RumViewID +} + +func (d *DatadogContext) GetRumViewName() *string { + if d == nil { + return nil + } + return d.RumViewName +} + +func (d *DatadogContext) GetTraceIds() []string { + if d == nil { + return nil + } + return d.TraceIds +} + +func (d *DatadogContext) GetWindowEnd() *time.Time { + if d == nil { + return nil + } + return d.WindowEnd +} + +func (d *DatadogContext) GetWindowStart() *time.Time { + if d == nil { + return nil + } + return d.WindowStart +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/datefield.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/datefield.go new file mode 100644 index 00000000..8e37c75c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/datefield.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// DateField renders a date picker. The value is an ISO-8601 calendar date +// +// ("YYYY-MM-DD") stored in the enclosing StringField's string value. +type DateField struct { + // Default the field to the render date when the StringField has no default_value. + DefaultToToday *bool `json:"defaultToToday,omitempty"` + // Latest selectable date, inclusive, as "YYYY-MM-DD". Empty means unbounded. + MaxDate *string `json:"maxDate,omitempty"` + // Latest selectable date expressed as an offset in days from the date the + // form is rendered; negative is in the past. Set this to 365 to cap a date at + // one year out. When both are set, the earlier of this and max_date applies. + // Enforcement is one day slack in each direction: the picker anchors today at + // the submitter's local midnight and the server anchors in UTC, so 365 admits + // 366 days rather than reject a date the picker itself offered. + MaxDaysFromToday *int `json:"maxDaysFromToday,omitempty"` + // Earliest selectable date, inclusive, as "YYYY-MM-DD". Empty means unbounded. + MinDate *string `json:"minDate,omitempty"` + // Earliest selectable date expressed as an offset in days from the date the + // form is rendered; negative is in the past. Prefer this over min_date for a + // rolling window, which would otherwise go stale. When both are set, the + // later of the two applies. + MinDaysFromToday *int `json:"minDaysFromToday,omitempty"` +} + +func (d *DateField) GetDefaultToToday() *bool { + if d == nil { + return nil + } + return d.DefaultToToday +} + +func (d *DateField) GetMaxDate() *string { + if d == nil { + return nil + } + return d.MaxDate +} + +func (d *DateField) GetMaxDaysFromToday() *int { + if d == nil { + return nil + } + return d.MaxDaysFromToday +} + +func (d *DateField) GetMinDate() *string { + if d == nil { + return nil + } + return d.MinDate +} + +func (d *DateField) GetMinDaysFromToday() *int { + if d == nil { + return nil + } + return d.MinDaysFromToday +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownerdetail.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownerdetail.go new file mode 100644 index 00000000..7b3b435b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownerdetail.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// Reason - The reason field. +type Reason string + +const ( + ReasonDeactivatedOwnerReasonUnspecified Reason = "DEACTIVATED_OWNER_REASON_UNSPECIFIED" + ReasonDeactivatedOwnerReasonUserDeleted Reason = "DEACTIVATED_OWNER_REASON_USER_DELETED" + ReasonDeactivatedOwnerReasonUserDisabled Reason = "DEACTIVATED_OWNER_REASON_USER_DISABLED" + ReasonDeactivatedOwnerReasonEmploymentInactive Reason = "DEACTIVATED_OWNER_REASON_EMPLOYMENT_INACTIVE" +) + +func (e Reason) ToPointer() *Reason { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Reason) IsExact() bool { + if e != nil { + switch *e { + case "DEACTIVATED_OWNER_REASON_UNSPECIFIED", "DEACTIVATED_OWNER_REASON_USER_DELETED", "DEACTIVATED_OWNER_REASON_USER_DISABLED", "DEACTIVATED_OWNER_REASON_EMPLOYMENT_INACTIVE": + return true + } + } + return false +} + +// DeactivatedOwnerDetail is one deactivated owner found for the target at +// +// detection time. A target can have more than one owner, and more than one +// can read as deactivated. +type DeactivatedOwnerDetail struct { + // The reason field. + Reason *Reason `json:"reason,omitempty"` + // The userId field. + UserID *string `json:"userId,omitempty"` +} + +func (d *DeactivatedOwnerDetail) GetReason() *Reason { + if d == nil { + return nil + } + return d.Reason +} + +func (d *DeactivatedOwnerDetail) GetUserID() *string { + if d == nil { + return nil + } + return d.UserID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownerevidence.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownerevidence.go new file mode 100644 index 00000000..0b8077c2 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownerevidence.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The DeactivatedOwnerEvidence message. +type DeactivatedOwnerEvidence struct { + // The deactivatedOwners field. + DeactivatedOwners []DeactivatedOwnerDetail `json:"deactivatedOwners,omitempty"` +} + +func (d *DeactivatedOwnerEvidence) GetDeactivatedOwners() []DeactivatedOwnerDetail { + if d == nil { + return nil + } + return d.DeactivatedOwners +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownertype.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownertype.go new file mode 100644 index 00000000..315a5503 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deactivatedownertype.go @@ -0,0 +1,45 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// DeactivatedOwnerTypeSource - The source field. +type DeactivatedOwnerTypeSource string + +const ( + DeactivatedOwnerTypeSourceDeactivatedOwnerSourceUnspecified DeactivatedOwnerTypeSource = "DEACTIVATED_OWNER_SOURCE_UNSPECIFIED" + DeactivatedOwnerTypeSourceDeactivatedOwnerSourceIdentityCorrelation DeactivatedOwnerTypeSource = "DEACTIVATED_OWNER_SOURCE_IDENTITY_CORRELATION" + DeactivatedOwnerTypeSourceDeactivatedOwnerSourceOwnershipAssigned DeactivatedOwnerTypeSource = "DEACTIVATED_OWNER_SOURCE_OWNERSHIP_ASSIGNED" + DeactivatedOwnerTypeSourceDeactivatedOwnerSourceSecretRunAsIdentity DeactivatedOwnerTypeSource = "DEACTIVATED_OWNER_SOURCE_SECRET_RUN_AS_IDENTITY" +) + +func (e DeactivatedOwnerTypeSource) ToPointer() *DeactivatedOwnerTypeSource { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DeactivatedOwnerTypeSource) IsExact() bool { + if e != nil { + switch *e { + case "DEACTIVATED_OWNER_SOURCE_UNSPECIFIED", "DEACTIVATED_OWNER_SOURCE_IDENTITY_CORRELATION", "DEACTIVATED_OWNER_SOURCE_OWNERSHIP_ASSIGNED", "DEACTIVATED_OWNER_SOURCE_SECRET_RUN_AS_IDENTITY": + return true + } + } + return false +} + +// DeactivatedOwnerType - DeactivatedOwnerType: the human responsible for a target -- either the +// +// AppUser's own correlated identity, an ownership_v2-assigned owner, or a +// secret's run-as identity is deactivated. Target: AppUserTarget or +// AppResourceTarget. +type DeactivatedOwnerType struct { + // The source field. + Source *DeactivatedOwnerTypeSource `json:"source,omitempty"` +} + +func (d *DeactivatedOwnerType) GetSource() *DeactivatedOwnerTypeSource { + if d == nil { + return nil + } + return d.Source +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/decoypubliclyexposedevidence.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/decoypubliclyexposedevidence.go new file mode 100644 index 00000000..9d24e76e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/decoypubliclyexposedevidence.go @@ -0,0 +1,93 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// DecoyPubliclyExposedEvidence mirrors CredentialPubliclyExposedEvidence for decoys. +type DecoyPubliclyExposedEvidence struct { + // The credentialRevoked field. + CredentialRevoked *bool `json:"credentialRevoked,omitempty"` + // The fingerprintPrefix field. + FingerprintPrefix *string `json:"fingerprintPrefix,omitempty"` + FirstObservedAt *time.Time `json:"firstObservedAt,omitempty"` + // The firstScannerId field. + FirstScannerID *string `json:"firstScannerId,omitempty"` + // The reportingScanners field. + ReportingScanners []string `json:"reportingScanners,omitempty"` + RevokedAt *time.Time `json:"revokedAt,omitempty"` + // The sourceKind field. + SourceKind *string `json:"sourceKind,omitempty"` + // The sourceUrl field. + SourceURL *string `json:"sourceUrl,omitempty"` +} + +func (d DecoyPubliclyExposedEvidence) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DecoyPubliclyExposedEvidence) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DecoyPubliclyExposedEvidence) GetCredentialRevoked() *bool { + if d == nil { + return nil + } + return d.CredentialRevoked +} + +func (d *DecoyPubliclyExposedEvidence) GetFingerprintPrefix() *string { + if d == nil { + return nil + } + return d.FingerprintPrefix +} + +func (d *DecoyPubliclyExposedEvidence) GetFirstObservedAt() *time.Time { + if d == nil { + return nil + } + return d.FirstObservedAt +} + +func (d *DecoyPubliclyExposedEvidence) GetFirstScannerID() *string { + if d == nil { + return nil + } + return d.FirstScannerID +} + +func (d *DecoyPubliclyExposedEvidence) GetReportingScanners() []string { + if d == nil { + return nil + } + return d.ReportingScanners +} + +func (d *DecoyPubliclyExposedEvidence) GetRevokedAt() *time.Time { + if d == nil { + return nil + } + return d.RevokedAt +} + +func (d *DecoyPubliclyExposedEvidence) GetSourceKind() *string { + if d == nil { + return nil + } + return d.SourceKind +} + +func (d *DecoyPubliclyExposedEvidence) GetSourceURL() *string { + if d == nil { + return nil + } + return d.SourceURL +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/decoypubliclyexposedtype.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/decoypubliclyexposedtype.go new file mode 100644 index 00000000..fc61e8dd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/decoypubliclyexposedtype.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// DecoyPubliclyExposedType - DecoyPubliclyExposedType: a planted decoy was reported as publicly exposed. +// +// Dedup is decoy_id. +type DecoyPubliclyExposedType struct { + // The decoyDisplayName field. + DecoyDisplayName *string `json:"decoyDisplayName,omitempty"` + // The decoyId field. + DecoyID *string `json:"decoyId,omitempty"` +} + +func (d *DecoyPubliclyExposedType) GetDecoyDisplayName() *string { + if d == nil { + return nil + } + return d.DecoyDisplayName +} + +func (d *DecoyPubliclyExposedType) GetDecoyID() *string { + if d == nil { + return nil + } + return d.DecoyID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deviceplacementprovision.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deviceplacementprovision.go new file mode 100644 index 00000000..33571d0b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/deviceplacementprovision.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// DevicePlacementProvision - This provision step is fulfilled by a Latchkey member device producing an MLS Welcome for the recipient. It has no assignee and no instructions because the step is not human-actionable. +type DevicePlacementProvision struct { + // The vaultBoundaryId field. + VaultBoundaryID *string `json:"vaultBoundaryId,omitempty"` +} + +func (d *DevicePlacementProvision) GetVaultBoundaryID() *string { + if d == nil { + return nil + } + return d.VaultBoundaryID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/disabledreasoncircuitbreaker.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/disabledreasoncircuitbreaker.go index f115282a..aac42463 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/disabledreasoncircuitbreaker.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/disabledreasoncircuitbreaker.go @@ -7,23 +7,23 @@ import ( "time" ) -// Period - Snapshot of the period at trip time. -type Period string +// DisabledReasonCircuitBreakerPeriod - Snapshot of the period at trip time. +type DisabledReasonCircuitBreakerPeriod string const ( - PeriodCircuitBreakerPeriodUnspecified Period = "CIRCUIT_BREAKER_PERIOD_UNSPECIFIED" - PeriodCircuitBreakerPeriodHour Period = "CIRCUIT_BREAKER_PERIOD_HOUR" - PeriodCircuitBreakerPeriodDay Period = "CIRCUIT_BREAKER_PERIOD_DAY" - PeriodCircuitBreakerPeriodWeek Period = "CIRCUIT_BREAKER_PERIOD_WEEK" - PeriodCircuitBreakerPeriodMonth Period = "CIRCUIT_BREAKER_PERIOD_MONTH" + DisabledReasonCircuitBreakerPeriodCircuitBreakerPeriodUnspecified DisabledReasonCircuitBreakerPeriod = "CIRCUIT_BREAKER_PERIOD_UNSPECIFIED" + DisabledReasonCircuitBreakerPeriodCircuitBreakerPeriodHour DisabledReasonCircuitBreakerPeriod = "CIRCUIT_BREAKER_PERIOD_HOUR" + DisabledReasonCircuitBreakerPeriodCircuitBreakerPeriodDay DisabledReasonCircuitBreakerPeriod = "CIRCUIT_BREAKER_PERIOD_DAY" + DisabledReasonCircuitBreakerPeriodCircuitBreakerPeriodWeek DisabledReasonCircuitBreakerPeriod = "CIRCUIT_BREAKER_PERIOD_WEEK" + DisabledReasonCircuitBreakerPeriodCircuitBreakerPeriodMonth DisabledReasonCircuitBreakerPeriod = "CIRCUIT_BREAKER_PERIOD_MONTH" ) -func (e Period) ToPointer() *Period { +func (e DisabledReasonCircuitBreakerPeriod) ToPointer() *DisabledReasonCircuitBreakerPeriod { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Period) IsExact() bool { +func (e *DisabledReasonCircuitBreakerPeriod) IsExact() bool { if e != nil { switch *e { case "CIRCUIT_BREAKER_PERIOD_UNSPECIFIED", "CIRCUIT_BREAKER_PERIOD_HOUR", "CIRCUIT_BREAKER_PERIOD_DAY", "CIRCUIT_BREAKER_PERIOD_WEEK", "CIRCUIT_BREAKER_PERIOD_MONTH": @@ -41,7 +41,7 @@ type DisabledReasonCircuitBreaker struct { // Observed execution count in the period at trip time. ObservedCount *int64 `json:"observedCount,omitempty"` // Snapshot of the period at trip time. - Period *Period `json:"period,omitempty"` + Period *DisabledReasonCircuitBreakerPeriod `json:"period,omitempty"` // Snapshot of the threshold at trip time. Threshold *int64 `json:"threshold,omitempty"` TrippedAt *time.Time `json:"trippedAt,omitempty"` @@ -65,7 +65,7 @@ func (d *DisabledReasonCircuitBreaker) GetObservedCount() *int64 { return d.ObservedCount } -func (d *DisabledReasonCircuitBreaker) GetPeriod() *Period { +func (d *DisabledReasonCircuitBreaker) GetPeriod() *DisabledReasonCircuitBreakerPeriod { if d == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/effectiveuserpolicy.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/effectiveuserpolicy.go new file mode 100644 index 00000000..6b229aff --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/effectiveuserpolicy.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// EffectiveUserPolicySource - Why the policy applies to the user. +type EffectiveUserPolicySource string + +const ( + EffectiveUserPolicySourceEffectiveSessionPolicySourceUnspecified EffectiveUserPolicySource = "EFFECTIVE_SESSION_POLICY_SOURCE_UNSPECIFIED" + EffectiveUserPolicySourceEffectiveSessionPolicySourceDirect EffectiveUserPolicySource = "EFFECTIVE_SESSION_POLICY_SOURCE_DIRECT" + EffectiveUserPolicySourceEffectiveSessionPolicySourceGroup EffectiveUserPolicySource = "EFFECTIVE_SESSION_POLICY_SOURCE_GROUP" + EffectiveUserPolicySourceEffectiveSessionPolicySourceTenantDefault EffectiveUserPolicySource = "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT" + EffectiveUserPolicySourceEffectiveSessionPolicySourceTenantDefaultNone EffectiveUserPolicySource = "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT_NONE" +) + +func (e EffectiveUserPolicySource) ToPointer() *EffectiveUserPolicySource { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *EffectiveUserPolicySource) IsExact() bool { + if e != nil { + switch *e { + case "EFFECTIVE_SESSION_POLICY_SOURCE_UNSPECIFIED", "EFFECTIVE_SESSION_POLICY_SOURCE_DIRECT", "EFFECTIVE_SESSION_POLICY_SOURCE_GROUP", "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT", "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT_NONE": + return true + } + } + return false +} + +// EffectiveUserPolicy is one session policy that applies to a user. +type EffectiveUserPolicy struct { + Group *AppEntitlement `json:"group,omitempty"` + Policy *SessionPolicy `json:"policy,omitempty"` + // Why the policy applies to the user. + Source *EffectiveUserPolicySource `json:"source,omitempty"` +} + +func (e *EffectiveUserPolicy) GetGroup() *AppEntitlement { + if e == nil { + return nil + } + return e.Group +} + +func (e *EffectiveUserPolicy) GetPolicy() *SessionPolicy { + if e == nil { + return nil + } + return e.Policy +} + +func (e *EffectiveUserPolicy) GetSource() *EffectiveUserPolicySource { + if e == nil { + return nil + } + return e.Source +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/emailchannelsettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/emailchannelsettings.go index ecba1648..8a521990 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/emailchannelsettings.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/emailchannelsettings.go @@ -14,7 +14,9 @@ type EmailChannelSettings struct { Enabled *bool `json:"enabled,omitempty"` ExpiringAccess *ExpiringAccessPreference `json:"expiringAccess,omitempty"` ProvisioningRequest *ProvisioningRequestPreference `json:"provisioningRequest,omitempty"` + RequestCreated *RequestCreatedPreference `json:"requestCreated,omitempty"` Reviews *ReviewsPreference `json:"reviews,omitempty"` + System *SystemPreference `json:"system,omitempty"` TaskReminders *TaskRemindersPreference `json:"taskReminders,omitempty"` } @@ -81,6 +83,13 @@ func (e *EmailChannelSettings) GetProvisioningRequest() *ProvisioningRequestPref return e.ProvisioningRequest } +func (e *EmailChannelSettings) GetRequestCreated() *RequestCreatedPreference { + if e == nil { + return nil + } + return e.RequestCreated +} + func (e *EmailChannelSettings) GetReviews() *ReviewsPreference { if e == nil { return nil @@ -88,6 +97,13 @@ func (e *EmailChannelSettings) GetReviews() *ReviewsPreference { return e.Reviews } +func (e *EmailChannelSettings) GetSystem() *SystemPreference { + if e == nil { + return nil + } + return e.System +} + func (e *EmailChannelSettings) GetTaskReminders() *TaskRemindersPreference { if e == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/encodedcontentguardconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/encodedcontentguardconfig.go new file mode 100644 index 00000000..c441eb16 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/encodedcontentguardconfig.go @@ -0,0 +1,36 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// EncodedContentGuardConfig detects encoded/obfuscated smuggling in tool input: +// +// long base64 blobs, long hex runs, and invisible/zero-width unicode. +type EncodedContentGuardConfig struct { + // When true, detection records the finding but does not deny (observe-only). + FlagOnly *bool `json:"flagOnly,omitempty"` + // Minimum contiguous base64 run length to flag. <= 0 = default (256). + MinBase64Run *int `json:"minBase64Run,omitempty"` + // Minimum contiguous hex run length to flag. <= 0 = default (128). + MinHexRun *int `json:"minHexRun,omitempty"` +} + +func (e *EncodedContentGuardConfig) GetFlagOnly() *bool { + if e == nil { + return nil + } + return e.FlagOnly +} + +func (e *EncodedContentGuardConfig) GetMinBase64Run() *int { + if e == nil { + return nil + } + return e.MinBase64Run +} + +func (e *EncodedContentGuardConfig) GetMinHexRun() *int { + if e == nil { + return nil + } + return e.MinHexRun +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ensureonboardingsessionrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ensureonboardingsessionrequest.go new file mode 100644 index 00000000..c2c8afef --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ensureonboardingsessionrequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// EnsureOnboardingSessionRequest - Requests the active onboarding conversation for the caller's tenant. +type EnsureOnboardingSessionRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ensureonboardingsessionresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ensureonboardingsessionresponse.go new file mode 100644 index 00000000..6c87507d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ensureonboardingsessionresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// EnsureOnboardingSessionResponse - Returns the active onboarding conversation and whether this call created it. +type EnsureOnboardingSessionResponse struct { + // The active onboarding conversation ID. + ConversationID *string `json:"conversationId,omitempty"` + // True only when this call created and started the conversation. + Created *bool `json:"created,omitempty"` +} + +func (e *EnsureOnboardingSessionResponse) GetConversationID() *string { + if e == nil { + return nil + } + return e.ConversationID +} + +func (e *EnsureOnboardingSessionResponse) GetCreated() *bool { + if e == nil { + return nil + } + return e.Created +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/entitlementcutoffimpactpoint.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/entitlementcutoffimpactpoint.go new file mode 100644 index 00000000..65eb1ee3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/entitlementcutoffimpactpoint.go @@ -0,0 +1,36 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// EntitlementCutoffImpactPoint reports the exact effect of an inclusive +// +// entitlement coverage cutoff on the analyzed cohort. +type EntitlementCutoffImpactPoint struct { + // Number of analyzed entitlements included at this cutoff. + EntitlementCount *int `json:"entitlementCount,omitempty"` + // Inclusive minimum entitlement coverage in basis points, where 8000 is 80%. + MinimumCoverageBasisPoints *int `json:"minimumCoverageBasisPoints,omitempty"` + // Exact number of cohort users who hold every included entitlement. + UsersWithAllEntitlements *int `json:"usersWithAllEntitlements,omitempty"` +} + +func (e *EntitlementCutoffImpactPoint) GetEntitlementCount() *int { + if e == nil { + return nil + } + return e.EntitlementCount +} + +func (e *EntitlementCutoffImpactPoint) GetMinimumCoverageBasisPoints() *int { + if e == nil { + return nil + } + return e.MinimumCoverageBasisPoints +} + +func (e *EntitlementCutoffImpactPoint) GetUsersWithAllEntitlements() *int { + if e == nil { + return nil + } + return e.UsersWithAllEntitlements +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/entitlementref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/entitlementref.go index ce2b5b69..a63ce1ce 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/entitlementref.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/entitlementref.go @@ -2,11 +2,11 @@ package shared -// EntitlementRef identifies an entitlement by app and entitlement ID. +// EntitlementRef identifies an entitlement by application and entitlement ID. type EntitlementRef struct { - // The appId field. + // Application that owns the entitlement. AppID *string `json:"appId,omitempty"` - // The entitlementId field. + // Entitlement within the application. EntitlementID *string `json:"entitlementId,omitempty"` } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateentitlementselectionrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateentitlementselectionrequest.go new file mode 100644 index 00000000..4fd6ec1a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateentitlementselectionrequest.go @@ -0,0 +1,45 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// EvaluateEntitlementSelectionRequest selects analyzed entitlements using an +// +// inclusive coverage cutoff plus optional manual overrides. +type EvaluateEntitlementSelectionRequest struct { + // Analyzed entitlements to exclude when they meet the cutoff. + ExplicitlyExcluded []EntitlementRef `json:"explicitlyExcluded,omitempty"` + // Analyzed entitlements to include even when they fall below the cutoff. + ExplicitlyIncluded []EntitlementRef `json:"explicitlyIncluded,omitempty"` + // Whether to return profile attribute facets for exact holders. + IncludeFacets *bool `json:"includeFacets,omitempty"` + // Inclusive minimum entitlement coverage in basis points, where 8000 is 80%. + MinimumCoverageBasisPoints *int `json:"minimumCoverageBasisPoints,omitempty"` +} + +func (e *EvaluateEntitlementSelectionRequest) GetExplicitlyExcluded() []EntitlementRef { + if e == nil { + return nil + } + return e.ExplicitlyExcluded +} + +func (e *EvaluateEntitlementSelectionRequest) GetExplicitlyIncluded() []EntitlementRef { + if e == nil { + return nil + } + return e.ExplicitlyIncluded +} + +func (e *EvaluateEntitlementSelectionRequest) GetIncludeFacets() *bool { + if e == nil { + return nil + } + return e.IncludeFacets +} + +func (e *EvaluateEntitlementSelectionRequest) GetMinimumCoverageBasisPoints() *int { + if e == nil { + return nil + } + return e.MinimumCoverageBasisPoints +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateentitlementselectionresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateentitlementselectionresponse.go new file mode 100644 index 00000000..9b7c564f --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateentitlementselectionresponse.go @@ -0,0 +1,36 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// EvaluateEntitlementSelectionResponse contains the exact impact of the +// +// resolved entitlement selection. +type EvaluateEntitlementSelectionResponse struct { + // Profile attribute facets narrowed to users who hold every selected entitlement. + CoreHolderFacets []AttributeFacet `json:"coreHolderFacets,omitempty"` + // Number of entitlements in the resolved selection. + SelectedEntitlementCount *int `json:"selectedEntitlementCount,omitempty"` + // Exact number of cohort users who hold every selected entitlement. + UsersWithAllEntitlements *int `json:"usersWithAllEntitlements,omitempty"` +} + +func (e *EvaluateEntitlementSelectionResponse) GetCoreHolderFacets() []AttributeFacet { + if e == nil { + return nil + } + return e.CoreHolderFacets +} + +func (e *EvaluateEntitlementSelectionResponse) GetSelectedEntitlementCount() *int { + if e == nil { + return nil + } + return e.SelectedEntitlementCount +} + +func (e *EvaluateEntitlementSelectionResponse) GetUsersWithAllEntitlements() *int { + if e == nil { + return nil + } + return e.UsersWithAllEntitlements +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateexpressions.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateexpressions.go index 30667dfb..66a4116a 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateexpressions.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/evaluateexpressions.go @@ -3,6 +3,8 @@ package shared // The EvaluateExpressions message. +// +// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. type EvaluateExpressions struct { // The expressions field. Expressions []Expression `json:"expressions,omitempty"` diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/expression.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/expression.go index 49621fb7..b7962894 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/expression.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/expression.go @@ -3,6 +3,8 @@ package shared // The Expression message. +// +// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. type Expression struct { // The expressionCel field. ExpressionCel *string `json:"expressionCel,omitempty"` diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/externalclientinfo.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/externalclientinfo.go index 5ae47d64..53590fe6 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/externalclientinfo.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/externalclientinfo.go @@ -14,6 +14,7 @@ const ( ClientIDTypeClientIDTypeUnspecified ClientIDType = "CLIENT_ID_TYPE_UNSPECIFIED" ClientIDTypeClientIDTypeDcr ClientIDType = "CLIENT_ID_TYPE_DCR" ClientIDTypeClientIDTypeMetadataURL ClientIDType = "CLIENT_ID_TYPE_METADATA_URL" + ClientIDTypeClientIDTypeApp ClientIDType = "CLIENT_ID_TYPE_APP" ) func (e ClientIDType) ToPointer() *ClientIDType { @@ -24,7 +25,7 @@ func (e ClientIDType) ToPointer() *ClientIDType { func (e *ClientIDType) IsExact() bool { if e != nil { switch *e { - case "CLIENT_ID_TYPE_UNSPECIFIED", "CLIENT_ID_TYPE_DCR", "CLIENT_ID_TYPE_METADATA_URL": + case "CLIENT_ID_TYPE_UNSPECIFIED", "CLIENT_ID_TYPE_DCR", "CLIENT_ID_TYPE_METADATA_URL", "CLIENT_ID_TYPE_APP": return true } } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/finding.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/finding.go index 2584b1e3..df51f399 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/finding.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/finding.go @@ -96,6 +96,13 @@ func (e *FindingState) IsExact() bool { // - decoyCredentialUsed // - custom // - connectorAnomalyDetectionDisabled +// - deactivatedOwner +// - unusedSecret +// - credentialPubliclyExposed +// - decoyPubliclyExposed +// - credentialExpiring +// - connectorSyncFailing +// - shadowMcp // // This message contains a oneof named target. Only a single field of the following list may be set at a time: // - identityUserTarget @@ -108,23 +115,50 @@ func (e *FindingState) IsExact() bool { // This message contains a oneof named evidence. Only a single field of the following list may be set at a time: // - similarUsernameMatchEvidence // - serviceAccountMisclassificationEvidence +// - deactivatedOwnerEvidence +// - unusedSecretEvidence +// - credentialPubliclyExposedEvidence +// - decoyPubliclyExposedEvidence +// - credentialExpiringEvidence +// - connectorSyncFailingEvidence +// - shadowMcpEvidence type Finding struct { + // Bounded key/value metadata bag. Limits: ≤16 entries; keys 1-128 chars + // matching ^[A-Za-z][A-Za-z0-9._/-]{0,127}$; values 0-256 chars; total + // serialized ≤4096 bytes. Keys matching ^c1/ are reserved. Also readable + // (and settable) via CEL as both finding.annotations and finding.custom_tags. + Annotations map[string]string `json:"annotations,omitempty"` // The appId field. - AppID *string `json:"appId,omitempty"` - AppResourceTarget *AppResourceTarget `json:"appResourceTarget,omitempty"` - AppUserTarget *AppUserTarget `json:"appUserTarget,omitempty"` - AssignedOwner *FindingOwnerRef `json:"assignedOwner,omitempty"` + AppID *string `json:"appId,omitempty"` + AppResourceTarget *AppResourceTarget `json:"appResourceTarget,omitempty"` + AppUserTarget *AppUserTarget `json:"appUserTarget,omitempty"` + AssignedOwner *FindingOwnerRef `json:"assignedOwner,omitempty"` + // Identity user this finding is assigned to. Empty when unassigned. + AssigneeIdentityUserID *string `json:"assigneeIdentityUserId,omitempty"` ComputedOwner *FindingOwnerRef `json:"computedOwner,omitempty"` ConnectorAnomalyDetectionDisabled *ConnectorAnomalyDetectionDisabledType `json:"connectorAnomalyDetectionDisabled,omitempty"` + ConnectorSyncFailing *ConnectorSyncFailingType `json:"connectorSyncFailing,omitempty"` + ConnectorSyncFailingEvidence *ConnectorSyncFailingEvidence `json:"connectorSyncFailingEvidence,omitempty"` ConnectorTarget *ConnectorTarget `json:"connectorTarget,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` + CredentialExpiring *CredentialExpiringType `json:"credentialExpiring,omitempty"` + CredentialExpiringEvidence *CredentialExpiringEvidence `json:"credentialExpiringEvidence,omitempty"` + CredentialPubliclyExposed *CredentialPubliclyExposedType `json:"credentialPubliclyExposed,omitempty"` + CredentialPubliclyExposedEvidence *CredentialPubliclyExposedEvidence `json:"credentialPubliclyExposedEvidence,omitempty"` Custom *CustomFindingType `json:"custom,omitempty"` // User-supplied sub-classification for custom findings (e.g. "shadow_it"). CustomSubType *string `json:"customSubType,omitempty"` - // The customTags field. - CustomTags map[string]string `json:"customTags,omitempty"` - DecoyCredentialUsed *DecoyCredentialUsedType `json:"decoyCredentialUsed,omitempty"` - DecoyTarget *DecoyTarget `json:"decoyTarget,omitempty"` + // Deprecated: use annotations instead. Read-only mirror of annotations; + // writes to this field are ignored. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + CustomTags map[string]string `json:"customTags,omitempty"` + DeactivatedOwner *DeactivatedOwnerType `json:"deactivatedOwner,omitempty"` + DeactivatedOwnerEvidence *DeactivatedOwnerEvidence `json:"deactivatedOwnerEvidence,omitempty"` + DecoyCredentialUsed *DecoyCredentialUsedType `json:"decoyCredentialUsed,omitempty"` + DecoyPubliclyExposed *DecoyPubliclyExposedType `json:"decoyPubliclyExposed,omitempty"` + DecoyPubliclyExposedEvidence *DecoyPubliclyExposedEvidence `json:"decoyPubliclyExposedEvidence,omitempty"` + DecoyTarget *DecoyTarget `json:"decoyTarget,omitempty"` // Caller-supplied dedup identity for custom findings; echoed back so IaC // clients can roundtrip it. Empty for detector findings. DedupKeyParts []string `json:"dedupKeyParts,omitempty"` @@ -134,11 +168,12 @@ type Finding struct { Fingerprint *string `json:"fingerprint,omitempty"` FirstObservedAt *time.Time `json:"firstObservedAt,omitempty"` // The id field. - ID *string `json:"id,omitempty"` - IdentityUserTarget *IdentityUserTarget `json:"identityUserTarget,omitempty"` - LastAppearedAt *time.Time `json:"lastAppearedAt,omitempty"` - LastObservedAt *time.Time `json:"lastObservedAt,omitempty"` - NhiUnowned *NhiUnownedType `json:"nhiUnowned,omitempty"` + ID *string `json:"id,omitempty"` + IdentityUserTarget *IdentityUserTarget `json:"identityUserTarget,omitempty"` + LastAppearedAt *time.Time `json:"lastAppearedAt,omitempty"` + LastObservedAt *time.Time `json:"lastObservedAt,omitempty"` + NhiUnowned *NhiUnownedType `json:"nhiUnowned,omitempty"` + ObjectPermissions *UserActorObjectPermissions `json:"objectPermissions,omitempty"` // The recurrenceCount field. RecurrenceCount *int64 `json:"recurrenceCount,omitempty"` // The remediationDescription field. @@ -153,6 +188,8 @@ type Finding struct { ServiceAccountUnowned *ServiceAccountUnownedType `json:"serviceAccountUnowned,omitempty"` // The severity field. Severity *FindingSeverity `json:"severity,omitempty"` + ShadowMcp *ShadowMcpType `json:"shadowMcp,omitempty"` + ShadowMcpEvidence *ShadowMcpEvidence `json:"shadowMcpEvidence,omitempty"` SimilarUsernameMatch *SimilarUsernameMatchType `json:"similarUsernameMatch,omitempty"` SimilarUsernameMatchEvidence *SimilarUsernameMatchEvidence `json:"similarUsernameMatchEvidence,omitempty"` // The snoozeReason field. @@ -164,14 +201,18 @@ type Finding struct { SourceKind *SourceKind `json:"sourceKind,omitempty"` // The state field. State *FindingState `json:"state,omitempty"` - // The stateUpdatedById field. + // The human who authored the CURRENT state. Empty when a routing rule or the + // system authored it, so do not read a populated value as "this finding has a + // human owner" -- read it as "a human set the state it is in right now". StateUpdatedByID *string `json:"stateUpdatedById,omitempty"` // The suppressReason field. SuppressReason *string `json:"suppressReason,omitempty"` // The taskId field. - TaskID *string `json:"taskId,omitempty"` - TenantTarget *TenantTarget `json:"tenantTarget,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + TaskID *string `json:"taskId,omitempty"` + TenantTarget *TenantTarget `json:"tenantTarget,omitempty"` + UnusedSecret *UnusedSecretType `json:"unusedSecret,omitempty"` + UnusedSecretEvidence *UnusedSecretEvidence `json:"unusedSecretEvidence,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` } func (f Finding) MarshalJSON() ([]byte, error) { @@ -185,6 +226,13 @@ func (f *Finding) UnmarshalJSON(data []byte) error { return nil } +func (f *Finding) GetAnnotations() map[string]string { + if f == nil { + return nil + } + return f.Annotations +} + func (f *Finding) GetAppID() *string { if f == nil { return nil @@ -213,6 +261,13 @@ func (f *Finding) GetAssignedOwner() *FindingOwnerRef { return f.AssignedOwner } +func (f *Finding) GetAssigneeIdentityUserID() *string { + if f == nil { + return nil + } + return f.AssigneeIdentityUserID +} + func (f *Finding) GetComputedOwner() *FindingOwnerRef { if f == nil { return nil @@ -227,6 +282,20 @@ func (f *Finding) GetConnectorAnomalyDetectionDisabled() *ConnectorAnomalyDetect return f.ConnectorAnomalyDetectionDisabled } +func (f *Finding) GetConnectorSyncFailing() *ConnectorSyncFailingType { + if f == nil { + return nil + } + return f.ConnectorSyncFailing +} + +func (f *Finding) GetConnectorSyncFailingEvidence() *ConnectorSyncFailingEvidence { + if f == nil { + return nil + } + return f.ConnectorSyncFailingEvidence +} + func (f *Finding) GetConnectorTarget() *ConnectorTarget { if f == nil { return nil @@ -241,6 +310,34 @@ func (f *Finding) GetCreatedAt() *time.Time { return f.CreatedAt } +func (f *Finding) GetCredentialExpiring() *CredentialExpiringType { + if f == nil { + return nil + } + return f.CredentialExpiring +} + +func (f *Finding) GetCredentialExpiringEvidence() *CredentialExpiringEvidence { + if f == nil { + return nil + } + return f.CredentialExpiringEvidence +} + +func (f *Finding) GetCredentialPubliclyExposed() *CredentialPubliclyExposedType { + if f == nil { + return nil + } + return f.CredentialPubliclyExposed +} + +func (f *Finding) GetCredentialPubliclyExposedEvidence() *CredentialPubliclyExposedEvidence { + if f == nil { + return nil + } + return f.CredentialPubliclyExposedEvidence +} + func (f *Finding) GetCustom() *CustomFindingType { if f == nil { return nil @@ -262,6 +359,20 @@ func (f *Finding) GetCustomTags() map[string]string { return f.CustomTags } +func (f *Finding) GetDeactivatedOwner() *DeactivatedOwnerType { + if f == nil { + return nil + } + return f.DeactivatedOwner +} + +func (f *Finding) GetDeactivatedOwnerEvidence() *DeactivatedOwnerEvidence { + if f == nil { + return nil + } + return f.DeactivatedOwnerEvidence +} + func (f *Finding) GetDecoyCredentialUsed() *DecoyCredentialUsedType { if f == nil { return nil @@ -269,6 +380,20 @@ func (f *Finding) GetDecoyCredentialUsed() *DecoyCredentialUsedType { return f.DecoyCredentialUsed } +func (f *Finding) GetDecoyPubliclyExposed() *DecoyPubliclyExposedType { + if f == nil { + return nil + } + return f.DecoyPubliclyExposed +} + +func (f *Finding) GetDecoyPubliclyExposedEvidence() *DecoyPubliclyExposedEvidence { + if f == nil { + return nil + } + return f.DecoyPubliclyExposedEvidence +} + func (f *Finding) GetDecoyTarget() *DecoyTarget { if f == nil { return nil @@ -339,6 +464,13 @@ func (f *Finding) GetNhiUnowned() *NhiUnownedType { return f.NhiUnowned } +func (f *Finding) GetObjectPermissions() *UserActorObjectPermissions { + if f == nil { + return nil + } + return f.ObjectPermissions +} + func (f *Finding) GetRecurrenceCount() *int64 { if f == nil { return nil @@ -409,6 +541,20 @@ func (f *Finding) GetSeverity() *FindingSeverity { return f.Severity } +func (f *Finding) GetShadowMcp() *ShadowMcpType { + if f == nil { + return nil + } + return f.ShadowMcp +} + +func (f *Finding) GetShadowMcpEvidence() *ShadowMcpEvidence { + if f == nil { + return nil + } + return f.ShadowMcpEvidence +} + func (f *Finding) GetSimilarUsernameMatch() *SimilarUsernameMatchType { if f == nil { return nil @@ -486,6 +632,20 @@ func (f *Finding) GetTenantTarget() *TenantTarget { return f.TenantTarget } +func (f *Finding) GetUnusedSecret() *UnusedSecretType { + if f == nil { + return nil + } + return f.UnusedSecret +} + +func (f *Finding) GetUnusedSecretEvidence() *UnusedSecretEvidence { + if f == nil { + return nil + } + return f.UnusedSecretEvidence +} + func (f *Finding) GetUpdatedAt() *time.Time { if f == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingaudience.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingaudience.go new file mode 100644 index 00000000..83cbc4fb --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingaudience.go @@ -0,0 +1,21 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// FindingAudience resolves to a set of identity user IDs to notify. Step-less: +// +// notifications have no escalation ladder. An empty resolution falls back to +// enabled system owners rather than notifying nobody. +// +// This message contains a oneof named typ. Only a single field of the following list may be set at a time: +// - users +type FindingAudience struct { + Users *FindingAudienceUsers `json:"users,omitempty"` +} + +func (f *FindingAudience) GetUsers() *FindingAudienceUsers { + if f == nil { + return nil + } + return f.Users +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingaudienceusers.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingaudienceusers.go new file mode 100644 index 00000000..4263ab5b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingaudienceusers.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FindingAudienceUsers message. +type FindingAudienceUsers struct { + // The userIds field. + UserIds []string `json:"userIds,omitempty"` +} + +func (f *FindingAudienceUsers) GetUserIds() []string { + if f == nil { + return nil + } + return f.UserIds +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingauditevent.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingauditevent.go index d21f08f9..159f1392 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingauditevent.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingauditevent.go @@ -30,6 +30,9 @@ const ( FindingAuditEventEventTypeFindingAuditEventTypeEvidenceUpdated FindingAuditEventEventType = "FINDING_AUDIT_EVENT_TYPE_EVIDENCE_UPDATED" FindingAuditEventEventTypeFindingAuditEventTypeRoutingEvaluated FindingAuditEventEventType = "FINDING_AUDIT_EVENT_TYPE_ROUTING_EVALUATED" FindingAuditEventEventTypeFindingAuditEventTypeTransformed FindingAuditEventEventType = "FINDING_AUDIT_EVENT_TYPE_TRANSFORMED" + FindingAuditEventEventTypeFindingAuditEventTypeReprocessRequested FindingAuditEventEventType = "FINDING_AUDIT_EVENT_TYPE_REPROCESS_REQUESTED" + FindingAuditEventEventTypeFindingAuditEventTypeReprocessCompleted FindingAuditEventEventType = "FINDING_AUDIT_EVENT_TYPE_REPROCESS_COMPLETED" + FindingAuditEventEventTypeFindingAuditEventTypeAssigneeChanged FindingAuditEventEventType = "FINDING_AUDIT_EVENT_TYPE_ASSIGNEE_CHANGED" ) func (e FindingAuditEventEventType) ToPointer() *FindingAuditEventEventType { @@ -40,7 +43,7 @@ func (e FindingAuditEventEventType) ToPointer() *FindingAuditEventEventType { func (e *FindingAuditEventEventType) IsExact() bool { if e != nil { switch *e { - case "FINDING_AUDIT_EVENT_TYPE_UNSPECIFIED", "FINDING_AUDIT_EVENT_TYPE_CREATED", "FINDING_AUDIT_EVENT_TYPE_STATE_CHANGED", "FINDING_AUDIT_EVENT_TYPE_SNOOZED", "FINDING_AUDIT_EVENT_TYPE_SNOOZE_EXPIRED", "FINDING_AUDIT_EVENT_TYPE_RISK_ACCEPTED", "FINDING_AUDIT_EVENT_TYPE_RISK_ACCEPTANCE_EXPIRED", "FINDING_AUDIT_EVENT_TYPE_SUPPRESSED", "FINDING_AUDIT_EVENT_TYPE_UNSUPPRESSED", "FINDING_AUDIT_EVENT_TYPE_RESOLVED", "FINDING_AUDIT_EVENT_TYPE_REOPENED", "FINDING_AUDIT_EVENT_TYPE_OWNER_CHANGED", "FINDING_AUDIT_EVENT_TYPE_SEVERITY_OVERRIDDEN", "FINDING_AUDIT_EVENT_TYPE_COMMENT", "FINDING_AUDIT_EVENT_TYPE_TASK_CREATED", "FINDING_AUDIT_EVENT_TYPE_TASK_CANCELLED", "FINDING_AUDIT_EVENT_TYPE_EVIDENCE_UPDATED", "FINDING_AUDIT_EVENT_TYPE_ROUTING_EVALUATED", "FINDING_AUDIT_EVENT_TYPE_TRANSFORMED": + case "FINDING_AUDIT_EVENT_TYPE_UNSPECIFIED", "FINDING_AUDIT_EVENT_TYPE_CREATED", "FINDING_AUDIT_EVENT_TYPE_STATE_CHANGED", "FINDING_AUDIT_EVENT_TYPE_SNOOZED", "FINDING_AUDIT_EVENT_TYPE_SNOOZE_EXPIRED", "FINDING_AUDIT_EVENT_TYPE_RISK_ACCEPTED", "FINDING_AUDIT_EVENT_TYPE_RISK_ACCEPTANCE_EXPIRED", "FINDING_AUDIT_EVENT_TYPE_SUPPRESSED", "FINDING_AUDIT_EVENT_TYPE_UNSUPPRESSED", "FINDING_AUDIT_EVENT_TYPE_RESOLVED", "FINDING_AUDIT_EVENT_TYPE_REOPENED", "FINDING_AUDIT_EVENT_TYPE_OWNER_CHANGED", "FINDING_AUDIT_EVENT_TYPE_SEVERITY_OVERRIDDEN", "FINDING_AUDIT_EVENT_TYPE_COMMENT", "FINDING_AUDIT_EVENT_TYPE_TASK_CREATED", "FINDING_AUDIT_EVENT_TYPE_TASK_CANCELLED", "FINDING_AUDIT_EVENT_TYPE_EVIDENCE_UPDATED", "FINDING_AUDIT_EVENT_TYPE_ROUTING_EVALUATED", "FINDING_AUDIT_EVENT_TYPE_TRANSFORMED", "FINDING_AUDIT_EVENT_TYPE_REPROCESS_REQUESTED", "FINDING_AUDIT_EVENT_TYPE_REPROCESS_COMPLETED", "FINDING_AUDIT_EVENT_TYPE_ASSIGNEE_CHANGED": return true } } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingauditservicesearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingauditservicesearchrequest.go index 9708b1ca..9ceea9c9 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingauditservicesearchrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingauditservicesearchrequest.go @@ -29,6 +29,9 @@ const ( EventTypesFindingAuditEventTypeEvidenceUpdated EventTypes = "FINDING_AUDIT_EVENT_TYPE_EVIDENCE_UPDATED" EventTypesFindingAuditEventTypeRoutingEvaluated EventTypes = "FINDING_AUDIT_EVENT_TYPE_ROUTING_EVALUATED" EventTypesFindingAuditEventTypeTransformed EventTypes = "FINDING_AUDIT_EVENT_TYPE_TRANSFORMED" + EventTypesFindingAuditEventTypeReprocessRequested EventTypes = "FINDING_AUDIT_EVENT_TYPE_REPROCESS_REQUESTED" + EventTypesFindingAuditEventTypeReprocessCompleted EventTypes = "FINDING_AUDIT_EVENT_TYPE_REPROCESS_COMPLETED" + EventTypesFindingAuditEventTypeAssigneeChanged EventTypes = "FINDING_AUDIT_EVENT_TYPE_ASSIGNEE_CHANGED" ) func (e EventTypes) ToPointer() *EventTypes { @@ -39,7 +42,7 @@ func (e EventTypes) ToPointer() *EventTypes { func (e *EventTypes) IsExact() bool { if e != nil { switch *e { - case "FINDING_AUDIT_EVENT_TYPE_UNSPECIFIED", "FINDING_AUDIT_EVENT_TYPE_CREATED", "FINDING_AUDIT_EVENT_TYPE_STATE_CHANGED", "FINDING_AUDIT_EVENT_TYPE_SNOOZED", "FINDING_AUDIT_EVENT_TYPE_SNOOZE_EXPIRED", "FINDING_AUDIT_EVENT_TYPE_RISK_ACCEPTED", "FINDING_AUDIT_EVENT_TYPE_RISK_ACCEPTANCE_EXPIRED", "FINDING_AUDIT_EVENT_TYPE_SUPPRESSED", "FINDING_AUDIT_EVENT_TYPE_UNSUPPRESSED", "FINDING_AUDIT_EVENT_TYPE_RESOLVED", "FINDING_AUDIT_EVENT_TYPE_REOPENED", "FINDING_AUDIT_EVENT_TYPE_OWNER_CHANGED", "FINDING_AUDIT_EVENT_TYPE_SEVERITY_OVERRIDDEN", "FINDING_AUDIT_EVENT_TYPE_COMMENT", "FINDING_AUDIT_EVENT_TYPE_TASK_CREATED", "FINDING_AUDIT_EVENT_TYPE_TASK_CANCELLED", "FINDING_AUDIT_EVENT_TYPE_EVIDENCE_UPDATED", "FINDING_AUDIT_EVENT_TYPE_ROUTING_EVALUATED", "FINDING_AUDIT_EVENT_TYPE_TRANSFORMED": + case "FINDING_AUDIT_EVENT_TYPE_UNSPECIFIED", "FINDING_AUDIT_EVENT_TYPE_CREATED", "FINDING_AUDIT_EVENT_TYPE_STATE_CHANGED", "FINDING_AUDIT_EVENT_TYPE_SNOOZED", "FINDING_AUDIT_EVENT_TYPE_SNOOZE_EXPIRED", "FINDING_AUDIT_EVENT_TYPE_RISK_ACCEPTED", "FINDING_AUDIT_EVENT_TYPE_RISK_ACCEPTANCE_EXPIRED", "FINDING_AUDIT_EVENT_TYPE_SUPPRESSED", "FINDING_AUDIT_EVENT_TYPE_UNSUPPRESSED", "FINDING_AUDIT_EVENT_TYPE_RESOLVED", "FINDING_AUDIT_EVENT_TYPE_REOPENED", "FINDING_AUDIT_EVENT_TYPE_OWNER_CHANGED", "FINDING_AUDIT_EVENT_TYPE_SEVERITY_OVERRIDDEN", "FINDING_AUDIT_EVENT_TYPE_COMMENT", "FINDING_AUDIT_EVENT_TYPE_TASK_CREATED", "FINDING_AUDIT_EVENT_TYPE_TASK_CANCELLED", "FINDING_AUDIT_EVENT_TYPE_EVIDENCE_UPDATED", "FINDING_AUDIT_EVENT_TYPE_ROUTING_EVALUATED", "FINDING_AUDIT_EVENT_TYPE_TRANSFORMED", "FINDING_AUDIT_EVENT_TYPE_REPROCESS_REQUESTED", "FINDING_AUDIT_EVENT_TYPE_REPROCESS_COMPLETED", "FINDING_AUDIT_EVENT_TYPE_ASSIGNEE_CHANGED": return true } } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingdispatcher.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingdispatcher.go new file mode 100644 index 00000000..93095ce2 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingdispatcher.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// TierOverride - Author tier override; may only tighten the derived tier. +type TierOverride string + +const ( + TierOverrideFindingDispatchTierUnspecified TierOverride = "FINDING_DISPATCH_TIER_UNSPECIFIED" + TierOverrideFindingDispatchTierAuto TierOverride = "FINDING_DISPATCH_TIER_AUTO" + TierOverrideFindingDispatchTierRequiresApproval TierOverride = "FINDING_DISPATCH_TIER_REQUIRES_APPROVAL" +) + +func (e TierOverride) ToPointer() *TierOverride { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *TierOverride) IsExact() bool { + if e != nil { + switch *e { + case "FINDING_DISPATCH_TIER_UNSPECIFIED", "FINDING_DISPATCH_TIER_AUTO", "FINDING_DISPATCH_TIER_REQUIRES_APPROVAL": + return true + } + } + return false +} + +// FindingDispatcher is one dispatch that fires when a routing rule matches (the +// +// "Then dispatch" authoring step). A rule carries zero-to-many; every enabled +// dispatcher fires, order-independent. +// +// This message contains a oneof named kind. Only a single field of the following list may be set at a time: +// - triggerAutomation +// - invokeFunction +// - webhook +// - notify +type FindingDispatcher struct { + // Human-facing label. Optional. + DisplayName *string `json:"displayName,omitempty"` + // Per-dispatcher kill switch. + Enabled *bool `json:"enabled,omitempty"` + InvokeFunction *InvokeFunctionDispatcher `json:"invokeFunction,omitempty"` + // Stable id within the rule; survives edits, part of the dispatch idempotency + // key. Minted server-side when empty. + Key *string `json:"key,omitempty"` + Notify *NotifyDispatcher `json:"notify,omitempty"` + NotifyOnOutcome *FindingDispatchOutcomeNotify `json:"notifyOnOutcome,omitempty"` + // Author tier override; may only tighten the derived tier. + TierOverride *TierOverride `json:"tierOverride,omitempty"` + TriggerAutomation *TriggerAutomationDispatcher `json:"triggerAutomation,omitempty"` + Webhook *WebhookDispatcher `json:"webhook,omitempty"` +} + +func (f *FindingDispatcher) GetDisplayName() *string { + if f == nil { + return nil + } + return f.DisplayName +} + +func (f *FindingDispatcher) GetEnabled() *bool { + if f == nil { + return nil + } + return f.Enabled +} + +func (f *FindingDispatcher) GetInvokeFunction() *InvokeFunctionDispatcher { + if f == nil { + return nil + } + return f.InvokeFunction +} + +func (f *FindingDispatcher) GetKey() *string { + if f == nil { + return nil + } + return f.Key +} + +func (f *FindingDispatcher) GetNotify() *NotifyDispatcher { + if f == nil { + return nil + } + return f.Notify +} + +func (f *FindingDispatcher) GetNotifyOnOutcome() *FindingDispatchOutcomeNotify { + if f == nil { + return nil + } + return f.NotifyOnOutcome +} + +func (f *FindingDispatcher) GetTierOverride() *TierOverride { + if f == nil { + return nil + } + return f.TierOverride +} + +func (f *FindingDispatcher) GetTriggerAutomation() *TriggerAutomationDispatcher { + if f == nil { + return nil + } + return f.TriggerAutomation +} + +func (f *FindingDispatcher) GetWebhook() *WebhookDispatcher { + if f == nil { + return nil + } + return f.Webhook +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingdispatchoutcomenotify.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingdispatchoutcomenotify.go new file mode 100644 index 00000000..f7cf98ca --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingdispatchoutcomenotify.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// FindingDispatchOutcomeNotify notifies recipients once a dispatch settles. +type FindingDispatchOutcomeNotify struct { + // The onDone field. + OnDone *bool `json:"onDone,omitempty"` + // The onError field. + OnError *bool `json:"onError,omitempty"` + // The recipients field. + Recipients []string `json:"recipients,omitempty"` +} + +func (f *FindingDispatchOutcomeNotify) GetOnDone() *bool { + if f == nil { + return nil + } + return f.OnDone +} + +func (f *FindingDispatchOutcomeNotify) GetOnError() *bool { + if f == nil { + return nil + } + return f.OnError +} + +func (f *FindingDispatchOutcomeNotify) GetRecipients() []string { + if f == nil { + return nil + } + return f.Recipients +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingroutingrule.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingroutingrule.go index 52811670..07e243c0 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingroutingrule.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingroutingrule.go @@ -7,6 +7,42 @@ import ( "time" ) +// FindingType - The findingType field. +type FindingType string + +const ( + FindingTypeFindingTypeUnspecified FindingType = "FINDING_TYPE_UNSPECIFIED" + FindingTypeFindingTypeSimilarUsernameMatch FindingType = "FINDING_TYPE_SIMILAR_USERNAME_MATCH" + FindingTypeFindingTypeServiceAccountMisclassification FindingType = "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION" + FindingTypeFindingTypeNhiUnowned FindingType = "FINDING_TYPE_NHI_UNOWNED" + FindingTypeFindingTypeServiceAccountUnowned FindingType = "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED" + FindingTypeFindingTypeDecoyCredentialUsed FindingType = "FINDING_TYPE_DECOY_CREDENTIAL_USED" + FindingTypeFindingTypeCustom FindingType = "FINDING_TYPE_CUSTOM" + FindingTypeFindingTypeConnectorAnomalyDetectionDisabled FindingType = "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED" + FindingTypeFindingTypeDeactivatedOwner FindingType = "FINDING_TYPE_DEACTIVATED_OWNER" + FindingTypeFindingTypeUnusedSecret FindingType = "FINDING_TYPE_UNUSED_SECRET" + FindingTypeFindingTypeCredentialPubliclyExposed FindingType = "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED" + FindingTypeFindingTypeDecoyPubliclyExposed FindingType = "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED" + FindingTypeFindingTypeCredentialExpiring FindingType = "FINDING_TYPE_CREDENTIAL_EXPIRING" + FindingTypeFindingTypeConnectorSyncFailing FindingType = "FINDING_TYPE_CONNECTOR_SYNC_FAILING" + FindingTypeFindingTypeShadowMcp FindingType = "FINDING_TYPE_SHADOW_MCP" +) + +func (e FindingType) ToPointer() *FindingType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *FindingType) IsExact() bool { + if e != nil { + switch *e { + case "FINDING_TYPE_UNSPECIFIED", "FINDING_TYPE_SIMILAR_USERNAME_MATCH", "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION", "FINDING_TYPE_NHI_UNOWNED", "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED", "FINDING_TYPE_DECOY_CREDENTIAL_USED", "FINDING_TYPE_CUSTOM", "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED", "FINDING_TYPE_DEACTIVATED_OWNER", "FINDING_TYPE_UNUSED_SECRET", "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED", "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED", "FINDING_TYPE_CREDENTIAL_EXPIRING", "FINDING_TYPE_CONNECTOR_SYNC_FAILING", "FINDING_TYPE_SHADOW_MCP": + return true + } + } + return false +} + // The FindingRoutingRule message. type FindingRoutingRule struct { Action *FindingRoutingRuleAction `json:"action,omitempty"` @@ -17,10 +53,14 @@ type FindingRoutingRule struct { CreatedAt *time.Time `json:"createdAt,omitempty"` // The description field. Description *string `json:"description,omitempty"` + // Dispatchers that fire when the rule matches ("Then dispatch"). Max 10. + Dispatchers []FindingDispatcher `json:"dispatchers,omitempty"` // The displayName field. DisplayName *string `json:"displayName,omitempty"` // The enabled field. Enabled *bool `json:"enabled,omitempty"` + // The findingType field. + FindingType *FindingType `json:"findingType,omitempty"` // The id field. ID *string `json:"id,omitempty"` // The priority field. @@ -76,6 +116,13 @@ func (f *FindingRoutingRule) GetDescription() *string { return f.Description } +func (f *FindingRoutingRule) GetDispatchers() []FindingDispatcher { + if f == nil { + return nil + } + return f.Dispatchers +} + func (f *FindingRoutingRule) GetDisplayName() *string { if f == nil { return nil @@ -90,6 +137,13 @@ func (f *FindingRoutingRule) GetEnabled() *bool { return f.Enabled } +func (f *FindingRoutingRule) GetFindingType() *FindingType { + if f == nil { + return nil + } + return f.FindingType +} + func (f *FindingRoutingRule) GetID() *string { if f == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingsearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingsearchrequest.go index 3641805d..d326e96b 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingsearchrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingsearchrequest.go @@ -37,6 +37,13 @@ const ( FindingTypesFindingTypeDecoyCredentialUsed FindingTypes = "FINDING_TYPE_DECOY_CREDENTIAL_USED" FindingTypesFindingTypeCustom FindingTypes = "FINDING_TYPE_CUSTOM" FindingTypesFindingTypeConnectorAnomalyDetectionDisabled FindingTypes = "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED" + FindingTypesFindingTypeDeactivatedOwner FindingTypes = "FINDING_TYPE_DEACTIVATED_OWNER" + FindingTypesFindingTypeUnusedSecret FindingTypes = "FINDING_TYPE_UNUSED_SECRET" + FindingTypesFindingTypeCredentialPubliclyExposed FindingTypes = "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED" + FindingTypesFindingTypeDecoyPubliclyExposed FindingTypes = "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED" + FindingTypesFindingTypeCredentialExpiring FindingTypes = "FINDING_TYPE_CREDENTIAL_EXPIRING" + FindingTypesFindingTypeConnectorSyncFailing FindingTypes = "FINDING_TYPE_CONNECTOR_SYNC_FAILING" + FindingTypesFindingTypeShadowMcp FindingTypes = "FINDING_TYPE_SHADOW_MCP" ) func (e FindingTypes) ToPointer() *FindingTypes { @@ -47,28 +54,28 @@ func (e FindingTypes) ToPointer() *FindingTypes { func (e *FindingTypes) IsExact() bool { if e != nil { switch *e { - case "FINDING_TYPE_UNSPECIFIED", "FINDING_TYPE_SIMILAR_USERNAME_MATCH", "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION", "FINDING_TYPE_NHI_UNOWNED", "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED", "FINDING_TYPE_DECOY_CREDENTIAL_USED", "FINDING_TYPE_CUSTOM", "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED": + case "FINDING_TYPE_UNSPECIFIED", "FINDING_TYPE_SIMILAR_USERNAME_MATCH", "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION", "FINDING_TYPE_NHI_UNOWNED", "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED", "FINDING_TYPE_DECOY_CREDENTIAL_USED", "FINDING_TYPE_CUSTOM", "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED", "FINDING_TYPE_DEACTIVATED_OWNER", "FINDING_TYPE_UNUSED_SECRET", "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED", "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED", "FINDING_TYPE_CREDENTIAL_EXPIRING", "FINDING_TYPE_CONNECTOR_SYNC_FAILING", "FINDING_TYPE_SHADOW_MCP": return true } } return false } -type NhiTypes string +type FindingSearchRequestNhiTypes string const ( - NhiTypesNhiTypeUnspecified NhiTypes = "NHI_TYPE_UNSPECIFIED" - NhiTypesNhiTypeAppRegistration NhiTypes = "NHI_TYPE_APP_REGISTRATION" - NhiTypesNhiTypeAssumableRole NhiTypes = "NHI_TYPE_ASSUMABLE_ROLE" - NhiTypesNhiTypeManagedIdentity NhiTypes = "NHI_TYPE_MANAGED_IDENTITY" + FindingSearchRequestNhiTypesNhiTypeUnspecified FindingSearchRequestNhiTypes = "NHI_TYPE_UNSPECIFIED" + FindingSearchRequestNhiTypesNhiTypeAppRegistration FindingSearchRequestNhiTypes = "NHI_TYPE_APP_REGISTRATION" + FindingSearchRequestNhiTypesNhiTypeAssumableRole FindingSearchRequestNhiTypes = "NHI_TYPE_ASSUMABLE_ROLE" + FindingSearchRequestNhiTypesNhiTypeManagedIdentity FindingSearchRequestNhiTypes = "NHI_TYPE_MANAGED_IDENTITY" ) -func (e NhiTypes) ToPointer() *NhiTypes { +func (e FindingSearchRequestNhiTypes) ToPointer() *FindingSearchRequestNhiTypes { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *NhiTypes) IsExact() bool { +func (e *FindingSearchRequestNhiTypes) IsExact() bool { if e != nil { switch *e { case "NHI_TYPE_UNSPECIFIED", "NHI_TYPE_APP_REGISTRATION", "NHI_TYPE_ASSUMABLE_ROLE", "NHI_TYPE_MANAGED_IDENTITY": @@ -176,6 +183,11 @@ type FindingSearchRequest struct { // Filter to findings whose target is an app user of these types (OR within // field). Empty = not applied. AppUserTypes []FindingSearchRequestAppUserTypes `json:"appUserTypes,omitempty"` + // Filter by assignee identity-user IDs (OR within field). Matches findings + // whose assignee_identity_user_id is in this list. The reserved + // "unassigned" sentinel token selects findings with no assignee; real + // identity-user IDs are exactly 27 alphanumerics so the token cannot collide. + AssigneeIdentityUserIds []string `json:"assigneeIdentityUserIds,omitempty"` // Filter by connector IDs (OR within field). Matches findings whose // target.connector_target.connector_id is in this list. ConnectorIds []string `json:"connectorIds,omitempty"` @@ -187,19 +199,17 @@ type FindingSearchRequest struct { DecoyIds []string `json:"decoyIds,omitempty"` // Filter by finding type (OR within field). FindingTypes []FindingTypes `json:"findingTypes,omitempty"` - // When true, includes findings with no effective identity-user owner. An - // explicit predicate for direct API callers who prefer a bool over the - // "unassigned" sentinel in owner_identity_user_ids; both signals are accepted. + // When true, includes findings with no assignee. An explicit predicate for + // direct API callers who prefer a bool over the "unassigned" sentinel in + // assignee_identity_user_ids; both signals are accepted. IncludeUnassigned *bool `json:"includeUnassigned,omitempty"` // Filter to findings whose target resource's nhi_type is one of these (OR // within field). Empty = not applied; pass all NhiType values to match any // nhi resource. - NhiTypes []NhiTypes `json:"nhiTypes,omitempty"` - // Filter by effective owner identity-user IDs (OR within field). Matches - // findings whose effective owner (assigned_owner if set, else computed_owner) - // resolves to an identity user in this list. The reserved "unassigned" - // sentinel token selects findings with no effective identity-user owner; real - // identity-user IDs are exactly 27 alphanumerics so the token cannot collide. + NhiTypes []FindingSearchRequestNhiTypes `json:"nhiTypes,omitempty"` + // Deprecated: use assignee_identity_user_ids instead. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. OwnerIdentityUserIds []string `json:"ownerIdentityUserIds,omitempty"` // Maximum number of findings to return per page. PageSize *int `json:"pageSize,omitempty"` @@ -266,6 +276,13 @@ func (f *FindingSearchRequest) GetAppUserTypes() []FindingSearchRequestAppUserTy return f.AppUserTypes } +func (f *FindingSearchRequest) GetAssigneeIdentityUserIds() []string { + if f == nil { + return nil + } + return f.AssigneeIdentityUserIds +} + func (f *FindingSearchRequest) GetConnectorIds() []string { if f == nil { return nil @@ -301,7 +318,7 @@ func (f *FindingSearchRequest) GetIncludeUnassigned() *bool { return f.IncludeUnassigned } -func (f *FindingSearchRequest) GetNhiTypes() []NhiTypes { +func (f *FindingSearchRequest) GetNhiTypes() []FindingSearchRequestNhiTypes { if f == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingsettingsentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingsettingsentry.go new file mode 100644 index 00000000..9e7d0e04 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingsettingsentry.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// FindingSettingsEntryFindingType - The finding type to configure. Must be a detector-backed type. +type FindingSettingsEntryFindingType string + +const ( + FindingSettingsEntryFindingTypeFindingTypeUnspecified FindingSettingsEntryFindingType = "FINDING_TYPE_UNSPECIFIED" + FindingSettingsEntryFindingTypeFindingTypeSimilarUsernameMatch FindingSettingsEntryFindingType = "FINDING_TYPE_SIMILAR_USERNAME_MATCH" + FindingSettingsEntryFindingTypeFindingTypeServiceAccountMisclassification FindingSettingsEntryFindingType = "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION" + FindingSettingsEntryFindingTypeFindingTypeNhiUnowned FindingSettingsEntryFindingType = "FINDING_TYPE_NHI_UNOWNED" + FindingSettingsEntryFindingTypeFindingTypeServiceAccountUnowned FindingSettingsEntryFindingType = "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED" + FindingSettingsEntryFindingTypeFindingTypeDecoyCredentialUsed FindingSettingsEntryFindingType = "FINDING_TYPE_DECOY_CREDENTIAL_USED" + FindingSettingsEntryFindingTypeFindingTypeCustom FindingSettingsEntryFindingType = "FINDING_TYPE_CUSTOM" + FindingSettingsEntryFindingTypeFindingTypeConnectorAnomalyDetectionDisabled FindingSettingsEntryFindingType = "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED" + FindingSettingsEntryFindingTypeFindingTypeDeactivatedOwner FindingSettingsEntryFindingType = "FINDING_TYPE_DEACTIVATED_OWNER" + FindingSettingsEntryFindingTypeFindingTypeUnusedSecret FindingSettingsEntryFindingType = "FINDING_TYPE_UNUSED_SECRET" + FindingSettingsEntryFindingTypeFindingTypeCredentialPubliclyExposed FindingSettingsEntryFindingType = "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED" + FindingSettingsEntryFindingTypeFindingTypeDecoyPubliclyExposed FindingSettingsEntryFindingType = "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED" + FindingSettingsEntryFindingTypeFindingTypeCredentialExpiring FindingSettingsEntryFindingType = "FINDING_TYPE_CREDENTIAL_EXPIRING" + FindingSettingsEntryFindingTypeFindingTypeConnectorSyncFailing FindingSettingsEntryFindingType = "FINDING_TYPE_CONNECTOR_SYNC_FAILING" + FindingSettingsEntryFindingTypeFindingTypeShadowMcp FindingSettingsEntryFindingType = "FINDING_TYPE_SHADOW_MCP" +) + +func (e FindingSettingsEntryFindingType) ToPointer() *FindingSettingsEntryFindingType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *FindingSettingsEntryFindingType) IsExact() bool { + if e != nil { + switch *e { + case "FINDING_TYPE_UNSPECIFIED", "FINDING_TYPE_SIMILAR_USERNAME_MATCH", "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION", "FINDING_TYPE_NHI_UNOWNED", "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED", "FINDING_TYPE_DECOY_CREDENTIAL_USED", "FINDING_TYPE_CUSTOM", "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED", "FINDING_TYPE_DEACTIVATED_OWNER", "FINDING_TYPE_UNUSED_SECRET", "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED", "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED", "FINDING_TYPE_CREDENTIAL_EXPIRING", "FINDING_TYPE_CONNECTOR_SYNC_FAILING", "FINDING_TYPE_SHADOW_MCP": + return true + } + } + return false +} + +// FindingSettingsEntry is a requested change to one type, which is why it is a +// +// separate message from FindingTypeSetting rather than the same one reused: an +// update needs enum validation and presence on `enabled` so an omitted field is +// an error, while a response always carries a value and must not make callers +// handle an absent one. +type FindingSettingsEntry struct { + // Target state. Required: explicit presence keeps an omitted field from + // reading as false and silently switching a detector off. + Enabled *bool `json:"enabled,omitempty"` + // The finding type to configure. Must be a detector-backed type. + FindingType *FindingSettingsEntryFindingType `json:"findingType,omitempty"` +} + +func (f *FindingSettingsEntry) GetEnabled() *bool { + if f == nil { + return nil + } + return f.Enabled +} + +func (f *FindingSettingsEntry) GetFindingType() *FindingSettingsEntryFindingType { + if f == nil { + return nil + } + return f.FindingType +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingtransformationrule.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingtransformationrule.go index e5f6cb9e..56b6666c 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingtransformationrule.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingtransformationrule.go @@ -7,6 +7,42 @@ import ( "time" ) +// FindingTransformationRuleFindingType - The findingType field. +type FindingTransformationRuleFindingType string + +const ( + FindingTransformationRuleFindingTypeFindingTypeUnspecified FindingTransformationRuleFindingType = "FINDING_TYPE_UNSPECIFIED" + FindingTransformationRuleFindingTypeFindingTypeSimilarUsernameMatch FindingTransformationRuleFindingType = "FINDING_TYPE_SIMILAR_USERNAME_MATCH" + FindingTransformationRuleFindingTypeFindingTypeServiceAccountMisclassification FindingTransformationRuleFindingType = "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION" + FindingTransformationRuleFindingTypeFindingTypeNhiUnowned FindingTransformationRuleFindingType = "FINDING_TYPE_NHI_UNOWNED" + FindingTransformationRuleFindingTypeFindingTypeServiceAccountUnowned FindingTransformationRuleFindingType = "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED" + FindingTransformationRuleFindingTypeFindingTypeDecoyCredentialUsed FindingTransformationRuleFindingType = "FINDING_TYPE_DECOY_CREDENTIAL_USED" + FindingTransformationRuleFindingTypeFindingTypeCustom FindingTransformationRuleFindingType = "FINDING_TYPE_CUSTOM" + FindingTransformationRuleFindingTypeFindingTypeConnectorAnomalyDetectionDisabled FindingTransformationRuleFindingType = "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED" + FindingTransformationRuleFindingTypeFindingTypeDeactivatedOwner FindingTransformationRuleFindingType = "FINDING_TYPE_DEACTIVATED_OWNER" + FindingTransformationRuleFindingTypeFindingTypeUnusedSecret FindingTransformationRuleFindingType = "FINDING_TYPE_UNUSED_SECRET" + FindingTransformationRuleFindingTypeFindingTypeCredentialPubliclyExposed FindingTransformationRuleFindingType = "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED" + FindingTransformationRuleFindingTypeFindingTypeDecoyPubliclyExposed FindingTransformationRuleFindingType = "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED" + FindingTransformationRuleFindingTypeFindingTypeCredentialExpiring FindingTransformationRuleFindingType = "FINDING_TYPE_CREDENTIAL_EXPIRING" + FindingTransformationRuleFindingTypeFindingTypeConnectorSyncFailing FindingTransformationRuleFindingType = "FINDING_TYPE_CONNECTOR_SYNC_FAILING" + FindingTransformationRuleFindingTypeFindingTypeShadowMcp FindingTransformationRuleFindingType = "FINDING_TYPE_SHADOW_MCP" +) + +func (e FindingTransformationRuleFindingType) ToPointer() *FindingTransformationRuleFindingType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *FindingTransformationRuleFindingType) IsExact() bool { + if e != nil { + switch *e { + case "FINDING_TYPE_UNSPECIFIED", "FINDING_TYPE_SIMILAR_USERNAME_MATCH", "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION", "FINDING_TYPE_NHI_UNOWNED", "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED", "FINDING_TYPE_DECOY_CREDENTIAL_USED", "FINDING_TYPE_CUSTOM", "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED", "FINDING_TYPE_DEACTIVATED_OWNER", "FINDING_TYPE_UNUSED_SECRET", "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED", "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED", "FINDING_TYPE_CREDENTIAL_EXPIRING", "FINDING_TYPE_CONNECTOR_SYNC_FAILING", "FINDING_TYPE_SHADOW_MCP": + return true + } + } + return false +} + // FindingTransformationRule transforms a finding at processing time, before // // routing runs. Rules fall through: every matching rule applies its transforms @@ -27,6 +63,8 @@ type FindingTransformationRule struct { // Application order (ascending; last-applied rule wins per field). A sequence, // not a precedence rank. EvaluationOrder *int `json:"evaluationOrder,omitempty"` + // The findingType field. + FindingType *FindingTransformationRuleFindingType `json:"findingType,omitempty"` // The id field. ID *string `json:"id,omitempty"` // The templateId field. @@ -96,6 +134,13 @@ func (f *FindingTransformationRule) GetEvaluationOrder() *int { return f.EvaluationOrder } +func (f *FindingTransformationRule) GetFindingType() *FindingTransformationRuleFindingType { + if f == nil { + return nil + } + return f.FindingType +} + func (f *FindingTransformationRule) GetID() *string { if f == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingtypesetting.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingtypesetting.go new file mode 100644 index 00000000..42a3aa8a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/findingtypesetting.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// FindingTypeSettingFindingType - The findingType field. +type FindingTypeSettingFindingType string + +const ( + FindingTypeSettingFindingTypeFindingTypeUnspecified FindingTypeSettingFindingType = "FINDING_TYPE_UNSPECIFIED" + FindingTypeSettingFindingTypeFindingTypeSimilarUsernameMatch FindingTypeSettingFindingType = "FINDING_TYPE_SIMILAR_USERNAME_MATCH" + FindingTypeSettingFindingTypeFindingTypeServiceAccountMisclassification FindingTypeSettingFindingType = "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION" + FindingTypeSettingFindingTypeFindingTypeNhiUnowned FindingTypeSettingFindingType = "FINDING_TYPE_NHI_UNOWNED" + FindingTypeSettingFindingTypeFindingTypeServiceAccountUnowned FindingTypeSettingFindingType = "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED" + FindingTypeSettingFindingTypeFindingTypeDecoyCredentialUsed FindingTypeSettingFindingType = "FINDING_TYPE_DECOY_CREDENTIAL_USED" + FindingTypeSettingFindingTypeFindingTypeCustom FindingTypeSettingFindingType = "FINDING_TYPE_CUSTOM" + FindingTypeSettingFindingTypeFindingTypeConnectorAnomalyDetectionDisabled FindingTypeSettingFindingType = "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED" + FindingTypeSettingFindingTypeFindingTypeDeactivatedOwner FindingTypeSettingFindingType = "FINDING_TYPE_DEACTIVATED_OWNER" + FindingTypeSettingFindingTypeFindingTypeUnusedSecret FindingTypeSettingFindingType = "FINDING_TYPE_UNUSED_SECRET" + FindingTypeSettingFindingTypeFindingTypeCredentialPubliclyExposed FindingTypeSettingFindingType = "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED" + FindingTypeSettingFindingTypeFindingTypeDecoyPubliclyExposed FindingTypeSettingFindingType = "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED" + FindingTypeSettingFindingTypeFindingTypeCredentialExpiring FindingTypeSettingFindingType = "FINDING_TYPE_CREDENTIAL_EXPIRING" + FindingTypeSettingFindingTypeFindingTypeConnectorSyncFailing FindingTypeSettingFindingType = "FINDING_TYPE_CONNECTOR_SYNC_FAILING" + FindingTypeSettingFindingTypeFindingTypeShadowMcp FindingTypeSettingFindingType = "FINDING_TYPE_SHADOW_MCP" +) + +func (e FindingTypeSettingFindingType) ToPointer() *FindingTypeSettingFindingType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *FindingTypeSettingFindingType) IsExact() bool { + if e != nil { + switch *e { + case "FINDING_TYPE_UNSPECIFIED", "FINDING_TYPE_SIMILAR_USERNAME_MATCH", "FINDING_TYPE_SERVICE_ACCOUNT_MISCLASSIFICATION", "FINDING_TYPE_NHI_UNOWNED", "FINDING_TYPE_SERVICE_ACCOUNT_UNOWNED", "FINDING_TYPE_DECOY_CREDENTIAL_USED", "FINDING_TYPE_CUSTOM", "FINDING_TYPE_CONNECTOR_ANOMALY_DETECTION_DISABLED", "FINDING_TYPE_DEACTIVATED_OWNER", "FINDING_TYPE_UNUSED_SECRET", "FINDING_TYPE_CREDENTIAL_PUBLICLY_EXPOSED", "FINDING_TYPE_DECOY_PUBLICLY_EXPOSED", "FINDING_TYPE_CREDENTIAL_EXPIRING", "FINDING_TYPE_CONNECTOR_SYNC_FAILING", "FINDING_TYPE_SHADOW_MCP": + return true + } + } + return false +} + +// FindingTypeSetting is one finding type's detection switch as it currently +// +// stands. Named for a single type on purpose: the stored model +// c1.models.finding.v1.FindingSettings is the tenant-wide object holding every +// type, and one name for both granularities reads as the same thing twice. +// Display copy for the type is client-owned; this carries state only. +type FindingTypeSetting struct { + // Whether the system detects this finding type. Types never configured read + // back their shipped default, which is per type rather than uniformly on. + Enabled *bool `json:"enabled,omitempty"` + // The findingType field. + FindingType *FindingTypeSettingFindingType `json:"findingType,omitempty"` +} + +func (f *FindingTypeSetting) GetEnabled() *bool { + if f == nil { + return nil + } + return f.Enabled +} + +func (f *FindingTypeSetting) GetFindingType() *FindingTypeSettingFindingType { + if f == nil { + return nil + } + return f.FindingType +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/forcesyncresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/forcesyncresponse.go index 9af1cc2c..0b89e750 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/forcesyncresponse.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/forcesyncresponse.go @@ -2,6 +2,8 @@ package shared -// ForceSyncResponse - Empty response body. Status code indicates success. +// ForceSyncResponse - Empty response body. Status code indicates success. Poll the connector sync status +// +// for progress after ForceSync accepts the request. type ForceSyncResponse struct { } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/formstringfield.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/formstringfield.go index 2bbd79c0..3f9cc872 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/formstringfield.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/formstringfield.go @@ -9,7 +9,9 @@ package shared // - passwordField // - selectField // - pickerField +// - dateField type FormStringField struct { + DateField *DateField `json:"dateField,omitempty"` // The defaultValue field. DefaultValue *string `json:"defaultValue,omitempty"` PasswordField *PasswordField `json:"passwordField,omitempty"` @@ -21,6 +23,13 @@ type FormStringField struct { TextField *TextField `json:"textField,omitempty"` } +func (f *FormStringField) GetDateField() *DateField { + if f == nil { + return nil + } + return f.DateField +} + func (f *FormStringField) GetDefaultValue() *string { if f == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/function.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/function.go index f50a268b..0c5cc9b4 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/function.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/function.go @@ -14,6 +14,7 @@ const ( FunctionTypeFunctionTypeUnspecified FunctionType = "FUNCTION_TYPE_UNSPECIFIED" FunctionTypeFunctionTypeAny FunctionType = "FUNCTION_TYPE_ANY" FunctionTypeFunctionTypeCodeMode FunctionType = "FUNCTION_TYPE_CODE_MODE" + FunctionTypeFunctionTypeConnector FunctionType = "FUNCTION_TYPE_CONNECTOR" ) func (e FunctionType) ToPointer() *FunctionType { @@ -24,7 +25,7 @@ func (e FunctionType) ToPointer() *FunctionType { func (e *FunctionType) IsExact() bool { if e != nil { switch *e { - case "FUNCTION_TYPE_UNSPECIFIED", "FUNCTION_TYPE_ANY", "FUNCTION_TYPE_CODE_MODE": + case "FUNCTION_TYPE_UNSPECIFIED", "FUNCTION_TYPE_ANY", "FUNCTION_TYPE_CODE_MODE", "FUNCTION_TYPE_CONNECTOR": return true } } @@ -33,8 +34,15 @@ func (e *FunctionType) IsExact() bool { // Function represents a customer-provided code extension in the API type Function struct { - CreatedAt *time.Time `json:"createdAt,omitempty"` - DeletedAt *time.Time `json:"deletedAt,omitempty"` + // browser_enabled marks the function as browser-capable: the executor + // supervises a headless Chromium plus a default-deny egress proxy and + // exposes CDP on loopback to the function's sandbox. Toggling it changes + // the deployed image contents and executor arguments, so an update that + // touches it triggers a redeployment, same as secrets or the outbound + // network allowlist. + BrowserEnabled *bool `json:"browserEnabled,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` // The description field. Description *string `json:"description,omitempty"` // The displayName field. @@ -43,6 +51,11 @@ type Function struct { FunctionType *FunctionType `json:"functionType,omitempty"` // The head field. Head *string `json:"head,omitempty"` + // IDs of every non-deleted hook that still references this function. + // Read-only: maintained by the Hook API, not by CreateFunction/UpdateFunction. + // Non-empty means DeleteFunction will refuse to delete until these are + // removed or retargeted. + HookRefs []string `json:"hookRefs,omitempty"` // The id field. ID *string `json:"id,omitempty"` // The isDraft field. @@ -74,6 +87,9 @@ type Function struct { // tenant has completed the FunctionsToSPN migration) and by the migration // itself, never by UpdateFunction. Retired once all functions are on SPN. UseSpn *bool `json:"useSpn,omitempty"` + // IDs of every non-deleted workflow template whose CallFunction step still + // references this function. Read-only, same semantics as hook_refs. + WorkflowTemplateRefs []string `json:"workflowTemplateRefs,omitempty"` } func (f Function) MarshalJSON() ([]byte, error) { @@ -87,6 +103,13 @@ func (f *Function) UnmarshalJSON(data []byte) error { return nil } +func (f *Function) GetBrowserEnabled() *bool { + if f == nil { + return nil + } + return f.BrowserEnabled +} + func (f *Function) GetCreatedAt() *time.Time { if f == nil { return nil @@ -129,6 +152,13 @@ func (f *Function) GetHead() *string { return f.Head } +func (f *Function) GetHookRefs() []string { + if f == nil { + return nil + } + return f.HookRefs +} + func (f *Function) GetID() *string { if f == nil { return nil @@ -192,8 +222,22 @@ func (f *Function) GetUseSpn() *bool { return f.UseSpn } +func (f *Function) GetWorkflowTemplateRefs() []string { + if f == nil { + return nil + } + return f.WorkflowTemplateRefs +} + // FunctionInput - Function represents a customer-provided code extension in the API type FunctionInput struct { + // browser_enabled marks the function as browser-capable: the executor + // supervises a headless Chromium plus a default-deny egress proxy and + // exposes CDP on loopback to the function's sandbox. Toggling it changes + // the deployed image contents and executor arguments, so an update that + // touches it triggers a redeployment, same as secrets or the outbound + // network allowlist. + BrowserEnabled *bool `json:"browserEnabled,omitempty"` // The description field. Description *string `json:"description,omitempty"` // The displayName field. @@ -227,6 +271,13 @@ type FunctionInput struct { Secret map[string]string `json:"secret,omitempty"` } +func (f *FunctionInput) GetBrowserEnabled() *bool { + if f == nil { + return nil + } + return f.BrowserEnabled +} + func (f *FunctionInput) GetDescription() *string { if f == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functioninvocation.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functioninvocation.go index 9ff7a1e3..4f9ba704 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functioninvocation.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functioninvocation.go @@ -11,11 +11,14 @@ import ( type FunctionInvocationStatus string const ( - FunctionInvocationStatusFunctionInvocationStatusUnspecified FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_UNSPECIFIED" - FunctionInvocationStatusFunctionInvocationStatusPending FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_PENDING" - FunctionInvocationStatusFunctionInvocationStatusRunning FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_RUNNING" - FunctionInvocationStatusFunctionInvocationStatusSuccess FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_SUCCESS" - FunctionInvocationStatusFunctionInvocationStatusError FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_ERROR" + FunctionInvocationStatusFunctionInvocationStatusUnspecified FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_UNSPECIFIED" + FunctionInvocationStatusFunctionInvocationStatusPending FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_PENDING" + FunctionInvocationStatusFunctionInvocationStatusRunning FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_RUNNING" + FunctionInvocationStatusFunctionInvocationStatusSuccess FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_SUCCESS" + FunctionInvocationStatusFunctionInvocationStatusError FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_ERROR" + FunctionInvocationStatusFunctionInvocationStatusCancellationRequested FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_CANCELLATION_REQUESTED" + FunctionInvocationStatusFunctionInvocationStatusCancelled FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_CANCELLED" + FunctionInvocationStatusFunctionInvocationStatusUnknown FunctionInvocationStatus = "FUNCTION_INVOCATION_STATUS_UNKNOWN" ) func (e FunctionInvocationStatus) ToPointer() *FunctionInvocationStatus { @@ -26,7 +29,7 @@ func (e FunctionInvocationStatus) ToPointer() *FunctionInvocationStatus { func (e *FunctionInvocationStatus) IsExact() bool { if e != nil { switch *e { - case "FUNCTION_INVOCATION_STATUS_UNSPECIFIED", "FUNCTION_INVOCATION_STATUS_PENDING", "FUNCTION_INVOCATION_STATUS_RUNNING", "FUNCTION_INVOCATION_STATUS_SUCCESS", "FUNCTION_INVOCATION_STATUS_ERROR": + case "FUNCTION_INVOCATION_STATUS_UNSPECIFIED", "FUNCTION_INVOCATION_STATUS_PENDING", "FUNCTION_INVOCATION_STATUS_RUNNING", "FUNCTION_INVOCATION_STATUS_SUCCESS", "FUNCTION_INVOCATION_STATUS_ERROR", "FUNCTION_INVOCATION_STATUS_CANCELLATION_REQUESTED", "FUNCTION_INVOCATION_STATUS_CANCELLED", "FUNCTION_INVOCATION_STATUS_UNKNOWN": return true } } @@ -43,9 +46,10 @@ type FunctionInvocation struct { // The functionId field. FunctionID *string `json:"functionId,omitempty"` // The id field. - ID *string `json:"id,omitempty"` - Input map[string]any `json:"input,omitempty"` - Output map[string]any `json:"output,omitempty"` + ID *string `json:"id,omitempty"` + Input map[string]any `json:"input,omitempty"` + Output map[string]any `json:"output,omitempty"` + ResultRef *FunctionInvocationResultRef `json:"resultRef,omitempty"` // The status field. Status *FunctionInvocationStatus `json:"status,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` @@ -111,6 +115,13 @@ func (f *FunctionInvocation) GetOutput() map[string]any { return f.Output } +func (f *FunctionInvocation) GetResultRef() *FunctionInvocationResultRef { + if f == nil { + return nil + } + return f.ResultRef +} + func (f *FunctionInvocation) GetStatus() *FunctionInvocationStatus { if f == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functioninvocationresultref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functioninvocationresultref.go new file mode 100644 index 00000000..62a8244d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functioninvocationresultref.go @@ -0,0 +1,102 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// Storage - The storage field. +type Storage string + +const ( + StorageFunctionInvocationResultStorageUnspecified Storage = "FUNCTION_INVOCATION_RESULT_STORAGE_UNSPECIFIED" + StorageFunctionInvocationResultStorageInline Storage = "FUNCTION_INVOCATION_RESULT_STORAGE_INLINE" + StorageFunctionInvocationResultStorageVfs Storage = "FUNCTION_INVOCATION_RESULT_STORAGE_VFS" +) + +func (e Storage) ToPointer() *Storage { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Storage) IsExact() bool { + if e != nil { + switch *e { + case "FUNCTION_INVOCATION_RESULT_STORAGE_UNSPECIFIED", "FUNCTION_INVOCATION_RESULT_STORAGE_INLINE", "FUNCTION_INVOCATION_RESULT_STORAGE_VFS": + return true + } + } + return false +} + +// FunctionInvocationResultRef describes an invocation result held outside the +// +// invocation object. It never carries a storage URI or a download URL. +type FunctionInvocationResultRef struct { + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // The mediaType field. + MediaType *string `json:"mediaType,omitempty"` + // The path field. + Path *string `json:"path,omitempty"` + // Base64url SHA-256 of the result bytes. + Sha256 *string `json:"sha256,omitempty"` + // The sizeBytes field. + SizeBytes *int64 `integer:"string" json:"sizeBytes,omitempty"` + // The storage field. + Storage *Storage `json:"storage,omitempty"` +} + +func (f FunctionInvocationResultRef) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FunctionInvocationResultRef) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FunctionInvocationResultRef) GetExpiresAt() *time.Time { + if f == nil { + return nil + } + return f.ExpiresAt +} + +func (f *FunctionInvocationResultRef) GetMediaType() *string { + if f == nil { + return nil + } + return f.MediaType +} + +func (f *FunctionInvocationResultRef) GetPath() *string { + if f == nil { + return nil + } + return f.Path +} + +func (f *FunctionInvocationResultRef) GetSha256() *string { + if f == nil { + return nil + } + return f.Sha256 +} + +func (f *FunctionInvocationResultRef) GetSizeBytes() *int64 { + if f == nil { + return nil + } + return f.SizeBytes +} + +func (f *FunctionInvocationResultRef) GetStorage() *Storage { + if f == nil { + return nil + } + return f.Storage +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsinvocationservicegetresultdownloadurlresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsinvocationservicegetresultdownloadurlresponse.go new file mode 100644 index 00000000..19f325c7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsinvocationservicegetresultdownloadurlresponse.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FunctionsInvocationServiceGetResultDownloadURLResponse message. +type FunctionsInvocationServiceGetResultDownloadURLResponse struct { + // Short-lived URL minted for this request only. + DownloadURL *string `json:"downloadUrl,omitempty"` +} + +func (f *FunctionsInvocationServiceGetResultDownloadURLResponse) GetDownloadURL() *string { + if f == nil { + return nil + } + return f.DownloadURL +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionssearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionssearchrequest.go index 1b1fe028..aa53852d 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionssearchrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionssearchrequest.go @@ -8,6 +8,7 @@ const ( FunctionTypesFunctionTypeUnspecified FunctionTypes = "FUNCTION_TYPE_UNSPECIFIED" FunctionTypesFunctionTypeAny FunctionTypes = "FUNCTION_TYPE_ANY" FunctionTypesFunctionTypeCodeMode FunctionTypes = "FUNCTION_TYPE_CODE_MODE" + FunctionTypesFunctionTypeConnector FunctionTypes = "FUNCTION_TYPE_CONNECTOR" ) func (e FunctionTypes) ToPointer() *FunctionTypes { @@ -18,7 +19,7 @@ func (e FunctionTypes) ToPointer() *FunctionTypes { func (e *FunctionTypes) IsExact() bool { if e != nil { switch *e { - case "FUNCTION_TYPE_UNSPECIFIED", "FUNCTION_TYPE_ANY", "FUNCTION_TYPE_CODE_MODE": + case "FUNCTION_TYPE_UNSPECIFIED", "FUNCTION_TYPE_ANY", "FUNCTION_TYPE_CODE_MODE", "FUNCTION_TYPE_CONNECTOR": return true } } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsservicecreatefunctionrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsservicecreatefunctionrequest.go index 4e72f3ad..73c30520 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsservicecreatefunctionrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsservicecreatefunctionrequest.go @@ -11,6 +11,7 @@ const ( FunctionsServiceCreateFunctionRequestFunctionTypeFunctionTypeUnspecified FunctionsServiceCreateFunctionRequestFunctionType = "FUNCTION_TYPE_UNSPECIFIED" FunctionsServiceCreateFunctionRequestFunctionTypeFunctionTypeAny FunctionsServiceCreateFunctionRequestFunctionType = "FUNCTION_TYPE_ANY" FunctionsServiceCreateFunctionRequestFunctionTypeFunctionTypeCodeMode FunctionsServiceCreateFunctionRequestFunctionType = "FUNCTION_TYPE_CODE_MODE" + FunctionsServiceCreateFunctionRequestFunctionTypeFunctionTypeConnector FunctionsServiceCreateFunctionRequestFunctionType = "FUNCTION_TYPE_CONNECTOR" ) func (e FunctionsServiceCreateFunctionRequestFunctionType) ToPointer() *FunctionsServiceCreateFunctionRequestFunctionType { @@ -21,7 +22,7 @@ func (e FunctionsServiceCreateFunctionRequestFunctionType) ToPointer() *Function func (e *FunctionsServiceCreateFunctionRequestFunctionType) IsExact() bool { if e != nil { switch *e { - case "FUNCTION_TYPE_UNSPECIFIED", "FUNCTION_TYPE_ANY", "FUNCTION_TYPE_CODE_MODE": + case "FUNCTION_TYPE_UNSPECIFIED", "FUNCTION_TYPE_ANY", "FUNCTION_TYPE_CODE_MODE", "FUNCTION_TYPE_CONNECTOR": return true } } @@ -30,6 +31,9 @@ func (e *FunctionsServiceCreateFunctionRequestFunctionType) IsExact() bool { // The FunctionsServiceCreateFunctionRequest message. type FunctionsServiceCreateFunctionRequest struct { + // browser_enabled creates the function as browser-capable. See + // Function.browser_enabled. + BrowserEnabled *bool `json:"browserEnabled,omitempty"` // The commit message describing the initial code submission. CommitMessage *string `json:"commitMessage,omitempty"` // A description of what the function does. @@ -55,6 +59,13 @@ type FunctionsServiceCreateFunctionRequest struct { InitialContent map[string]string `json:"initialContent,omitempty"` } +func (f *FunctionsServiceCreateFunctionRequest) GetBrowserEnabled() *bool { + if f == nil { + return nil + } + return f.BrowserEnabled +} + func (f *FunctionsServiceCreateFunctionRequest) GetCommitMessage() *string { if f == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsserviceupdatefunctionrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsserviceupdatefunctionrequest.go index 777e9794..886ed4d5 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsserviceupdatefunctionrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsserviceupdatefunctionrequest.go @@ -4,8 +4,30 @@ package shared // The FunctionsServiceUpdateFunctionRequest message. type FunctionsServiceUpdateFunctionRequest struct { - Function *FunctionInput `json:"function,omitempty"` - UpdateMask *string `json:"updateMask,omitempty"` + // The commit message describing this code update. Defaults to a generic + // message if content is set and this is empty. Ignored if content is empty. + CommitMessage *string `json:"commitMessage,omitempty"` + // File map for a new code commit, applied as the function's new head + // commit. Keys are file paths in the function root; values are file + // contents as bytes. See CreateFunctionRequest.initial_content for the + // required entry-file signature. Independent of update_mask. + Content map[string]string `json:"content,omitempty"` + Function *FunctionInput `json:"function,omitempty"` + UpdateMask *string `json:"updateMask,omitempty"` +} + +func (f *FunctionsServiceUpdateFunctionRequest) GetCommitMessage() *string { + if f == nil { + return nil + } + return f.CommitMessage +} + +func (f *FunctionsServiceUpdateFunctionRequest) GetContent() map[string]string { + if f == nil { + return nil + } + return f.Content } func (f *FunctionsServiceUpdateFunctionRequest) GetFunction() *FunctionInput { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsserviceupdatefunctionresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsserviceupdatefunctionresponse.go index bdd26ea6..c25a1fa1 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsserviceupdatefunctionresponse.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/functionsserviceupdatefunctionresponse.go @@ -4,7 +4,15 @@ package shared // The FunctionsServiceUpdateFunctionResponse message. type FunctionsServiceUpdateFunctionResponse struct { - Function *Function `json:"function,omitempty"` + Commit *FunctionCommit `json:"commit,omitempty"` + Function *Function `json:"function,omitempty"` +} + +func (f *FunctionsServiceUpdateFunctionResponse) GetCommit() *FunctionCommit { + if f == nil { + return nil + } + return f.Commit } func (f *FunctionsServiceUpdateFunctionResponse) GetFunction() *Function { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignment.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignment.go new file mode 100644 index 00000000..cdc2c506 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignment.go @@ -0,0 +1,65 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// FundAssignment is one principal's fund exception as the API renders it. +type FundAssignment struct { + Controls *SpendControls `json:"controls,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The tenantId field. + TenantID *string `json:"tenantId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Canonical c1.models.user.v2.User id, every UserType. + UserID *string `json:"userId,omitempty"` +} + +func (f FundAssignment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FundAssignment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FundAssignment) GetControls() *SpendControls { + if f == nil { + return nil + } + return f.Controls +} + +func (f *FundAssignment) GetCreatedAt() *time.Time { + if f == nil { + return nil + } + return f.CreatedAt +} + +func (f *FundAssignment) GetTenantID() *string { + if f == nil { + return nil + } + return f.TenantID +} + +func (f *FundAssignment) GetUpdatedAt() *time.Time { + if f == nil { + return nil + } + return f.UpdatedAt +} + +func (f *FundAssignment) GetUserID() *string { + if f == nil { + return nil + } + return f.UserID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmenthistoryentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmenthistoryentry.go new file mode 100644 index 00000000..edf65370 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmenthistoryentry.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentHistoryEntry message. +type FundAssignmentHistoryEntry struct { + Metadata *HistoryEntryMetadata `json:"metadata,omitempty"` + Snapshot *FundAssignment `json:"snapshot,omitempty"` +} + +func (f *FundAssignmentHistoryEntry) GetMetadata() *HistoryEntryMetadata { + if f == nil { + return nil + } + return f.Metadata +} + +func (f *FundAssignmentHistoryEntry) GetSnapshot() *FundAssignment { + if f == nil { + return nil + } + return f.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceclearextensionrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceclearextensionrequest.go new file mode 100644 index 00000000..b4deec02 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceclearextensionrequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceClearExtensionRequest message. +type FundAssignmentServiceClearExtensionRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceclearextensionresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceclearextensionresponse.go new file mode 100644 index 00000000..3ea77fbb --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceclearextensionresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceClearExtensionResponse message. +type FundAssignmentServiceClearExtensionResponse struct { + Assignment *FundAssignment `json:"assignment,omitempty"` +} + +func (f *FundAssignmentServiceClearExtensionResponse) GetAssignment() *FundAssignment { + if f == nil { + return nil + } + return f.Assignment +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicedeleterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicedeleterequest.go new file mode 100644 index 00000000..5bb97aa6 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicedeleterequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceDeleteRequest message. +type FundAssignmentServiceDeleteRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicedeleteresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicedeleteresponse.go new file mode 100644 index 00000000..682e7b15 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicedeleteresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceDeleteResponse message. +type FundAssignmentServiceDeleteResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegetresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegetresponse.go new file mode 100644 index 00000000..2ed1d671 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegetresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceGetResponse message. +type FundAssignmentServiceGetResponse struct { + Assignment *FundAssignment `json:"assignment,omitempty"` +} + +func (f *FundAssignmentServiceGetResponse) GetAssignment() *FundAssignment { + if f == nil { + return nil + } + return f.Assignment +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegrantextensionrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegrantextensionrequest.go new file mode 100644 index 00000000..8f98c597 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegrantextensionrequest.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// The FundAssignmentServiceGrantExtensionRequest message. +type FundAssignmentServiceGrantExtensionRequest struct { + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + Limit *SpendLimit `json:"limit,omitempty"` + // Subject-visible: "why do I have this bump". + Reason *string `json:"reason,omitempty"` +} + +func (f FundAssignmentServiceGrantExtensionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FundAssignmentServiceGrantExtensionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FundAssignmentServiceGrantExtensionRequest) GetExpiresAt() *time.Time { + if f == nil { + return nil + } + return f.ExpiresAt +} + +func (f *FundAssignmentServiceGrantExtensionRequest) GetLimit() *SpendLimit { + if f == nil { + return nil + } + return f.Limit +} + +func (f *FundAssignmentServiceGrantExtensionRequest) GetReason() *string { + if f == nil { + return nil + } + return f.Reason +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegrantextensionresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegrantextensionresponse.go new file mode 100644 index 00000000..05cf771d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicegrantextensionresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceGrantExtensionResponse message. +type FundAssignmentServiceGrantExtensionResponse struct { + Assignment *FundAssignment `json:"assignment,omitempty"` +} + +func (f *FundAssignmentServiceGrantExtensionResponse) GetAssignment() *FundAssignment { + if f == nil { + return nil + } + return f.Assignment +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicelisthistoryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicelisthistoryresponse.go new file mode 100644 index 00000000..f07f55d6 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicelisthistoryresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceListHistoryResponse message. +type FundAssignmentServiceListHistoryResponse struct { + // The list field. + List []FundAssignmentHistoryEntry `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (f *FundAssignmentServiceListHistoryResponse) GetList() []FundAssignmentHistoryEntry { + if f == nil { + return nil + } + return f.List +} + +func (f *FundAssignmentServiceListHistoryResponse) GetNextPageToken() *string { + if f == nil { + return nil + } + return f.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesearchrequest.go new file mode 100644 index 00000000..a8101bdd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesearchrequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceSearchRequest message. +type FundAssignmentServiceSearchRequest struct { + // The pageSize field. + PageSize *int `json:"pageSize,omitempty"` + // The pageToken field. + PageToken *string `json:"pageToken,omitempty"` + // Restrict to these subjects; empty returns every assignment in the tenant. + UserIds []string `json:"userIds,omitempty"` +} + +func (f *FundAssignmentServiceSearchRequest) GetPageSize() *int { + if f == nil { + return nil + } + return f.PageSize +} + +func (f *FundAssignmentServiceSearchRequest) GetPageToken() *string { + if f == nil { + return nil + } + return f.PageToken +} + +func (f *FundAssignmentServiceSearchRequest) GetUserIds() []string { + if f == nil { + return nil + } + return f.UserIds +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesearchresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesearchresponse.go new file mode 100644 index 00000000..d1c4a04b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesearchresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceSearchResponse message. +type FundAssignmentServiceSearchResponse struct { + // The list field. + List []FundAssignment `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (f *FundAssignmentServiceSearchResponse) GetList() []FundAssignment { + if f == nil { + return nil + } + return f.List +} + +func (f *FundAssignmentServiceSearchResponse) GetNextPageToken() *string { + if f == nil { + return nil + } + return f.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesetlimitrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesetlimitrequest.go new file mode 100644 index 00000000..8d543c66 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesetlimitrequest.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// FundAssignmentServiceSetLimitRequestPeriod - Optional period override. Only valid together with the limit it denominates. +type FundAssignmentServiceSetLimitRequestPeriod string + +const ( + FundAssignmentServiceSetLimitRequestPeriodPeriodKindUnspecified FundAssignmentServiceSetLimitRequestPeriod = "PERIOD_KIND_UNSPECIFIED" + FundAssignmentServiceSetLimitRequestPeriodPeriodKindDaily FundAssignmentServiceSetLimitRequestPeriod = "PERIOD_KIND_DAILY" + FundAssignmentServiceSetLimitRequestPeriodPeriodKindWeekly FundAssignmentServiceSetLimitRequestPeriod = "PERIOD_KIND_WEEKLY" + FundAssignmentServiceSetLimitRequestPeriodPeriodKindMonthly FundAssignmentServiceSetLimitRequestPeriod = "PERIOD_KIND_MONTHLY" + FundAssignmentServiceSetLimitRequestPeriodPeriodKindQuarterly FundAssignmentServiceSetLimitRequestPeriod = "PERIOD_KIND_QUARTERLY" + FundAssignmentServiceSetLimitRequestPeriodPeriodKindYearly FundAssignmentServiceSetLimitRequestPeriod = "PERIOD_KIND_YEARLY" +) + +func (e FundAssignmentServiceSetLimitRequestPeriod) ToPointer() *FundAssignmentServiceSetLimitRequestPeriod { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *FundAssignmentServiceSetLimitRequestPeriod) IsExact() bool { + if e != nil { + switch *e { + case "PERIOD_KIND_UNSPECIFIED", "PERIOD_KIND_DAILY", "PERIOD_KIND_WEEKLY", "PERIOD_KIND_MONTHLY", "PERIOD_KIND_QUARTERLY", "PERIOD_KIND_YEARLY": + return true + } + } + return false +} + +// The FundAssignmentServiceSetLimitRequest message. +type FundAssignmentServiceSetLimitRequest struct { + Limit *SpendLimit `json:"limit,omitempty"` + // Optional period override. Only valid together with the limit it denominates. + Period *FundAssignmentServiceSetLimitRequestPeriod `json:"period,omitempty"` +} + +func (f *FundAssignmentServiceSetLimitRequest) GetLimit() *SpendLimit { + if f == nil { + return nil + } + return f.Limit +} + +func (f *FundAssignmentServiceSetLimitRequest) GetPeriod() *FundAssignmentServiceSetLimitRequestPeriod { + if f == nil { + return nil + } + return f.Period +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesetlimitresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesetlimitresponse.go new file mode 100644 index 00000000..6180704f --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesetlimitresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceSetLimitResponse message. +type FundAssignmentServiceSetLimitResponse struct { + Assignment *FundAssignment `json:"assignment,omitempty"` +} + +func (f *FundAssignmentServiceSetLimitResponse) GetAssignment() *FundAssignment { + if f == nil { + return nil + } + return f.Assignment +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesuspendrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesuspendrequest.go new file mode 100644 index 00000000..0df0a88a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesuspendrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceSuspendRequest message. +type FundAssignmentServiceSuspendRequest struct { + // The reason field. + Reason *string `json:"reason,omitempty"` +} + +func (f *FundAssignmentServiceSuspendRequest) GetReason() *string { + if f == nil { + return nil + } + return f.Reason +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesuspendresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesuspendresponse.go new file mode 100644 index 00000000..107abc56 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentservicesuspendresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceSuspendResponse message. +type FundAssignmentServiceSuspendResponse struct { + Assignment *FundAssignment `json:"assignment,omitempty"` +} + +func (f *FundAssignmentServiceSuspendResponse) GetAssignment() *FundAssignment { + if f == nil { + return nil + } + return f.Assignment +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceunsuspendrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceunsuspendrequest.go new file mode 100644 index 00000000..4c33792f --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceunsuspendrequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceUnsuspendRequest message. +type FundAssignmentServiceUnsuspendRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceunsuspendresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceunsuspendresponse.go new file mode 100644 index 00000000..527fc0ac --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundassignmentserviceunsuspendresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundAssignmentServiceUnsuspendResponse message. +type FundAssignmentServiceUnsuspendResponse struct { + Assignment *FundAssignment `json:"assignment,omitempty"` +} + +func (f *FundAssignmentServiceUnsuspendResponse) GetAssignment() *FundAssignment { + if f == nil { + return nil + } + return f.Assignment +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicy.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicy.go new file mode 100644 index 00000000..2d4b2525 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicy.go @@ -0,0 +1,112 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// FundPolicyPeriod - The root period every amount in the tenant is denominated in. +type FundPolicyPeriod string + +const ( + FundPolicyPeriodPeriodKindUnspecified FundPolicyPeriod = "PERIOD_KIND_UNSPECIFIED" + FundPolicyPeriodPeriodKindDaily FundPolicyPeriod = "PERIOD_KIND_DAILY" + FundPolicyPeriodPeriodKindWeekly FundPolicyPeriod = "PERIOD_KIND_WEEKLY" + FundPolicyPeriodPeriodKindMonthly FundPolicyPeriod = "PERIOD_KIND_MONTHLY" + FundPolicyPeriodPeriodKindQuarterly FundPolicyPeriod = "PERIOD_KIND_QUARTERLY" + FundPolicyPeriodPeriodKindYearly FundPolicyPeriod = "PERIOD_KIND_YEARLY" +) + +func (e FundPolicyPeriod) ToPointer() *FundPolicyPeriod { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *FundPolicyPeriod) IsExact() bool { + if e != nil { + switch *e { + case "PERIOD_KIND_UNSPECIFIED", "PERIOD_KIND_DAILY", "PERIOD_KIND_WEEKLY", "PERIOD_KIND_MONTHLY", "PERIOD_KIND_QUARTERLY", "PERIOD_KIND_YEARLY": + return true + } + } + return false +} + +// FundPolicy is the tenant's fund policy as the API renders it. Every field is +// +// server-owned on the way out; requests name the fields they change rather than +// sending this message back. +type FundPolicy struct { + CreatedAt *time.Time `json:"createdAt,omitempty"` + // ISO 4217. Set at Create and immutable thereafter. + CurrencyCode *string `json:"currencyCode,omitempty"` + DefaultLimit *SpendLimit `json:"defaultLimit,omitempty"` + OrgCeiling *SpendControls `json:"orgCeiling,omitempty"` + // The root period every amount in the tenant is denominated in. + Period *FundPolicyPeriod `json:"period,omitempty"` + // The tenantId field. + TenantID *string `json:"tenantId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (f FundPolicy) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FundPolicy) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FundPolicy) GetCreatedAt() *time.Time { + if f == nil { + return nil + } + return f.CreatedAt +} + +func (f *FundPolicy) GetCurrencyCode() *string { + if f == nil { + return nil + } + return f.CurrencyCode +} + +func (f *FundPolicy) GetDefaultLimit() *SpendLimit { + if f == nil { + return nil + } + return f.DefaultLimit +} + +func (f *FundPolicy) GetOrgCeiling() *SpendControls { + if f == nil { + return nil + } + return f.OrgCeiling +} + +func (f *FundPolicy) GetPeriod() *FundPolicyPeriod { + if f == nil { + return nil + } + return f.Period +} + +func (f *FundPolicy) GetTenantID() *string { + if f == nil { + return nil + } + return f.TenantID +} + +func (f *FundPolicy) GetUpdatedAt() *time.Time { + if f == nil { + return nil + } + return f.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyhistoryentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyhistoryentry.go new file mode 100644 index 00000000..95bcfb83 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyhistoryentry.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyHistoryEntry message. +type FundPolicyHistoryEntry struct { + Metadata *HistoryEntryMetadata `json:"metadata,omitempty"` + Snapshot *FundPolicy `json:"snapshot,omitempty"` +} + +func (f *FundPolicyHistoryEntry) GetMetadata() *HistoryEntryMetadata { + if f == nil { + return nil + } + return f.Metadata +} + +func (f *FundPolicyHistoryEntry) GetSnapshot() *FundPolicy { + if f == nil { + return nil + } + return f.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicecreaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicecreaterequest.go new file mode 100644 index 00000000..dc76dafd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicecreaterequest.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// FundPolicyServiceCreateRequestPeriod - The period field. +type FundPolicyServiceCreateRequestPeriod string + +const ( + FundPolicyServiceCreateRequestPeriodPeriodKindUnspecified FundPolicyServiceCreateRequestPeriod = "PERIOD_KIND_UNSPECIFIED" + FundPolicyServiceCreateRequestPeriodPeriodKindDaily FundPolicyServiceCreateRequestPeriod = "PERIOD_KIND_DAILY" + FundPolicyServiceCreateRequestPeriodPeriodKindWeekly FundPolicyServiceCreateRequestPeriod = "PERIOD_KIND_WEEKLY" + FundPolicyServiceCreateRequestPeriodPeriodKindMonthly FundPolicyServiceCreateRequestPeriod = "PERIOD_KIND_MONTHLY" + FundPolicyServiceCreateRequestPeriodPeriodKindQuarterly FundPolicyServiceCreateRequestPeriod = "PERIOD_KIND_QUARTERLY" + FundPolicyServiceCreateRequestPeriodPeriodKindYearly FundPolicyServiceCreateRequestPeriod = "PERIOD_KIND_YEARLY" +) + +func (e FundPolicyServiceCreateRequestPeriod) ToPointer() *FundPolicyServiceCreateRequestPeriod { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *FundPolicyServiceCreateRequestPeriod) IsExact() bool { + if e != nil { + switch *e { + case "PERIOD_KIND_UNSPECIFIED", "PERIOD_KIND_DAILY", "PERIOD_KIND_WEEKLY", "PERIOD_KIND_MONTHLY", "PERIOD_KIND_QUARTERLY", "PERIOD_KIND_YEARLY": + return true + } + } + return false +} + +// The FundPolicyServiceCreateRequest message. +type FundPolicyServiceCreateRequest struct { + // Empty defaults to USD. Any other value is refused: spend governance is + // USD-only today; multi-currency requires an FX source. Immutable once set. + CurrencyCode *string `json:"currencyCode,omitempty"` + DefaultLimit *SpendLimit `json:"defaultLimit,omitempty"` + // The period field. + Period *FundPolicyServiceCreateRequestPeriod `json:"period,omitempty"` +} + +func (f *FundPolicyServiceCreateRequest) GetCurrencyCode() *string { + if f == nil { + return nil + } + return f.CurrencyCode +} + +func (f *FundPolicyServiceCreateRequest) GetDefaultLimit() *SpendLimit { + if f == nil { + return nil + } + return f.DefaultLimit +} + +func (f *FundPolicyServiceCreateRequest) GetPeriod() *FundPolicyServiceCreateRequestPeriod { + if f == nil { + return nil + } + return f.Period +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicecreateresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicecreateresponse.go new file mode 100644 index 00000000..f0e9d539 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicecreateresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceCreateResponse message. +type FundPolicyServiceCreateResponse struct { + Policy *FundPolicy `json:"policy,omitempty"` +} + +func (f *FundPolicyServiceCreateResponse) GetPolicy() *FundPolicy { + if f == nil { + return nil + } + return f.Policy +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicedeleterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicedeleterequest.go new file mode 100644 index 00000000..0293da66 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicedeleterequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceDeleteRequest message. +type FundPolicyServiceDeleteRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicedeleteresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicedeleteresponse.go new file mode 100644 index 00000000..1a2bce75 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicedeleteresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceDeleteResponse message. +type FundPolicyServiceDeleteResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicefreezetenantrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicefreezetenantrequest.go new file mode 100644 index 00000000..4f826b96 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicefreezetenantrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceFreezeTenantRequest message. +type FundPolicyServiceFreezeTenantRequest struct { + // The reason field. + Reason *string `json:"reason,omitempty"` +} + +func (f *FundPolicyServiceFreezeTenantRequest) GetReason() *string { + if f == nil { + return nil + } + return f.Reason +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicefreezetenantresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicefreezetenantresponse.go new file mode 100644 index 00000000..869cc75a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicefreezetenantresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceFreezeTenantResponse message. +type FundPolicyServiceFreezeTenantResponse struct { + Policy *FundPolicy `json:"policy,omitempty"` +} + +func (f *FundPolicyServiceFreezeTenantResponse) GetPolicy() *FundPolicy { + if f == nil { + return nil + } + return f.Policy +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicegetresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicegetresponse.go new file mode 100644 index 00000000..2b6d9b66 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicegetresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceGetResponse message. +type FundPolicyServiceGetResponse struct { + Policy *FundPolicy `json:"policy,omitempty"` +} + +func (f *FundPolicyServiceGetResponse) GetPolicy() *FundPolicy { + if f == nil { + return nil + } + return f.Policy +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicelisthistoryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicelisthistoryresponse.go new file mode 100644 index 00000000..016bb5ab --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicelisthistoryresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceListHistoryResponse message. +type FundPolicyServiceListHistoryResponse struct { + // The list field. + List []FundPolicyHistoryEntry `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (f *FundPolicyServiceListHistoryResponse) GetList() []FundPolicyHistoryEntry { + if f == nil { + return nil + } + return f.List +} + +func (f *FundPolicyServiceListHistoryResponse) GetNextPageToken() *string { + if f == nil { + return nil + } + return f.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicesetorgceilingrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicesetorgceilingrequest.go new file mode 100644 index 00000000..5e1f01e2 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicesetorgceilingrequest.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// FundPolicyServiceSetOrgCeilingRequestPeriod - Optional period override for the ceiling. Only valid together with limit. +type FundPolicyServiceSetOrgCeilingRequestPeriod string + +const ( + FundPolicyServiceSetOrgCeilingRequestPeriodPeriodKindUnspecified FundPolicyServiceSetOrgCeilingRequestPeriod = "PERIOD_KIND_UNSPECIFIED" + FundPolicyServiceSetOrgCeilingRequestPeriodPeriodKindDaily FundPolicyServiceSetOrgCeilingRequestPeriod = "PERIOD_KIND_DAILY" + FundPolicyServiceSetOrgCeilingRequestPeriodPeriodKindWeekly FundPolicyServiceSetOrgCeilingRequestPeriod = "PERIOD_KIND_WEEKLY" + FundPolicyServiceSetOrgCeilingRequestPeriodPeriodKindMonthly FundPolicyServiceSetOrgCeilingRequestPeriod = "PERIOD_KIND_MONTHLY" + FundPolicyServiceSetOrgCeilingRequestPeriodPeriodKindQuarterly FundPolicyServiceSetOrgCeilingRequestPeriod = "PERIOD_KIND_QUARTERLY" + FundPolicyServiceSetOrgCeilingRequestPeriodPeriodKindYearly FundPolicyServiceSetOrgCeilingRequestPeriod = "PERIOD_KIND_YEARLY" +) + +func (e FundPolicyServiceSetOrgCeilingRequestPeriod) ToPointer() *FundPolicyServiceSetOrgCeilingRequestPeriod { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *FundPolicyServiceSetOrgCeilingRequestPeriod) IsExact() bool { + if e != nil { + switch *e { + case "PERIOD_KIND_UNSPECIFIED", "PERIOD_KIND_DAILY", "PERIOD_KIND_WEEKLY", "PERIOD_KIND_MONTHLY", "PERIOD_KIND_QUARTERLY", "PERIOD_KIND_YEARLY": + return true + } + } + return false +} + +// The FundPolicyServiceSetOrgCeilingRequest message. +type FundPolicyServiceSetOrgCeilingRequest struct { + Limit *SpendLimit `json:"limit,omitempty"` + // Optional period override for the ceiling. Only valid together with limit. + Period *FundPolicyServiceSetOrgCeilingRequestPeriod `json:"period,omitempty"` +} + +func (f *FundPolicyServiceSetOrgCeilingRequest) GetLimit() *SpendLimit { + if f == nil { + return nil + } + return f.Limit +} + +func (f *FundPolicyServiceSetOrgCeilingRequest) GetPeriod() *FundPolicyServiceSetOrgCeilingRequestPeriod { + if f == nil { + return nil + } + return f.Period +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicesetorgceilingresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicesetorgceilingresponse.go new file mode 100644 index 00000000..d8a70967 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyservicesetorgceilingresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceSetOrgCeilingResponse message. +type FundPolicyServiceSetOrgCeilingResponse struct { + Policy *FundPolicy `json:"policy,omitempty"` +} + +func (f *FundPolicyServiceSetOrgCeilingResponse) GetPolicy() *FundPolicy { + if f == nil { + return nil + } + return f.Policy +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceunfreezetenantrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceunfreezetenantrequest.go new file mode 100644 index 00000000..caaabd42 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceunfreezetenantrequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceUnfreezeTenantRequest message. +type FundPolicyServiceUnfreezeTenantRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceunfreezetenantresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceunfreezetenantresponse.go new file mode 100644 index 00000000..1b4b2af6 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceunfreezetenantresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceUnfreezeTenantResponse message. +type FundPolicyServiceUnfreezeTenantResponse struct { + Policy *FundPolicy `json:"policy,omitempty"` +} + +func (f *FundPolicyServiceUnfreezeTenantResponse) GetPolicy() *FundPolicy { + if f == nil { + return nil + } + return f.Policy +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceupdaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceupdaterequest.go new file mode 100644 index 00000000..45648b76 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceupdaterequest.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceUpdateRequest message. +type FundPolicyServiceUpdateRequest struct { + Policy *FundPolicy `json:"policy,omitempty"` + UpdateMask *string `json:"updateMask,omitempty"` +} + +func (f *FundPolicyServiceUpdateRequest) GetPolicy() *FundPolicy { + if f == nil { + return nil + } + return f.Policy +} + +func (f *FundPolicyServiceUpdateRequest) GetUpdateMask() *string { + if f == nil { + return nil + } + return f.UpdateMask +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceupdateresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceupdateresponse.go new file mode 100644 index 00000000..b90067ec --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundpolicyserviceupdateresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundPolicyServiceUpdateResponse message. +type FundPolicyServiceUpdateResponse struct { + Policy *FundPolicy `json:"policy,omitempty"` +} + +func (f *FundPolicyServiceUpdateResponse) GetPolicy() *FundPolicy { + if f == nil { + return nil + } + return f.Policy +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundrule.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundrule.go new file mode 100644 index 00000000..18939784 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundrule.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// FundRule is one group grant as the API renders it. +type FundRule struct { + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Admin-facing label, so a rule list reads as policy rather than as ids. + // Bounded on the message rather than only on Create: Update carries a whole + // FundRule, and this is the column the mirror's full-text and btree indexes + // are built on. + DisplayName *string `json:"displayName,omitempty"` + Grant *SpendLimit `json:"grant,omitempty"` + GroupRef *AppEntitlementRef `json:"groupRef,omitempty"` + // Why this cohort is funded. Subject-visible where a grant is explained. + Reason *string `json:"reason,omitempty"` + // The ruleId field. + RuleID *string `json:"ruleId,omitempty"` + // The tenantId field. + TenantID *string `json:"tenantId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (f FundRule) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FundRule) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FundRule) GetCreatedAt() *time.Time { + if f == nil { + return nil + } + return f.CreatedAt +} + +func (f *FundRule) GetDisplayName() *string { + if f == nil { + return nil + } + return f.DisplayName +} + +func (f *FundRule) GetGrant() *SpendLimit { + if f == nil { + return nil + } + return f.Grant +} + +func (f *FundRule) GetGroupRef() *AppEntitlementRef { + if f == nil { + return nil + } + return f.GroupRef +} + +func (f *FundRule) GetReason() *string { + if f == nil { + return nil + } + return f.Reason +} + +func (f *FundRule) GetRuleID() *string { + if f == nil { + return nil + } + return f.RuleID +} + +func (f *FundRule) GetTenantID() *string { + if f == nil { + return nil + } + return f.TenantID +} + +func (f *FundRule) GetUpdatedAt() *time.Time { + if f == nil { + return nil + } + return f.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundrulehistoryentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundrulehistoryentry.go new file mode 100644 index 00000000..69a23feb --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundrulehistoryentry.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleHistoryEntry message. +type FundRuleHistoryEntry struct { + Metadata *HistoryEntryMetadata `json:"metadata,omitempty"` + Snapshot *FundRule `json:"snapshot,omitempty"` +} + +func (f *FundRuleHistoryEntry) GetMetadata() *HistoryEntryMetadata { + if f == nil { + return nil + } + return f.Metadata +} + +func (f *FundRuleHistoryEntry) GetSnapshot() *FundRule { + if f == nil { + return nil + } + return f.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicecreaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicecreaterequest.go new file mode 100644 index 00000000..b66c3a8d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicecreaterequest.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceCreateRequest message. +type FundRuleServiceCreateRequest struct { + // The displayName field. + DisplayName *string `json:"displayName,omitempty"` + Grant *SpendLimit `json:"grant,omitempty"` + GroupRef *AppEntitlementRef `json:"groupRef,omitempty"` + // The reason field. + Reason *string `json:"reason,omitempty"` +} + +func (f *FundRuleServiceCreateRequest) GetDisplayName() *string { + if f == nil { + return nil + } + return f.DisplayName +} + +func (f *FundRuleServiceCreateRequest) GetGrant() *SpendLimit { + if f == nil { + return nil + } + return f.Grant +} + +func (f *FundRuleServiceCreateRequest) GetGroupRef() *AppEntitlementRef { + if f == nil { + return nil + } + return f.GroupRef +} + +func (f *FundRuleServiceCreateRequest) GetReason() *string { + if f == nil { + return nil + } + return f.Reason +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicecreateresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicecreateresponse.go new file mode 100644 index 00000000..7554d703 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicecreateresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceCreateResponse message. +type FundRuleServiceCreateResponse struct { + Rule *FundRule `json:"rule,omitempty"` +} + +func (f *FundRuleServiceCreateResponse) GetRule() *FundRule { + if f == nil { + return nil + } + return f.Rule +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicedeleterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicedeleterequest.go new file mode 100644 index 00000000..1d8bd65c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicedeleterequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceDeleteRequest message. +type FundRuleServiceDeleteRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicedeleteresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicedeleteresponse.go new file mode 100644 index 00000000..a1a6bc18 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicedeleteresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceDeleteResponse message. +type FundRuleServiceDeleteResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicegetresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicegetresponse.go new file mode 100644 index 00000000..79160720 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicegetresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceGetResponse message. +type FundRuleServiceGetResponse struct { + Rule *FundRule `json:"rule,omitempty"` +} + +func (f *FundRuleServiceGetResponse) GetRule() *FundRule { + if f == nil { + return nil + } + return f.Rule +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicelisthistoryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicelisthistoryresponse.go new file mode 100644 index 00000000..e7f8f3b0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicelisthistoryresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceListHistoryResponse message. +type FundRuleServiceListHistoryResponse struct { + // The list field. + List []FundRuleHistoryEntry `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (f *FundRuleServiceListHistoryResponse) GetList() []FundRuleHistoryEntry { + if f == nil { + return nil + } + return f.List +} + +func (f *FundRuleServiceListHistoryResponse) GetNextPageToken() *string { + if f == nil { + return nil + } + return f.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicelistresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicelistresponse.go new file mode 100644 index 00000000..a3454249 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicelistresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceListResponse message. +type FundRuleServiceListResponse struct { + // The list field. + List []FundRule `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (f *FundRuleServiceListResponse) GetList() []FundRule { + if f == nil { + return nil + } + return f.List +} + +func (f *FundRuleServiceListResponse) GetNextPageToken() *string { + if f == nil { + return nil + } + return f.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicesearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicesearchrequest.go new file mode 100644 index 00000000..5d3b6806 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicesearchrequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceSearchRequest message. +type FundRuleServiceSearchRequest struct { + // The pageSize field. + PageSize *int `json:"pageSize,omitempty"` + // The pageToken field. + PageToken *string `json:"pageToken,omitempty"` + // Case-insensitive search over the rule display name; empty returns all. + Query *string `json:"query,omitempty"` +} + +func (f *FundRuleServiceSearchRequest) GetPageSize() *int { + if f == nil { + return nil + } + return f.PageSize +} + +func (f *FundRuleServiceSearchRequest) GetPageToken() *string { + if f == nil { + return nil + } + return f.PageToken +} + +func (f *FundRuleServiceSearchRequest) GetQuery() *string { + if f == nil { + return nil + } + return f.Query +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicesearchresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicesearchresponse.go new file mode 100644 index 00000000..cfb0c005 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleservicesearchresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceSearchResponse message. +type FundRuleServiceSearchResponse struct { + // The list field. + List []FundRule `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (f *FundRuleServiceSearchResponse) GetList() []FundRule { + if f == nil { + return nil + } + return f.List +} + +func (f *FundRuleServiceSearchResponse) GetNextPageToken() *string { + if f == nil { + return nil + } + return f.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleserviceupdaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleserviceupdaterequest.go new file mode 100644 index 00000000..8b4956ca --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleserviceupdaterequest.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceUpdateRequest message. +type FundRuleServiceUpdateRequest struct { + Rule *FundRule `json:"rule,omitempty"` + UpdateMask *string `json:"updateMask,omitempty"` +} + +func (f *FundRuleServiceUpdateRequest) GetRule() *FundRule { + if f == nil { + return nil + } + return f.Rule +} + +func (f *FundRuleServiceUpdateRequest) GetUpdateMask() *string { + if f == nil { + return nil + } + return f.UpdateMask +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleserviceupdateresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleserviceupdateresponse.go new file mode 100644 index 00000000..b0a658ea --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/fundruleserviceupdateresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The FundRuleServiceUpdateResponse message. +type FundRuleServiceUpdateResponse struct { + Rule *FundRule `json:"rule,omitempty"` +} + +func (f *FundRuleServiceUpdateResponse) GetRule() *FundRule { + if f == nil { + return nil + } + return f.Rule +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/gatewaykey.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/gatewaykey.go new file mode 100644 index 00000000..78e82194 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/gatewaykey.go @@ -0,0 +1,74 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// The GatewayKey message. +type GatewayKey struct { + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The displayName field. + DisplayName *string `json:"displayName,omitempty"` + // The id field. + ID *string `json:"id,omitempty"` + // The keyPrefix field. + KeyPrefix *string `json:"keyPrefix,omitempty"` + RevokedAt *time.Time `json:"revokedAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (g GatewayKey) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GatewayKey) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GatewayKey) GetCreatedAt() *time.Time { + if g == nil { + return nil + } + return g.CreatedAt +} + +func (g *GatewayKey) GetDisplayName() *string { + if g == nil { + return nil + } + return g.DisplayName +} + +func (g *GatewayKey) GetID() *string { + if g == nil { + return nil + } + return g.ID +} + +func (g *GatewayKey) GetKeyPrefix() *string { + if g == nil { + return nil + } + return g.KeyPrefix +} + +func (g *GatewayKey) GetRevokedAt() *time.Time { + if g == nil { + return nil + } + return g.RevokedAt +} + +func (g *GatewayKey) GetUpdatedAt() *time.Time { + if g == nil { + return nil + } + return g.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getappmanagedstatebindingresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getappmanagedstatebindingresponse.go new file mode 100644 index 00000000..2c44aca4 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getappmanagedstatebindingresponse.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" +) + +// GetAppManagedStateBindingResponseExpanded - Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +type GetAppManagedStateBindingResponseExpanded struct { + // The type of the serialized message. + AtType *string `json:"@type,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (g GetAppManagedStateBindingResponseExpanded) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAppManagedStateBindingResponseExpanded) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAppManagedStateBindingResponseExpanded) GetAtType() *string { + if g == nil { + return nil + } + return g.AtType +} + +func (g *GetAppManagedStateBindingResponseExpanded) GetAdditionalProperties() map[string]any { + if g == nil { + return nil + } + return g.AdditionalProperties +} + +// GetAppManagedStateBindingResponse contains the managed state of a discovered application. +type GetAppManagedStateBindingResponse struct { + AppManagementState *AppManagedStateBindingView `json:"appManagementState,omitempty"` + // Related objects requested through expand_mask. REST Get requests do not support expansions; REST Promote requests do. + Expanded []GetAppManagedStateBindingResponseExpanded `json:"expanded,omitempty"` +} + +func (g *GetAppManagedStateBindingResponse) GetAppManagementState() *AppManagedStateBindingView { + if g == nil { + return nil + } + return g.AppManagementState +} + +func (g *GetAppManagedStateBindingResponse) GetExpanded() []GetAppManagedStateBindingResponseExpanded { + if g == nil { + return nil + } + return g.Expanded +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getcustomanalysisresultresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getcustomanalysisresultresponse.go index 716bf309..ff9e2daa 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getcustomanalysisresultresponse.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getcustomanalysisresultresponse.go @@ -35,6 +35,8 @@ type GetCustomAnalysisResultResponse struct { Clusters []EntitlementCluster `json:"clusters,omitempty"` // The cohortSize field. CohortSize *int `json:"cohortSize,omitempty"` + // Exact holder counts at each distinct inclusive entitlement coverage cutoff. + CutoffImpactPoints []EntitlementCutoffImpactPoint `json:"cutoffImpactPoints,omitempty"` // Entitlement coverage results. Entitlements []CohortEntitlement `json:"entitlements,omitempty"` // The errorMessage field. @@ -70,6 +72,13 @@ func (g *GetCustomAnalysisResultResponse) GetCohortSize() *int { return g.CohortSize } +func (g *GetCustomAnalysisResultResponse) GetCutoffImpactPoints() []EntitlementCutoffImpactPoint { + if g == nil { + return nil + } + return g.CutoffImpactPoints +} + func (g *GetCustomAnalysisResultResponse) GetEntitlements() []CohortEntitlement { if g == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getprovidercredentialresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getprovidercredentialresponse.go new file mode 100644 index 00000000..aba3f11d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/getprovidercredentialresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The GetProviderCredentialResponse message. +type GetProviderCredentialResponse struct { + Credential *ProviderCredential `json:"credential,omitempty"` +} + +func (g *GetProviderCredentialResponse) GetCredential() *ProviderCredential { + if g == nil { + return nil + } + return g.Credential +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/grantfilter.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/grantfilter.go index e58edef3..d9c19107 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/grantfilter.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/grantfilter.go @@ -51,21 +51,21 @@ func (e *GrantJustificationType) IsExact() bool { return false } -// GrantSourceFilter - The grantSourceFilter field. -type GrantSourceFilter string +// GrantFilterGrantSourceFilter - The grantSourceFilter field. +type GrantFilterGrantSourceFilter string const ( - GrantSourceFilterGrantSourceFilterUnspecified GrantSourceFilter = "GRANT_SOURCE_FILTER_UNSPECIFIED" - GrantSourceFilterGrantSourceFilterDirect GrantSourceFilter = "GRANT_SOURCE_FILTER_DIRECT" - GrantSourceFilterGrantSourceFilterInherited GrantSourceFilter = "GRANT_SOURCE_FILTER_INHERITED" + GrantFilterGrantSourceFilterGrantSourceFilterUnspecified GrantFilterGrantSourceFilter = "GRANT_SOURCE_FILTER_UNSPECIFIED" + GrantFilterGrantSourceFilterGrantSourceFilterDirect GrantFilterGrantSourceFilter = "GRANT_SOURCE_FILTER_DIRECT" + GrantFilterGrantSourceFilterGrantSourceFilterInherited GrantFilterGrantSourceFilter = "GRANT_SOURCE_FILTER_INHERITED" ) -func (e GrantSourceFilter) ToPointer() *GrantSourceFilter { +func (e GrantFilterGrantSourceFilter) ToPointer() *GrantFilterGrantSourceFilter { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *GrantSourceFilter) IsExact() bool { +func (e *GrantFilterGrantSourceFilter) IsExact() bool { if e != nil { switch *e { case "GRANT_SOURCE_FILTER_UNSPECIFIED", "GRANT_SOURCE_FILTER_DIRECT", "GRANT_SOURCE_FILTER_INHERITED": @@ -82,7 +82,7 @@ type GrantFilter struct { // The grantJustificationType field. GrantJustificationType *GrantJustificationType `json:"grantJustificationType,omitempty"` // The grantSourceFilter field. - GrantSourceFilter *GrantSourceFilter `json:"grantSourceFilter,omitempty"` + GrantSourceFilter *GrantFilterGrantSourceFilter `json:"grantSourceFilter,omitempty"` } func (g *GrantFilter) GetGrantFilterType() *GrantFilterType { @@ -99,7 +99,7 @@ func (g *GrantFilter) GetGrantJustificationType() *GrantJustificationType { return g.GrantJustificationType } -func (g *GrantFilter) GetGrantSourceFilter() *GrantSourceFilter { +func (g *GrantFilter) GetGrantSourceFilter() *GrantFilterGrantSourceFilter { if g == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hook.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hook.go index bbd14cde..300ab716 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hook.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hook.go @@ -14,6 +14,7 @@ const ( EventHookEventTypeUnspecified Event = "HOOK_EVENT_TYPE_UNSPECIFIED" EventHookEventTypePreToolUse Event = "HOOK_EVENT_TYPE_PRE_TOOL_USE" EventHookEventTypePostToolUse Event = "HOOK_EVENT_TYPE_POST_TOOL_USE" + EventHookEventTypePreOutput Event = "HOOK_EVENT_TYPE_PRE_OUTPUT" ) func (e Event) ToPointer() *Event { @@ -24,7 +25,7 @@ func (e Event) ToPointer() *Event { func (e *Event) IsExact() bool { if e != nil { switch *e { - case "HOOK_EVENT_TYPE_UNSPECIFIED", "HOOK_EVENT_TYPE_PRE_TOOL_USE", "HOOK_EVENT_TYPE_POST_TOOL_USE": + case "HOOK_EVENT_TYPE_UNSPECIFIED", "HOOK_EVENT_TYPE_PRE_TOOL_USE", "HOOK_EVENT_TYPE_POST_TOOL_USE", "HOOK_EVENT_TYPE_PRE_OUTPUT": return true } } @@ -36,6 +37,7 @@ func (e *Event) IsExact() bool { // This message contains a oneof named hook_type. Only a single field of the following list may be set at a time: // - function // - builtinPattern +// - jsonPatch type Hook struct { BuiltinPattern *BuiltInPattern `json:"builtinPattern,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` @@ -50,7 +52,13 @@ type Hook struct { Filter *HookFilter `json:"filter,omitempty"` Function *HookFunctionRef `json:"function,omitempty"` // The id field. - ID *string `json:"id,omitempty"` + ID *string `json:"id,omitempty"` + JSONPatch *JSONPatchConfig `json:"jsonPatch,omitempty"` + // managed_by_guardrails marks a hook as selectable in a guardrail rule's + // curated pre_hook_ids/post_hook_ids. A hook left false (the default, + // including every pre-existing hook) always runs regardless of guardrail + // state; a hook set true only runs when a matched rule selects it. + ManagedByGuardrails *bool `json:"managedByGuardrails,omitempty"` // The priority field. Priority *int `json:"priority,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` @@ -130,6 +138,20 @@ func (h *Hook) GetID() *string { return h.ID } +func (h *Hook) GetJSONPatch() *JSONPatchConfig { + if h == nil { + return nil + } + return h.JSONPatch +} + +func (h *Hook) GetManagedByGuardrails() *bool { + if h == nil { + return nil + } + return h.ManagedByGuardrails +} + func (h *Hook) GetPriority() *int { if h == nil { return nil @@ -149,6 +171,7 @@ func (h *Hook) GetUpdatedAt() *time.Time { // This message contains a oneof named hook_type. Only a single field of the following list may be set at a time: // - function // - builtinPattern +// - jsonPatch type HookInput struct { BuiltinPattern *BuiltInPattern `json:"builtinPattern,omitempty"` // The description field. @@ -162,7 +185,13 @@ type HookInput struct { Filter *HookFilter `json:"filter,omitempty"` Function *HookFunctionRef `json:"function,omitempty"` // The id field. - ID *string `json:"id,omitempty"` + ID *string `json:"id,omitempty"` + JSONPatch *JSONPatchConfig `json:"jsonPatch,omitempty"` + // managed_by_guardrails marks a hook as selectable in a guardrail rule's + // curated pre_hook_ids/post_hook_ids. A hook left false (the default, + // including every pre-existing hook) always runs regardless of guardrail + // state; a hook set true only runs when a matched rule selects it. + ManagedByGuardrails *bool `json:"managedByGuardrails,omitempty"` // The priority field. Priority *int `json:"priority,omitempty"` } @@ -223,6 +252,20 @@ func (h *HookInput) GetID() *string { return h.ID } +func (h *HookInput) GetJSONPatch() *JSONPatchConfig { + if h == nil { + return nil + } + return h.JSONPatch +} + +func (h *HookInput) GetManagedByGuardrails() *bool { + if h == nil { + return nil + } + return h.ManagedByGuardrails +} + func (h *HookInput) GetPriority() *int { if h == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hookfilter.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hookfilter.go index 73440df3..802edd64 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hookfilter.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hookfilter.go @@ -2,11 +2,22 @@ package shared -// HookFilter determines which tool calls a hook applies to. +// HookFilter determines which calls (or, for HOOK_EVENT_TYPE_PRE_OUTPUT, +// +// which outgoing response chunks) a hook applies to. type HookFilter struct { - // CEL expression evaluated against tool call context. - // Available variable: ctx.tool_name (string). - // Must evaluate to bool. Empty matches all tools. + // CEL expression evaluated against event context. Must evaluate to bool, + // empty = matches everything for the event type. + // HOOK_EVENT_TYPE_PRE_TOOL_USE / POST_TOOL_USE: ctx.tool_name (string), + // and for a call originating from a chat channel ctx.surface (string, + // "slack", "web", or "teams"), ctx.channel_id (string, the channel the + // message arrived on — only set for "slack"/"teams"; "web" channel refs are + // per-conversation and not admin-predictable), and ctx.workspace_id + // (string, the Slack/Teams workspace, when known). All three are absent + // otherwise, so guard them with has(ctx.surface) / has(ctx.channel_id) / + // has(ctx.workspace_id). + // HOOK_EVENT_TYPE_PRE_OUTPUT: ctx.untrusted_class (string), ctx.surface + // (string, "slack" or "web"). CelExpression *string `json:"celExpression,omitempty"` } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hooksservicecreaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hooksservicecreaterequest.go index 4b1fe2f4..10bc658a 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hooksservicecreaterequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/hooksservicecreaterequest.go @@ -9,6 +9,7 @@ const ( HooksServiceCreateRequestEventHookEventTypeUnspecified HooksServiceCreateRequestEvent = "HOOK_EVENT_TYPE_UNSPECIFIED" HooksServiceCreateRequestEventHookEventTypePreToolUse HooksServiceCreateRequestEvent = "HOOK_EVENT_TYPE_PRE_TOOL_USE" HooksServiceCreateRequestEventHookEventTypePostToolUse HooksServiceCreateRequestEvent = "HOOK_EVENT_TYPE_POST_TOOL_USE" + HooksServiceCreateRequestEventHookEventTypePreOutput HooksServiceCreateRequestEvent = "HOOK_EVENT_TYPE_PRE_OUTPUT" ) func (e HooksServiceCreateRequestEvent) ToPointer() *HooksServiceCreateRequestEvent { @@ -19,7 +20,7 @@ func (e HooksServiceCreateRequestEvent) ToPointer() *HooksServiceCreateRequestEv func (e *HooksServiceCreateRequestEvent) IsExact() bool { if e != nil { switch *e { - case "HOOK_EVENT_TYPE_UNSPECIFIED", "HOOK_EVENT_TYPE_PRE_TOOL_USE", "HOOK_EVENT_TYPE_POST_TOOL_USE": + case "HOOK_EVENT_TYPE_UNSPECIFIED", "HOOK_EVENT_TYPE_PRE_TOOL_USE", "HOOK_EVENT_TYPE_POST_TOOL_USE", "HOOK_EVENT_TYPE_PRE_OUTPUT": return true } } @@ -31,6 +32,7 @@ func (e *HooksServiceCreateRequestEvent) IsExact() bool { // This message contains a oneof named hook_type. Only a single field of the following list may be set at a time: // - function // - builtinPattern +// - jsonPatch type HooksServiceCreateRequest struct { BuiltinPattern *BuiltInPattern `json:"builtinPattern,omitempty"` // The description field. @@ -40,9 +42,12 @@ type HooksServiceCreateRequest struct { // The enabled field. Enabled *bool `json:"enabled,omitempty"` // The event field. - Event *HooksServiceCreateRequestEvent `json:"event,omitempty"` - Filter *HookFilter `json:"filter,omitempty"` - Function *HookFunctionRef `json:"function,omitempty"` + Event *HooksServiceCreateRequestEvent `json:"event,omitempty"` + Filter *HookFilter `json:"filter,omitempty"` + Function *HookFunctionRef `json:"function,omitempty"` + JSONPatch *JSONPatchConfig `json:"jsonPatch,omitempty"` + // The managedByGuardrails field. + ManagedByGuardrails *bool `json:"managedByGuardrails,omitempty"` // The priority field. Priority *int `json:"priority,omitempty"` } @@ -96,6 +101,20 @@ func (h *HooksServiceCreateRequest) GetFunction() *HookFunctionRef { return h.Function } +func (h *HooksServiceCreateRequest) GetJSONPatch() *JSONPatchConfig { + if h == nil { + return nil + } + return h.JSONPatch +} + +func (h *HooksServiceCreateRequest) GetManagedByGuardrails() *bool { + if h == nil { + return nil + } + return h.ManagedByGuardrails +} + func (h *HooksServiceCreateRequest) GetPriority() *int { if h == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/introspectresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/introspectresponse.go index a12d5420..00e70519 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/introspectresponse.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/introspectresponse.go @@ -2,6 +2,28 @@ package shared +type DisabledModules string + +const ( + DisabledModulesModuleIDUnspecified DisabledModules = "MODULE_ID_UNSPECIFIED" + DisabledModulesModuleIDSecretSharing DisabledModules = "MODULE_ID_SECRET_SHARING" +) + +func (e DisabledModules) ToPointer() *DisabledModules { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DisabledModules) IsExact() bool { + if e != nil { + switch *e { + case "MODULE_ID_UNSPECIFIED", "MODULE_ID_SECRET_SHARING": + return true + } + } + return false +} + // IntrospectResponse contains information about the current user who is authenticated. type IntrospectResponse struct { // The OAuth client_id of the device client registered for this token. Present @@ -9,6 +31,11 @@ type IntrospectResponse struct { // once and presents it on the subsequent token exchange. Empty for all other // tokens. DeviceClientID *string `json:"deviceClientId,omitempty"` + // The modules turned off for the tenant the logged in user belongs to. Absent + // from this list means enabled: every module is on by default. Clients MUST + // treat an unrecognized value as "a module this client does not know about is + // disabled". + DisabledModules []DisabledModules `json:"disabledModules,omitempty"` // The list of feature flags enabled for the tenant the logged in user belongs to. Features []string `json:"features,omitempty"` // The list of permissions that the current logged in user has. @@ -30,6 +57,13 @@ func (i *IntrospectResponse) GetDeviceClientID() *string { return i.DeviceClientID } +func (i *IntrospectResponse) GetDisabledModules() []DisabledModules { + if i == nil { + return nil + } + return i.DisabledModules +} + func (i *IntrospectResponse) GetFeatures() []string { if i == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/invokefunctiondispatcher.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/invokefunctiondispatcher.go new file mode 100644 index 00000000..1c1e5e28 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/invokefunctiondispatcher.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// InvokeFunctionDispatcher runs a published C1 function by id. +type InvokeFunctionDispatcher struct { + // Arguments passed to the function, keyed by arg name (v0: verbatim values; + // CEL evaluation is a later phase). + Args map[string]string `json:"args,omitempty"` + // Optional pinned function commit; empty floats to the published commit. + FunctionCommitID *string `json:"functionCommitId,omitempty"` + // ID of the published function to invoke. + FunctionID *string `json:"functionId,omitempty"` +} + +func (i *InvokeFunctionDispatcher) GetArgs() map[string]string { + if i == nil { + return nil + } + return i.Args +} + +func (i *InvokeFunctionDispatcher) GetFunctionCommitID() *string { + if i == nil { + return nil + } + return i.FunctionCommitID +} + +func (i *InvokeFunctionDispatcher) GetFunctionID() *string { + if i == nil { + return nil + } + return i.FunctionID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/jsonpatchconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/jsonpatchconfig.go new file mode 100644 index 00000000..2ec77610 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/jsonpatchconfig.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// JSONPatchConfig adds, overwrites, or removes fields on a tool call's JSON +// +// input, with no function invocation. Only valid on +// HOOK_EVENT_TYPE_PRE_TOOL_USE. cel_expression is evaluated against +// ctx/input/caller and must produce a map; static_overlay is a fixed map. +// Either result is shallow-merged onto the input under RFC 7396 merge patch +// semantics: a key overwrites or adds that key, a null value removes it, and a +// nested object replaces rather than merging into the existing one. +// +// This message contains a oneof named source. Only a single field of the following list may be set at a time: +// - celExpression +// - staticOverlay +type JSONPatchConfig struct { + // The celExpression field. + // This field is part of the `source` oneof. + // See the documentation for `c1.api.hooks.v1.JSONPatchConfig` for more details. + CelExpression *string `json:"celExpression,omitempty"` + StaticOverlay map[string]any `json:"staticOverlay,omitempty"` +} + +func (j *JSONPatchConfig) GetCelExpression() *string { + if j == nil { + return nil + } + return j.CelExpression +} + +func (j *JSONPatchConfig) GetStaticOverlay() map[string]any { + if j == nil { + return nil + } + return j.StaticOverlay +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/linkfilterconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/linkfilterconfig.go new file mode 100644 index 00000000..65073ae3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/linkfilterconfig.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// LinkFilterConfigAction - Action taken on a disallowed link. Unspecified = REDACT. +type LinkFilterConfigAction string + +const ( + LinkFilterConfigActionLinkFilterActionUnspecified LinkFilterConfigAction = "LINK_FILTER_ACTION_UNSPECIFIED" + LinkFilterConfigActionLinkFilterActionRedact LinkFilterConfigAction = "LINK_FILTER_ACTION_REDACT" + LinkFilterConfigActionLinkFilterActionAnnotate LinkFilterConfigAction = "LINK_FILTER_ACTION_ANNOTATE" +) + +func (e LinkFilterConfigAction) ToPointer() *LinkFilterConfigAction { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *LinkFilterConfigAction) IsExact() bool { + if e != nil { + switch *e { + case "LINK_FILTER_ACTION_UNSPECIFIED", "LINK_FILTER_ACTION_REDACT", "LINK_FILTER_ACTION_ANNOTATE": + return true + } + } + return false +} + +// LinkFilterConfig strips or annotates URLs and markdown images in tool output +// +// whose host is not in allowed_hosts. +type LinkFilterConfig struct { + // Action taken on a disallowed link. Unspecified = REDACT. + Action *LinkFilterConfigAction `json:"action,omitempty"` + // Hosts that are permitted. Empty = every host is disallowed. Matched + // case-insensitively; a leading "." allows subdomains. + AllowedHosts []string `json:"allowedHosts,omitempty"` + // When true, markdown image links to disallowed hosts are also acted on. + BlockImages *bool `json:"blockImages,omitempty"` +} + +func (l *LinkFilterConfig) GetAction() *LinkFilterConfigAction { + if l == nil { + return nil + } + return l.Action +} + +func (l *LinkFilterConfig) GetAllowedHosts() []string { + if l == nil { + return nil + } + return l.AllowedHosts +} + +func (l *LinkFilterConfig) GetBlockImages() *bool { + if l == nil { + return nil + } + return l.BlockImages +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listappmanagedstatebindingsresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listappmanagedstatebindingsresponse.go new file mode 100644 index 00000000..3b311990 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listappmanagedstatebindingsresponse.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" +) + +// ListAppManagedStateBindingsResponseExpanded - Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +type ListAppManagedStateBindingsResponseExpanded struct { + // The type of the serialized message. + AtType *string `json:"@type,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (l ListAppManagedStateBindingsResponseExpanded) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAppManagedStateBindingsResponseExpanded) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListAppManagedStateBindingsResponseExpanded) GetAtType() *string { + if l == nil { + return nil + } + return l.AtType +} + +func (l *ListAppManagedStateBindingsResponseExpanded) GetAdditionalProperties() map[string]any { + if l == nil { + return nil + } + return l.AdditionalProperties +} + +// ListAppManagedStateBindingsResponse contains one page of discovered application managed states. +type ListAppManagedStateBindingsResponse struct { + // Related objects included for gRPC requests that set expand_mask. + Expanded []ListAppManagedStateBindingsResponseExpanded `json:"expanded,omitempty"` + // Managed states of the discovered applications. + List []AppManagedStateBindingView `json:"list,omitempty"` + // Pagination token for the next page. Empty when there are no more results. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (l *ListAppManagedStateBindingsResponse) GetExpanded() []ListAppManagedStateBindingsResponseExpanded { + if l == nil { + return nil + } + return l.Expanded +} + +func (l *ListAppManagedStateBindingsResponse) GetList() []AppManagedStateBindingView { + if l == nil { + return nil + } + return l.List +} + +func (l *ListAppManagedStateBindingsResponse) GetNextPageToken() *string { + if l == nil { + return nil + } + return l.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listfindingsettingsresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listfindingsettingsresponse.go new file mode 100644 index 00000000..f379d0c5 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listfindingsettingsresponse.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ListFindingSettingsResponse message. +type ListFindingSettingsResponse struct { + // True once the tenant has explicitly saved their finding-type settings at + // least once, regardless of whether any value differs from default. False + // means the tenant has never saved, so every entry in `list` is the + // shipped default, unconfirmed by the tenant. + Configured *bool `json:"configured,omitempty"` + // One entry per configurable finding type, in FindingType declaration order. + // Custom findings are excluded: they arrive over CreateFinding rather than + // from a detector, so there is nothing to switch off. + List []FindingTypeSetting `json:"list,omitempty"` +} + +func (l *ListFindingSettingsResponse) GetConfigured() *bool { + if l == nil { + return nil + } + return l.Configured +} + +func (l *ListFindingSettingsResponse) GetList() []FindingTypeSetting { + if l == nil { + return nil + } + return l.List +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listgatewaykeysresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listgatewaykeysresponse.go new file mode 100644 index 00000000..3e3e430a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/listgatewaykeysresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ListGatewayKeysResponse message. +type ListGatewayKeysResponse struct { + // The list field. + List []GatewayKey `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (l *ListGatewayKeysResponse) GetList() []GatewayKey { + if l == nil { + return nil + } + return l.List +} + +func (l *ListGatewayKeysResponse) GetNextPageToken() *string { + if l == nil { + return nil + } + return l.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofile.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofile.go index a33923e0..f2c57612 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofile.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofile.go @@ -13,6 +13,11 @@ type MCPAccessProfile struct { AppEntitlementID *string `json:"appEntitlementId,omitempty"` // App identifier (app that owns the connector). AppID *string `json:"appId,omitempty"` + // Display name of the connector this toolset belongs to. Computed read-only; + // populated on every read. The + // auto-maintained default toolsets share a display name across connectors, so + // this is what tells two of them apart. + ConnectorDisplayName *string `json:"connectorDisplayName,omitempty"` // Connector identifier. ConnectorID *string `json:"connectorId,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` @@ -23,6 +28,9 @@ type MCPAccessProfile struct { DisplayName *string `json:"displayName,omitempty"` // Unique identifier for this access profile. ID *string `json:"id,omitempty"` + // Whether this toolset's backing entitlement is exposed in at least one + // request catalog (i.e. can be requested). Computed read-only; populated on List. + Requestable *bool `json:"requestable,omitempty"` // The number of tools currently bound to this profile. ToolCount *int `json:"toolCount,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` @@ -53,6 +61,13 @@ func (m *MCPAccessProfile) GetAppID() *string { return m.AppID } +func (m *MCPAccessProfile) GetConnectorDisplayName() *string { + if m == nil { + return nil + } + return m.ConnectorDisplayName +} + func (m *MCPAccessProfile) GetConnectorID() *string { if m == nil { return nil @@ -95,6 +110,13 @@ func (m *MCPAccessProfile) GetID() *string { return m.ID } +func (m *MCPAccessProfile) GetRequestable() *bool { + if m == nil { + return nil + } + return m.Requestable +} + func (m *MCPAccessProfile) GetToolCount() *int { if m == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileinput.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileinput.go new file mode 100644 index 00000000..7bb0770c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileinput.go @@ -0,0 +1,110 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// MCPAccessProfileInput - MCPAccessProfile represents an admin-curated grouping of MCP tools. +type MCPAccessProfileInput struct { + // The ID of the AppEntitlement created for this profile. + AppEntitlementID *string `json:"appEntitlementId,omitempty"` + // App identifier (app that owns the connector). + AppID *string `json:"appId,omitempty"` + // Connector identifier. + ConnectorID *string `json:"connectorId,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + // Description of what access this profile grants. + Description *string `json:"description,omitempty"` + // Display name for the profile. + DisplayName *string `json:"displayName,omitempty"` + // Unique identifier for this access profile. + ID *string `json:"id,omitempty"` + // The number of tools currently bound to this profile. + ToolCount *int `json:"toolCount,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (m MCPAccessProfileInput) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MCPAccessProfileInput) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MCPAccessProfileInput) GetAppEntitlementID() *string { + if m == nil { + return nil + } + return m.AppEntitlementID +} + +func (m *MCPAccessProfileInput) GetAppID() *string { + if m == nil { + return nil + } + return m.AppID +} + +func (m *MCPAccessProfileInput) GetConnectorID() *string { + if m == nil { + return nil + } + return m.ConnectorID +} + +func (m *MCPAccessProfileInput) GetCreatedAt() *time.Time { + if m == nil { + return nil + } + return m.CreatedAt +} + +func (m *MCPAccessProfileInput) GetDeletedAt() *time.Time { + if m == nil { + return nil + } + return m.DeletedAt +} + +func (m *MCPAccessProfileInput) GetDescription() *string { + if m == nil { + return nil + } + return m.Description +} + +func (m *MCPAccessProfileInput) GetDisplayName() *string { + if m == nil { + return nil + } + return m.DisplayName +} + +func (m *MCPAccessProfileInput) GetID() *string { + if m == nil { + return nil + } + return m.ID +} + +func (m *MCPAccessProfileInput) GetToolCount() *int { + if m == nil { + return nil + } + return m.ToolCount +} + +func (m *MCPAccessProfileInput) GetUpdatedAt() *time.Time { + if m == nil { + return nil + } + return m.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileservicesearchaccessprofilesresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileservicesearchaccessprofilesresponse.go new file mode 100644 index 00000000..8bbf52ff --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileservicesearchaccessprofilesresponse.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// MCPAccessProfileServiceSearchAccessProfilesResponse returns one page of +// +// tenant-wide MCP access profiles. +type MCPAccessProfileServiceSearchAccessProfilesResponse struct { + // Token for next page. + NextPageToken *string `json:"nextPageToken,omitempty"` + // The page of matching MCP access profiles. + Profiles []MCPAccessProfile `json:"profiles,omitempty"` +} + +func (m *MCPAccessProfileServiceSearchAccessProfilesResponse) GetNextPageToken() *string { + if m == nil { + return nil + } + return m.NextPageToken +} + +func (m *MCPAccessProfileServiceSearchAccessProfilesResponse) GetProfiles() []MCPAccessProfile { + if m == nil { + return nil + } + return m.Profiles +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileserviceupdaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileserviceupdaterequest.go index 33c55fe3..2a81b324 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileserviceupdaterequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpaccessprofileserviceupdaterequest.go @@ -4,11 +4,11 @@ package shared // MCPAccessProfileServiceUpdateRequest updates an existing MCP access profile. type MCPAccessProfileServiceUpdateRequest struct { - Profile *MCPAccessProfile `json:"profile,omitempty"` - UpdateMask *string `json:"updateMask,omitempty"` + Profile *MCPAccessProfileInput `json:"profile,omitempty"` + UpdateMask *string `json:"updateMask,omitempty"` } -func (m *MCPAccessProfileServiceUpdateRequest) GetProfile() *MCPAccessProfile { +func (m *MCPAccessProfileServiceUpdateRequest) GetProfile() *MCPAccessProfileInput { if m == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresource.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresource.go new file mode 100644 index 00000000..63b3df53 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresource.go @@ -0,0 +1,408 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// MCPResourceKind - Whether this is a static resource or a URI template. +type MCPResourceKind string + +const ( + MCPResourceKindMcpResourceKindUnspecified MCPResourceKind = "MCP_RESOURCE_KIND_UNSPECIFIED" + MCPResourceKindMcpResourceKindStatic MCPResourceKind = "MCP_RESOURCE_KIND_STATIC" + MCPResourceKindMcpResourceKindTemplate MCPResourceKind = "MCP_RESOURCE_KIND_TEMPLATE" +) + +func (e MCPResourceKind) ToPointer() *MCPResourceKind { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *MCPResourceKind) IsExact() bool { + if e != nil { + switch *e { + case "MCP_RESOURCE_KIND_UNSPECIFIED", "MCP_RESOURCE_KIND_STATIC", "MCP_RESOURCE_KIND_TEMPLATE": + return true + } + } + return false +} + +// MCPResourceState - Resource approval/lifecycle state. +type MCPResourceState string + +const ( + MCPResourceStateMcpResourceStateUnspecified MCPResourceState = "MCP_RESOURCE_STATE_UNSPECIFIED" + MCPResourceStateMcpResourceStatePendingReview MCPResourceState = "MCP_RESOURCE_STATE_PENDING_REVIEW" + MCPResourceStateMcpResourceStateApproved MCPResourceState = "MCP_RESOURCE_STATE_APPROVED" + MCPResourceStateMcpResourceStateDisabled MCPResourceState = "MCP_RESOURCE_STATE_DISABLED" + MCPResourceStateMcpResourceStateRemoved MCPResourceState = "MCP_RESOURCE_STATE_REMOVED" +) + +func (e MCPResourceState) ToPointer() *MCPResourceState { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *MCPResourceState) IsExact() bool { + if e != nil { + switch *e { + case "MCP_RESOURCE_STATE_UNSPECIFIED", "MCP_RESOURCE_STATE_PENDING_REVIEW", "MCP_RESOURCE_STATE_APPROVED", "MCP_RESOURCE_STATE_DISABLED", "MCP_RESOURCE_STATE_REMOVED": + return true + } + } + return false +} + +// MCPResource represents metadata about an individual resource discovered from an MCP server. +type MCPResource struct { + // Bound AppEntitlement created during sync. + AppEntitlementID *string `json:"appEntitlementId,omitempty"` + // App identifier (app that owns the connector). + AppID *string `json:"appId,omitempty"` + // Connector identifier. + ConnectorID *string `json:"connectorId,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + // Description from the MCP resource spec. + Description *string `json:"description,omitempty"` + // Hash of resource definition for change detection. + DiscoveryHash *string `json:"discoveryHash,omitempty"` + // Whether the bound app entitlement exists and is not deleted. Computed + // read-only; populated on Search only when the request had + // include_grant_status = true; ignored on write. + EntitlementActive *bool `json:"entitlementActive,omitempty"` + // Number of active grants on the bound app entitlement. Computed read-only; + // populated on Search only when the request had include_grant_status = true; + // ignored on write. + GrantCount *int64 `integer:"string" json:"grantCount,omitempty"` + // Unique identifier for this MCP resource record. + ID *string `json:"id,omitempty"` + // Whether this is a static resource or a URI template. + Kind *MCPResourceKind `json:"kind,omitempty"` + LastDiscoveredAt *time.Time `json:"lastDiscoveredAt,omitempty"` + // MIME type of the resource content, when known. + MimeType *string `json:"mimeType,omitempty"` + // Native MCP resource name (unique within an MCP server). + Name *string `json:"name,omitempty"` + // Resource approval/lifecycle state. + State *MCPResourceState `json:"state,omitempty"` + // Human-readable title from the MCP resource spec. + Title *string `json:"title,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Raw resource URI from MCP discovery (set for STATIC resources). + URI *string `json:"uri,omitempty"` + // Raw RFC 6570 URI template from MCP discovery (set for TEMPLATE resources). + URITemplate *string `json:"uriTemplate,omitempty"` +} + +func (m MCPResource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MCPResource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MCPResource) GetAppEntitlementID() *string { + if m == nil { + return nil + } + return m.AppEntitlementID +} + +func (m *MCPResource) GetAppID() *string { + if m == nil { + return nil + } + return m.AppID +} + +func (m *MCPResource) GetConnectorID() *string { + if m == nil { + return nil + } + return m.ConnectorID +} + +func (m *MCPResource) GetCreatedAt() *time.Time { + if m == nil { + return nil + } + return m.CreatedAt +} + +func (m *MCPResource) GetDeletedAt() *time.Time { + if m == nil { + return nil + } + return m.DeletedAt +} + +func (m *MCPResource) GetDescription() *string { + if m == nil { + return nil + } + return m.Description +} + +func (m *MCPResource) GetDiscoveryHash() *string { + if m == nil { + return nil + } + return m.DiscoveryHash +} + +func (m *MCPResource) GetEntitlementActive() *bool { + if m == nil { + return nil + } + return m.EntitlementActive +} + +func (m *MCPResource) GetGrantCount() *int64 { + if m == nil { + return nil + } + return m.GrantCount +} + +func (m *MCPResource) GetID() *string { + if m == nil { + return nil + } + return m.ID +} + +func (m *MCPResource) GetKind() *MCPResourceKind { + if m == nil { + return nil + } + return m.Kind +} + +func (m *MCPResource) GetLastDiscoveredAt() *time.Time { + if m == nil { + return nil + } + return m.LastDiscoveredAt +} + +func (m *MCPResource) GetMimeType() *string { + if m == nil { + return nil + } + return m.MimeType +} + +func (m *MCPResource) GetName() *string { + if m == nil { + return nil + } + return m.Name +} + +func (m *MCPResource) GetState() *MCPResourceState { + if m == nil { + return nil + } + return m.State +} + +func (m *MCPResource) GetTitle() *string { + if m == nil { + return nil + } + return m.Title +} + +func (m *MCPResource) GetUpdatedAt() *time.Time { + if m == nil { + return nil + } + return m.UpdatedAt +} + +func (m *MCPResource) GetURI() *string { + if m == nil { + return nil + } + return m.URI +} + +func (m *MCPResource) GetURITemplate() *string { + if m == nil { + return nil + } + return m.URITemplate +} + +// MCPResourceInput - MCPResource represents metadata about an individual resource discovered from an MCP server. +type MCPResourceInput struct { + // Bound AppEntitlement created during sync. + AppEntitlementID *string `json:"appEntitlementId,omitempty"` + // App identifier (app that owns the connector). + AppID *string `json:"appId,omitempty"` + // Connector identifier. + ConnectorID *string `json:"connectorId,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + // Description from the MCP resource spec. + Description *string `json:"description,omitempty"` + // Hash of resource definition for change detection. + DiscoveryHash *string `json:"discoveryHash,omitempty"` + // Unique identifier for this MCP resource record. + ID *string `json:"id,omitempty"` + // Whether this is a static resource or a URI template. + Kind *MCPResourceKind `json:"kind,omitempty"` + LastDiscoveredAt *time.Time `json:"lastDiscoveredAt,omitempty"` + // MIME type of the resource content, when known. + MimeType *string `json:"mimeType,omitempty"` + // Native MCP resource name (unique within an MCP server). + Name *string `json:"name,omitempty"` + // Resource approval/lifecycle state. + State *MCPResourceState `json:"state,omitempty"` + // Human-readable title from the MCP resource spec. + Title *string `json:"title,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Raw resource URI from MCP discovery (set for STATIC resources). + URI *string `json:"uri,omitempty"` + // Raw RFC 6570 URI template from MCP discovery (set for TEMPLATE resources). + URITemplate *string `json:"uriTemplate,omitempty"` +} + +func (m MCPResourceInput) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MCPResourceInput) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MCPResourceInput) GetAppEntitlementID() *string { + if m == nil { + return nil + } + return m.AppEntitlementID +} + +func (m *MCPResourceInput) GetAppID() *string { + if m == nil { + return nil + } + return m.AppID +} + +func (m *MCPResourceInput) GetConnectorID() *string { + if m == nil { + return nil + } + return m.ConnectorID +} + +func (m *MCPResourceInput) GetCreatedAt() *time.Time { + if m == nil { + return nil + } + return m.CreatedAt +} + +func (m *MCPResourceInput) GetDeletedAt() *time.Time { + if m == nil { + return nil + } + return m.DeletedAt +} + +func (m *MCPResourceInput) GetDescription() *string { + if m == nil { + return nil + } + return m.Description +} + +func (m *MCPResourceInput) GetDiscoveryHash() *string { + if m == nil { + return nil + } + return m.DiscoveryHash +} + +func (m *MCPResourceInput) GetID() *string { + if m == nil { + return nil + } + return m.ID +} + +func (m *MCPResourceInput) GetKind() *MCPResourceKind { + if m == nil { + return nil + } + return m.Kind +} + +func (m *MCPResourceInput) GetLastDiscoveredAt() *time.Time { + if m == nil { + return nil + } + return m.LastDiscoveredAt +} + +func (m *MCPResourceInput) GetMimeType() *string { + if m == nil { + return nil + } + return m.MimeType +} + +func (m *MCPResourceInput) GetName() *string { + if m == nil { + return nil + } + return m.Name +} + +func (m *MCPResourceInput) GetState() *MCPResourceState { + if m == nil { + return nil + } + return m.State +} + +func (m *MCPResourceInput) GetTitle() *string { + if m == nil { + return nil + } + return m.Title +} + +func (m *MCPResourceInput) GetUpdatedAt() *time.Time { + if m == nil { + return nil + } + return m.UpdatedAt +} + +func (m *MCPResourceInput) GetURI() *string { + if m == nil { + return nil + } + return m.URI +} + +func (m *MCPResourceInput) GetURITemplate() *string { + if m == nil { + return nil + } + return m.URITemplate +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourcehistoryentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourcehistoryentry.go new file mode 100644 index 00000000..3ba1fbf7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourcehistoryentry.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// MCPResourceHistoryEntry is one version of an MCP resource and its history metadata. +type MCPResourceHistoryEntry struct { + Metadata *HistoryEntryMetadata `json:"metadata,omitempty"` + Snapshot *MCPResource `json:"snapshot,omitempty"` +} + +func (m *MCPResourceHistoryEntry) GetMetadata() *HistoryEntryMetadata { + if m == nil { + return nil + } + return m.Metadata +} + +func (m *MCPResourceHistoryEntry) GetSnapshot() *MCPResource { + if m == nil { + return nil + } + return m.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicegetresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicegetresponse.go new file mode 100644 index 00000000..030d1c09 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicegetresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// MCPResourceServiceGetResponse returns a single MCP resource. +type MCPResourceServiceGetResponse struct { + Resource *MCPResource `json:"resource,omitempty"` +} + +func (m *MCPResourceServiceGetResponse) GetResource() *MCPResource { + if m == nil { + return nil + } + return m.Resource +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicelisthistoryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicelisthistoryresponse.go new file mode 100644 index 00000000..5cb83fdc --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicelisthistoryresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// MCPResourceServiceListHistoryResponse returns MCP resource history entries. +type MCPResourceServiceListHistoryResponse struct { + // The page of history entries, newest first. + List []MCPResourceHistoryEntry `json:"list,omitempty"` + // Pagination token for the next page, or empty if there are no more results. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (m *MCPResourceServiceListHistoryResponse) GetList() []MCPResourceHistoryEntry { + if m == nil { + return nil + } + return m.List +} + +func (m *MCPResourceServiceListHistoryResponse) GetNextPageToken() *string { + if m == nil { + return nil + } + return m.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicelistresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicelistresponse.go new file mode 100644 index 00000000..13828b32 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicelistresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// MCPResourceServiceListResponse returns a list of MCP resources. +type MCPResourceServiceListResponse struct { + // Token for next page. + NextPageToken *string `json:"nextPageToken,omitempty"` + // List of MCP resources. + Resources []MCPResource `json:"resources,omitempty"` +} + +func (m *MCPResourceServiceListResponse) GetNextPageToken() *string { + if m == nil { + return nil + } + return m.NextPageToken +} + +func (m *MCPResourceServiceListResponse) GetResources() []MCPResource { + if m == nil { + return nil + } + return m.Resources +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicesearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicesearchrequest.go new file mode 100644 index 00000000..dea97780 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicesearchrequest.go @@ -0,0 +1,182 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +type KindFilter string + +const ( + KindFilterMcpResourceKindUnspecified KindFilter = "MCP_RESOURCE_KIND_UNSPECIFIED" + KindFilterMcpResourceKindStatic KindFilter = "MCP_RESOURCE_KIND_STATIC" + KindFilterMcpResourceKindTemplate KindFilter = "MCP_RESOURCE_KIND_TEMPLATE" +) + +func (e KindFilter) ToPointer() *KindFilter { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *KindFilter) IsExact() bool { + if e != nil { + switch *e { + case "MCP_RESOURCE_KIND_UNSPECIFIED", "MCP_RESOURCE_KIND_STATIC", "MCP_RESOURCE_KIND_TEMPLATE": + return true + } + } + return false +} + +// MCPResourceServiceSearchRequestSortBy - Sort order for results. UNSPECIFIED sorts by resource name ascending. +type MCPResourceServiceSearchRequestSortBy string + +const ( + MCPResourceServiceSearchRequestSortByMcpResourceSortByUnspecified MCPResourceServiceSearchRequestSortBy = "MCP_RESOURCE_SORT_BY_UNSPECIFIED" + MCPResourceServiceSearchRequestSortByMcpResourceSortByName MCPResourceServiceSearchRequestSortBy = "MCP_RESOURCE_SORT_BY_NAME" + MCPResourceServiceSearchRequestSortByMcpResourceSortByURI MCPResourceServiceSearchRequestSortBy = "MCP_RESOURCE_SORT_BY_URI" + MCPResourceServiceSearchRequestSortByMcpResourceSortByState MCPResourceServiceSearchRequestSortBy = "MCP_RESOURCE_SORT_BY_STATE" + MCPResourceServiceSearchRequestSortByMcpResourceSortByUpdatedAt MCPResourceServiceSearchRequestSortBy = "MCP_RESOURCE_SORT_BY_UPDATED_AT" +) + +func (e MCPResourceServiceSearchRequestSortBy) ToPointer() *MCPResourceServiceSearchRequestSortBy { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *MCPResourceServiceSearchRequestSortBy) IsExact() bool { + if e != nil { + switch *e { + case "MCP_RESOURCE_SORT_BY_UNSPECIFIED", "MCP_RESOURCE_SORT_BY_NAME", "MCP_RESOURCE_SORT_BY_URI", "MCP_RESOURCE_SORT_BY_STATE", "MCP_RESOURCE_SORT_BY_UPDATED_AT": + return true + } + } + return false +} + +// SortDirection - Direction for sort_by. UNSPECIFIED means ascending. +type SortDirection string + +const ( + SortDirectionSortDirectionUnspecified SortDirection = "SORT_DIRECTION_UNSPECIFIED" + SortDirectionSortDirectionAsc SortDirection = "SORT_DIRECTION_ASC" + SortDirectionSortDirectionDesc SortDirection = "SORT_DIRECTION_DESC" +) + +func (e SortDirection) ToPointer() *SortDirection { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SortDirection) IsExact() bool { + if e != nil { + switch *e { + case "SORT_DIRECTION_UNSPECIFIED", "SORT_DIRECTION_ASC", "SORT_DIRECTION_DESC": + return true + } + } + return false +} + +type StateFilter string + +const ( + StateFilterMcpResourceStateUnspecified StateFilter = "MCP_RESOURCE_STATE_UNSPECIFIED" + StateFilterMcpResourceStatePendingReview StateFilter = "MCP_RESOURCE_STATE_PENDING_REVIEW" + StateFilterMcpResourceStateApproved StateFilter = "MCP_RESOURCE_STATE_APPROVED" + StateFilterMcpResourceStateDisabled StateFilter = "MCP_RESOURCE_STATE_DISABLED" + StateFilterMcpResourceStateRemoved StateFilter = "MCP_RESOURCE_STATE_REMOVED" +) + +func (e StateFilter) ToPointer() *StateFilter { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *StateFilter) IsExact() bool { + if e != nil { + switch *e { + case "MCP_RESOURCE_STATE_UNSPECIFIED", "MCP_RESOURCE_STATE_PENDING_REVIEW", "MCP_RESOURCE_STATE_APPROVED", "MCP_RESOURCE_STATE_DISABLED", "MCP_RESOURCE_STATE_REMOVED": + return true + } + } + return false +} + +// MCPResourceServiceSearchRequest searches MCP resources with filters. +type MCPResourceServiceSearchRequest struct { + // When true, the server populates the computed entitlement_active and + // grant_count fields on each returned row (an extra batched entitlement + // lookup per page). Off by default so callers that don't render grant + // status don't pay for it. + IncludeGrantStatus *bool `json:"includeGrantStatus,omitempty"` + // Optional filter by resource kind. An empty list means no filter. + KindFilter []KindFilter `json:"kindFilter,omitempty"` + // Page size (max 100). + PageSize *int `json:"pageSize,omitempty"` + // Page token for pagination. + PageToken *string `json:"pageToken,omitempty"` + // Optional text query matched against name, title, description, and uri. + Query *string `json:"query,omitempty"` + // Sort order for results. UNSPECIFIED sorts by resource name ascending. + SortBy *MCPResourceServiceSearchRequestSortBy `json:"sortBy,omitempty"` + // Direction for sort_by. UNSPECIFIED means ascending. + SortDirection *SortDirection `json:"sortDirection,omitempty"` + // Optional filter by resource state. An empty list defaults to + // PENDING_REVIEW, APPROVED, and DISABLED (REMOVED is hidden unless + // explicitly requested). + StateFilter []StateFilter `json:"stateFilter,omitempty"` +} + +func (m *MCPResourceServiceSearchRequest) GetIncludeGrantStatus() *bool { + if m == nil { + return nil + } + return m.IncludeGrantStatus +} + +func (m *MCPResourceServiceSearchRequest) GetKindFilter() []KindFilter { + if m == nil { + return nil + } + return m.KindFilter +} + +func (m *MCPResourceServiceSearchRequest) GetPageSize() *int { + if m == nil { + return nil + } + return m.PageSize +} + +func (m *MCPResourceServiceSearchRequest) GetPageToken() *string { + if m == nil { + return nil + } + return m.PageToken +} + +func (m *MCPResourceServiceSearchRequest) GetQuery() *string { + if m == nil { + return nil + } + return m.Query +} + +func (m *MCPResourceServiceSearchRequest) GetSortBy() *MCPResourceServiceSearchRequestSortBy { + if m == nil { + return nil + } + return m.SortBy +} + +func (m *MCPResourceServiceSearchRequest) GetSortDirection() *SortDirection { + if m == nil { + return nil + } + return m.SortDirection +} + +func (m *MCPResourceServiceSearchRequest) GetStateFilter() []StateFilter { + if m == nil { + return nil + } + return m.StateFilter +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicesearchresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicesearchresponse.go new file mode 100644 index 00000000..51efde32 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceservicesearchresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// MCPResourceServiceSearchResponse returns matching MCP resources. +type MCPResourceServiceSearchResponse struct { + // Matching MCP resources. + List []MCPResource `json:"list,omitempty"` + // Token for next page. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (m *MCPResourceServiceSearchResponse) GetList() []MCPResource { + if m == nil { + return nil + } + return m.List +} + +func (m *MCPResourceServiceSearchResponse) GetNextPageToken() *string { + if m == nil { + return nil + } + return m.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceserviceupdaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceserviceupdaterequest.go new file mode 100644 index 00000000..030a7656 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceserviceupdaterequest.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// MCPResourceServiceUpdateRequest updates an existing MCP resource. +type MCPResourceServiceUpdateRequest struct { + Resource *MCPResourceInput `json:"resource,omitempty"` + UpdateMask *string `json:"updateMask,omitempty"` +} + +func (m *MCPResourceServiceUpdateRequest) GetResource() *MCPResourceInput { + if m == nil { + return nil + } + return m.Resource +} + +func (m *MCPResourceServiceUpdateRequest) GetUpdateMask() *string { + if m == nil { + return nil + } + return m.UpdateMask +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceserviceupdateresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceserviceupdateresponse.go new file mode 100644 index 00000000..508a8f5b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpresourceserviceupdateresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// MCPResourceServiceUpdateResponse returns the updated MCP resource. +type MCPResourceServiceUpdateResponse struct { + Resource *MCPResource `json:"resource,omitempty"` +} + +func (m *MCPResourceServiceUpdateResponse) GetResource() *MCPResource { + if m == nil { + return nil + } + return m.Resource +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpservercatalogauthmode.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpservercatalogauthmode.go index d2cc8101..c69afc6f 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpservercatalogauthmode.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpservercatalogauthmode.go @@ -30,6 +30,33 @@ func (e *MCPServerCatalogAuthModeAuthMethod) IsExact() bool { return false } +// MCPServerCatalogAuthModeClientIDMode - How the OAuth2 client_id is acquired for this mode. Set by the impl bundle +// +// and shown read-only on the form. authorization_code grant only. +type MCPServerCatalogAuthModeClientIDMode string + +const ( + MCPServerCatalogAuthModeClientIDModeMcpServerCatalogClientIDModeUnspecified MCPServerCatalogAuthModeClientIDMode = "MCP_SERVER_CATALOG_CLIENT_ID_MODE_UNSPECIFIED" + MCPServerCatalogAuthModeClientIDModeMcpServerCatalogClientIDModeManual MCPServerCatalogAuthModeClientIDMode = "MCP_SERVER_CATALOG_CLIENT_ID_MODE_MANUAL" + MCPServerCatalogAuthModeClientIDModeMcpServerCatalogClientIDModeDcr MCPServerCatalogAuthModeClientIDMode = "MCP_SERVER_CATALOG_CLIENT_ID_MODE_DCR" + MCPServerCatalogAuthModeClientIDModeMcpServerCatalogClientIDModeCimd MCPServerCatalogAuthModeClientIDMode = "MCP_SERVER_CATALOG_CLIENT_ID_MODE_CIMD" +) + +func (e MCPServerCatalogAuthModeClientIDMode) ToPointer() *MCPServerCatalogAuthModeClientIDMode { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *MCPServerCatalogAuthModeClientIDMode) IsExact() bool { + if e != nil { + switch *e { + case "MCP_SERVER_CATALOG_CLIENT_ID_MODE_UNSPECIFIED", "MCP_SERVER_CATALOG_CLIENT_ID_MODE_MANUAL", "MCP_SERVER_CATALOG_CLIENT_ID_MODE_DCR", "MCP_SERVER_CATALOG_CLIENT_ID_MODE_CIMD": + return true + } + } + return false +} + // MCPServerCatalogAuthMode describes a single authentication method an impl // // supports. Multiple modes mean the user/admin can pick at registration time @@ -44,6 +71,9 @@ type MCPServerCatalogAuthMode struct { AuthStyle *string `json:"authStyle,omitempty"` // OAuth2 authorization endpoint URL. Empty for non-OAuth2 methods. AuthorizeURL *string `json:"authorizeUrl,omitempty"` + // How the OAuth2 client_id is acquired for this mode. Set by the impl bundle + // and shown read-only on the form. authorization_code grant only. + ClientIDMode *MCPServerCatalogAuthModeClientIDMode `json:"clientIdMode,omitempty"` // Documentation URL where the user can obtain a credential for this method // (e.g., a link to the SaaS app's "create API token" page). Empty if not set. CredentialURL *string `json:"credentialUrl,omitempty"` @@ -69,6 +99,9 @@ type MCPServerCatalogAuthMode struct { // Raw bundle string: "client_credentials", "authorization_code", // "jwt_bearer", "google_service_account", or empty (infer from authorize_url). Oauth2Grant *string `json:"oauth2Grant,omitempty"` + // Optional (opt-in) OAuth2 scopes from the config's optional_scopes. + // Disjoint from `scopes` and not pre-selected. Empty for non-OAuth2 methods. + OptionalScopes []string `json:"optionalScopes,omitempty"` // Per-user OAuth: each user authorizes individually instead of sharing a // service-level credential. Only meaningful for OAuth2. Passthrough *bool `json:"passthrough,omitempty"` @@ -102,6 +135,13 @@ func (m *MCPServerCatalogAuthMode) GetAuthorizeURL() *string { return m.AuthorizeURL } +func (m *MCPServerCatalogAuthMode) GetClientIDMode() *MCPServerCatalogAuthModeClientIDMode { + if m == nil { + return nil + } + return m.ClientIDMode +} + func (m *MCPServerCatalogAuthMode) GetCredentialURL() *string { if m == nil { return nil @@ -158,6 +198,13 @@ func (m *MCPServerCatalogAuthMode) GetOauth2Grant() *string { return m.Oauth2Grant } +func (m *MCPServerCatalogAuthMode) GetOptionalScopes() []string { + if m == nil { + return nil + } + return m.OptionalScopes +} + func (m *MCPServerCatalogAuthMode) GetPassthrough() *bool { if m == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpservercatalogentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpservercatalogentry.go index ebe370b3..c3740031 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpservercatalogentry.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpservercatalogentry.go @@ -164,6 +164,12 @@ type MCPServerCatalogEntry struct { // // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. DefaultTokenURL *string `json:"defaultTokenUrl,omitempty"` + // Curated default tool-name prefix an admin gets when they register this + // catalog entry and set no custom prefix: the impl's declared server_prefix, + // else its service_name. Shown as a placeholder in the create wizard's tool + // prefix field. Empty when the impl declares no curated default. Mirrors the + // read-only default_tool_prefix on MCPServerView surfaced in the edit flow. + DefaultToolPrefix *string `json:"defaultToolPrefix,omitempty"` // Short description of what the MCP server does. Description *string `json:"description,omitempty"` // Human-readable display name. @@ -249,6 +255,13 @@ func (m *MCPServerCatalogEntry) GetDefaultTokenURL() *string { return m.DefaultTokenURL } +func (m *MCPServerCatalogEntry) GetDefaultToolPrefix() *string { + if m == nil { + return nil + } + return m.DefaultToolPrefix +} + func (m *MCPServerCatalogEntry) GetDescription() *string { if m == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverserviceregisterrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverserviceregisterrequest.go index 36499022..e9638606 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverserviceregisterrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverserviceregisterrequest.go @@ -54,6 +54,12 @@ func (e *MCPServerServiceRegisterRequestServerType) IsExact() bool { // MCPServerServiceRegisterRequest creates a new MCP server (Connector + config). type MCPServerServiceRegisterRequest struct { + // Optional access profiles (request catalogs) the server should be requestable + // through. Register creates the server's "All approved tools" toolset empty and adds + // its entitlement to each profile, so members can request the server before discovery + // has found a single tool; the sync later adopts the same toolset and fills it. Empty + // skips both steps. + AccessProfileIds []string `json:"accessProfileIds,omitempty"` // finding_ids from the diagnostic the admin acknowledged. Each must cover a // blocking-relaxable finding on oauth_diagnostic_id. AcknowledgedFindingIds []string `json:"acknowledgedFindingIds,omitempty"` @@ -106,6 +112,13 @@ type MCPServerServiceRegisterRequest struct { UserIds []string `json:"userIds,omitempty"` } +func (m *MCPServerServiceRegisterRequest) GetAccessProfileIds() []string { + if m == nil { + return nil + } + return m.AccessProfileIds +} + func (m *MCPServerServiceRegisterRequest) GetAcknowledgedFindingIds() []string { if m == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverserviceregisterresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverserviceregisterresponse.go index 2489324a..78a70a17 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverserviceregisterresponse.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverserviceregisterresponse.go @@ -4,7 +4,19 @@ package shared // MCPServerServiceRegisterResponse returns the newly created MCP server. type MCPServerServiceRegisterResponse struct { - McpServer *MCPServerView `json:"mcpServer,omitempty"` + // Whether the "All approved tools" toolset reached every profile in + // access_profile_ids. False means the server registered but the attach failed + // afterwards, and the profiles have to be wired from the server page. Always true + // when access_profile_ids was empty, since there was nothing to attach. + AccessProfilesAttached *bool `json:"accessProfilesAttached,omitempty"` + McpServer *MCPServerView `json:"mcpServer,omitempty"` +} + +func (m *MCPServerServiceRegisterResponse) GetAccessProfilesAttached() *bool { + if m == nil { + return nil + } + return m.AccessProfilesAttached } func (m *MCPServerServiceRegisterResponse) GetMcpServer() *MCPServerView { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverview.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverview.go index 929bbb82..671ebc8f 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverview.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcpserverview.go @@ -271,8 +271,12 @@ type MCPServerView struct { // Admin-provided display name. DisplayName *string `json:"displayName,omitempty"` // Endpoint URL for external MCP servers. Read-only. - EndpointURL *string `json:"endpointUrl,omitempty"` - LastCalledAt *time.Time `json:"lastCalledAt,omitempty"` + EndpointURL *string `json:"endpointUrl,omitempty"` + // Whether the endpoint URL is immutable. True once the connector has + // completed its first successful sync; the URL cannot be changed after + // that point. Read-only. + EndpointURLLocked *bool `json:"endpointUrlLocked,omitempty"` + LastCalledAt *time.Time `json:"lastCalledAt,omitempty"` // Opaque catalog entry ID for hosted MCP servers (27-character KSUID). // Obtain valid IDs from the ListCatalog or GetCatalog RPCs. McpServerCatalogID *string `json:"mcpServerCatalogId,omitempty"` @@ -517,6 +521,13 @@ func (m *MCPServerView) GetEndpointURL() *string { return m.EndpointURL } +func (m *MCPServerView) GetEndpointURLLocked() *bool { + if m == nil { + return nil + } + return m.EndpointURLLocked +} + func (m *MCPServerView) GetLastCalledAt() *time.Time { if m == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcptool.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcptool.go index a71f9c7c..0edb3323 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcptool.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcptool.go @@ -194,6 +194,14 @@ type MCPTool struct { // JSON-encoded input schema from MCP discovery. InputSchemaJSON *string `json:"inputSchemaJson,omitempty"` LastCalledAt *time.Time `json:"lastCalledAt,omitempty"` + // Whether this tool's backing entitlement is exposed in at least one request + // catalog directly (i.e. can be requested on its own). Computed read-only; + // populated on Search. + Requestable *bool `json:"requestable,omitempty"` + // Whether this tool is requestable indirectly — it belongs to at least one + // toolset (access profile) whose backing entitlement is exposed in a request + // catalog. Independent of `requestable`. Computed read-only; populated on Search. + RequestableViaToolset *bool `json:"requestableViaToolset,omitempty"` // Tool approval/lifecycle state. State *MCPToolState `json:"state,omitempty"` // Native MCP tool name (unique within an MCP server). @@ -326,6 +334,20 @@ func (m *MCPTool) GetLastCalledAt() *time.Time { return m.LastCalledAt } +func (m *MCPTool) GetRequestable() *bool { + if m == nil { + return nil + } + return m.Requestable +} + +func (m *MCPTool) GetRequestableViaToolset() *bool { + if m == nil { + return nil + } + return m.RequestableViaToolset +} + func (m *MCPTool) GetState() *MCPToolState { if m == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcptoolservicesearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcptoolservicesearchrequest.go index b7ab8395..42c4409b 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcptoolservicesearchrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mcptoolservicesearchrequest.go @@ -55,21 +55,21 @@ func (e *MCPToolServiceSearchRequestSortBy) IsExact() bool { return false } -// SortDirection - Direction for sort_by. UNSPECIFIED means ascending. -type SortDirection string +// MCPToolServiceSearchRequestSortDirection - Direction for sort_by. UNSPECIFIED means ascending. +type MCPToolServiceSearchRequestSortDirection string const ( - SortDirectionSortDirectionUnspecified SortDirection = "SORT_DIRECTION_UNSPECIFIED" - SortDirectionSortDirectionAsc SortDirection = "SORT_DIRECTION_ASC" - SortDirectionSortDirectionDesc SortDirection = "SORT_DIRECTION_DESC" + MCPToolServiceSearchRequestSortDirectionSortDirectionUnspecified MCPToolServiceSearchRequestSortDirection = "SORT_DIRECTION_UNSPECIFIED" + MCPToolServiceSearchRequestSortDirectionSortDirectionAsc MCPToolServiceSearchRequestSortDirection = "SORT_DIRECTION_ASC" + MCPToolServiceSearchRequestSortDirectionSortDirectionDesc MCPToolServiceSearchRequestSortDirection = "SORT_DIRECTION_DESC" ) -func (e SortDirection) ToPointer() *SortDirection { +func (e MCPToolServiceSearchRequestSortDirection) ToPointer() *MCPToolServiceSearchRequestSortDirection { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *SortDirection) IsExact() bool { +func (e *MCPToolServiceSearchRequestSortDirection) IsExact() bool { if e != nil { switch *e { case "SORT_DIRECTION_UNSPECIFIED", "SORT_DIRECTION_ASC", "SORT_DIRECTION_DESC": @@ -79,22 +79,22 @@ func (e *SortDirection) IsExact() bool { return false } -type StateFilter string +type MCPToolServiceSearchRequestStateFilter string const ( - StateFilterMcpToolStateUnspecified StateFilter = "MCP_TOOL_STATE_UNSPECIFIED" - StateFilterMcpToolStatePendingReview StateFilter = "MCP_TOOL_STATE_PENDING_REVIEW" - StateFilterMcpToolStateApproved StateFilter = "MCP_TOOL_STATE_APPROVED" - StateFilterMcpToolStateDisabled StateFilter = "MCP_TOOL_STATE_DISABLED" - StateFilterMcpToolStateRemoved StateFilter = "MCP_TOOL_STATE_REMOVED" + MCPToolServiceSearchRequestStateFilterMcpToolStateUnspecified MCPToolServiceSearchRequestStateFilter = "MCP_TOOL_STATE_UNSPECIFIED" + MCPToolServiceSearchRequestStateFilterMcpToolStatePendingReview MCPToolServiceSearchRequestStateFilter = "MCP_TOOL_STATE_PENDING_REVIEW" + MCPToolServiceSearchRequestStateFilterMcpToolStateApproved MCPToolServiceSearchRequestStateFilter = "MCP_TOOL_STATE_APPROVED" + MCPToolServiceSearchRequestStateFilterMcpToolStateDisabled MCPToolServiceSearchRequestStateFilter = "MCP_TOOL_STATE_DISABLED" + MCPToolServiceSearchRequestStateFilterMcpToolStateRemoved MCPToolServiceSearchRequestStateFilter = "MCP_TOOL_STATE_REMOVED" ) -func (e StateFilter) ToPointer() *StateFilter { +func (e MCPToolServiceSearchRequestStateFilter) ToPointer() *MCPToolServiceSearchRequestStateFilter { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *StateFilter) IsExact() bool { +func (e *MCPToolServiceSearchRequestStateFilter) IsExact() bool { if e != nil { switch *e { case "MCP_TOOL_STATE_UNSPECIFIED", "MCP_TOOL_STATE_PENDING_REVIEW", "MCP_TOOL_STATE_APPROVED", "MCP_TOOL_STATE_DISABLED", "MCP_TOOL_STATE_REMOVED": @@ -150,6 +150,11 @@ type MCPToolServiceSearchRequest struct { // raw emit time per tool. Costs one Dynamo Limit(1) read per row; // callers that don't render the "Last used" column should leave false. IncludeLastCalledAt *bool `json:"includeLastCalledAt,omitempty"` + // When true, populate the computed `requestable` / `requestable_via_toolset` + // fields on each tool (an extra catalog-membership lookup). Off by default so + // callers that don't render requestability — e.g. tool-picker and + // tools-by-toolset views — don't pay for it. + IncludeRequestable *bool `json:"includeRequestable,omitempty"` // Page size (max 100). PageSize *int `json:"pageSize,omitempty"` // Page token for pagination. @@ -161,9 +166,9 @@ type MCPToolServiceSearchRequest struct { // Sort order for results. UNSPECIFIED sorts by tool name ascending. SortBy *MCPToolServiceSearchRequestSortBy `json:"sortBy,omitempty"` // Direction for sort_by. UNSPECIFIED means ascending. - SortDirection *SortDirection `json:"sortDirection,omitempty"` + SortDirection *MCPToolServiceSearchRequestSortDirection `json:"sortDirection,omitempty"` // Optional filter by tool state. 0 (UNSPECIFIED) means no filter. - StateFilter []StateFilter `json:"stateFilter,omitempty"` + StateFilter []MCPToolServiceSearchRequestStateFilter `json:"stateFilter,omitempty"` // Optional filter by visibility. 0 (UNSPECIFIED) means no filter. VisibilityFilter []VisibilityFilter `json:"visibilityFilter,omitempty"` } @@ -210,6 +215,13 @@ func (m *MCPToolServiceSearchRequest) GetIncludeLastCalledAt() *bool { return m.IncludeLastCalledAt } +func (m *MCPToolServiceSearchRequest) GetIncludeRequestable() *bool { + if m == nil { + return nil + } + return m.IncludeRequestable +} + func (m *MCPToolServiceSearchRequest) GetPageSize() *int { if m == nil { return nil @@ -245,14 +257,14 @@ func (m *MCPToolServiceSearchRequest) GetSortBy() *MCPToolServiceSearchRequestSo return m.SortBy } -func (m *MCPToolServiceSearchRequest) GetSortDirection() *SortDirection { +func (m *MCPToolServiceSearchRequest) GetSortDirection() *MCPToolServiceSearchRequestSortDirection { if m == nil { return nil } return m.SortDirection } -func (m *MCPToolServiceSearchRequest) GetStateFilter() []StateFilter { +func (m *MCPToolServiceSearchRequest) GetStateFilter() []MCPToolServiceSearchRequestStateFilter { if m == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mintgatewaykeyrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mintgatewaykeyrequest.go new file mode 100644 index 00000000..5edc509c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mintgatewaykeyrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MintGatewayKeyRequest message. +type MintGatewayKeyRequest struct { + // The displayName field. + DisplayName *string `json:"displayName,omitempty"` +} + +func (m *MintGatewayKeyRequest) GetDisplayName() *string { + if m == nil { + return nil + } + return m.DisplayName +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mintgatewaykeyresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mintgatewaykeyresponse.go new file mode 100644 index 00000000..514af8dc --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/mintgatewaykeyresponse.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MintGatewayKeyResponse message. +type MintGatewayKeyResponse struct { + GatewayKey *GatewayKey `json:"gatewayKey,omitempty"` + // The plaintextKey field. + PlaintextKey *string `json:"plaintextKey,omitempty"` +} + +func (m *MintGatewayKeyResponse) GetGatewayKey() *GatewayKey { + if m == nil { + return nil + } + return m.GatewayKey +} + +func (m *MintGatewayKeyResponse) GetPlaintextKey() *string { + if m == nil { + return nil + } + return m.PlaintextKey +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/money.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/money.go new file mode 100644 index 00000000..abc322b4 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/money.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" +) + +// Money is wire-compatible with google.type.Money field-for-field, so the public +// +// API converts with a field copy. Declared here rather than imported because +// protoc-gen-pgdb mirrors a nested message by calling its generated DBReflect, +// which only exists for messages this repo generates. +type Money struct { + // ISO 4217 currency code. Must equal the tenant's FundPolicy.currency_code. + CurrencyCode *string `json:"currencyCode,omitempty"` + // Nano-unit remainder, 0 <= nanos < 10^9. Non-negative for the same reason + // as units, which also keeps the (units, nanos) pair unambiguous. + Nanos *int `json:"nanos,omitempty"` + // Non-negative — grants, never debts — and bounded so units * 10^9 + nanos + // always fits int64. Without the ceiling a large value wraps positive and + // installs a limit nobody granted. The pair check spans two fields, so + // pkg/funds re-checks it on every conversion. + Units *int64 `integer:"string" json:"units,omitempty"` +} + +func (m Money) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *Money) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *Money) GetCurrencyCode() *string { + if m == nil { + return nil + } + return m.CurrencyCode +} + +func (m *Money) GetNanos() *int { + if m == nil { + return nil + } + return m.Nanos +} + +func (m *Money) GetUnits() *int64 { + if m == nil { + return nil + } + return m.Units +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/msteamschannel.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/msteamschannel.go new file mode 100644 index 00000000..721b1025 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/msteamschannel.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MSTeamsChannel message. +type MSTeamsChannel struct { + // The channelName field. + ChannelName *string `json:"channelName,omitempty"` + // The externalDirectoryId field. + ExternalDirectoryID *string `json:"externalDirectoryId,omitempty"` +} + +func (m *MSTeamsChannel) GetChannelName() *string { + if m == nil { + return nil + } + return m.ChannelName +} + +func (m *MSTeamsChannel) GetExternalDirectoryID() *string { + if m == nil { + return nil + } + return m.ExternalDirectoryID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/msteamschannelsettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/msteamschannelsettings.go index 24697a5b..640f874b 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/msteamschannelsettings.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/msteamschannelsettings.go @@ -16,7 +16,9 @@ type MSTeamsChannelSettings struct { // The isConfigured field. IsConfigured *bool `json:"isConfigured,omitempty"` ProvisioningRequest *ProvisioningRequestPreference `json:"provisioningRequest,omitempty"` + RequestCreated *RequestCreatedPreference `json:"requestCreated,omitempty"` Reviews *ReviewsPreference `json:"reviews,omitempty"` + System *SystemPreference `json:"system,omitempty"` TaskReminders *TaskRemindersPreference `json:"taskReminders,omitempty"` } @@ -90,6 +92,13 @@ func (m *MSTeamsChannelSettings) GetProvisioningRequest() *ProvisioningRequestPr return m.ProvisioningRequest } +func (m *MSTeamsChannelSettings) GetRequestCreated() *RequestCreatedPreference { + if m == nil { + return nil + } + return m.RequestCreated +} + func (m *MSTeamsChannelSettings) GetReviews() *ReviewsPreference { if m == nil { return nil @@ -97,6 +106,13 @@ func (m *MSTeamsChannelSettings) GetReviews() *ReviewsPreference { return m.Reviews } +func (m *MSTeamsChannelSettings) GetSystem() *SystemPreference { + if m == nil { + return nil + } + return m.System +} + func (m *MSTeamsChannelSettings) GetTaskReminders() *TaskRemindersPreference { if m == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimit.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimit.go new file mode 100644 index 00000000..0be19246 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimit.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// MyFundLimit is one of the caller's own per-app limits. It carries no user id: +// +// it is always the caller's. +type MyFundLimit struct { + // The C1 App this limit applies to. + AppID *string `json:"appId,omitempty"` + Controls *SpendControls `json:"controls,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (m MyFundLimit) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MyFundLimit) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MyFundLimit) GetAppID() *string { + if m == nil { + return nil + } + return m.AppID +} + +func (m *MyFundLimit) GetControls() *SpendControls { + if m == nil { + return nil + } + return m.Controls +} + +func (m *MyFundLimit) GetCreatedAt() *time.Time { + if m == nil { + return nil + } + return m.CreatedAt +} + +func (m *MyFundLimit) GetDeletedAt() *time.Time { + if m == nil { + return nil + } + return m.DeletedAt +} + +func (m *MyFundLimit) GetUpdatedAt() *time.Time { + if m == nil { + return nil + } + return m.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimithistoryentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimithistoryentry.go new file mode 100644 index 00000000..8e29b763 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimithistoryentry.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitHistoryEntry message. +type MyFundLimitHistoryEntry struct { + Metadata *HistoryEntryMetadata `json:"metadata,omitempty"` + Snapshot *MyFundLimit `json:"snapshot,omitempty"` +} + +func (m *MyFundLimitHistoryEntry) GetMetadata() *HistoryEntryMetadata { + if m == nil { + return nil + } + return m.Metadata +} + +func (m *MyFundLimitHistoryEntry) GetSnapshot() *MyFundLimit { + if m == nil { + return nil + } + return m.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicedeleterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicedeleterequest.go new file mode 100644 index 00000000..2028c489 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicedeleterequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitsServiceDeleteRequest message. +type MyFundLimitsServiceDeleteRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicedeleteresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicedeleteresponse.go new file mode 100644 index 00000000..33cc810a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicedeleteresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitsServiceDeleteResponse message. +type MyFundLimitsServiceDeleteResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicelisthistoryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicelisthistoryresponse.go new file mode 100644 index 00000000..aa157831 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicelisthistoryresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitsServiceListHistoryResponse message. +type MyFundLimitsServiceListHistoryResponse struct { + // The list field. + List []MyFundLimitHistoryEntry `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (m *MyFundLimitsServiceListHistoryResponse) GetList() []MyFundLimitHistoryEntry { + if m == nil { + return nil + } + return m.List +} + +func (m *MyFundLimitsServiceListHistoryResponse) GetNextPageToken() *string { + if m == nil { + return nil + } + return m.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicelistresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicelistresponse.go new file mode 100644 index 00000000..1516a0a5 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicelistresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitsServiceListResponse message. +type MyFundLimitsServiceListResponse struct { + // The list field. + List []MyFundLimit `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (m *MyFundLimitsServiceListResponse) GetList() []MyFundLimit { + if m == nil { + return nil + } + return m.List +} + +func (m *MyFundLimitsServiceListResponse) GetNextPageToken() *string { + if m == nil { + return nil + } + return m.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicepauserequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicepauserequest.go new file mode 100644 index 00000000..27d7555e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicepauserequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitsServicePauseRequest message. +type MyFundLimitsServicePauseRequest struct { + // The reason field. + Reason *string `json:"reason,omitempty"` +} + +func (m *MyFundLimitsServicePauseRequest) GetReason() *string { + if m == nil { + return nil + } + return m.Reason +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicepauseresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicepauseresponse.go new file mode 100644 index 00000000..1c768782 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicepauseresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitsServicePauseResponse message. +type MyFundLimitsServicePauseResponse struct { + Limit *MyFundLimit `json:"limit,omitempty"` +} + +func (m *MyFundLimitsServicePauseResponse) GetLimit() *MyFundLimit { + if m == nil { + return nil + } + return m.Limit +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsserviceresumerequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsserviceresumerequest.go new file mode 100644 index 00000000..45cd1870 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsserviceresumerequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitsServiceResumeRequest message. +type MyFundLimitsServiceResumeRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsserviceresumeresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsserviceresumeresponse.go new file mode 100644 index 00000000..2578998a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsserviceresumeresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitsServiceResumeResponse message. +type MyFundLimitsServiceResumeResponse struct { + Limit *MyFundLimit `json:"limit,omitempty"` +} + +func (m *MyFundLimitsServiceResumeResponse) GetLimit() *MyFundLimit { + if m == nil { + return nil + } + return m.Limit +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicesetlimitrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicesetlimitrequest.go new file mode 100644 index 00000000..9b05001a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicesetlimitrequest.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// MyFundLimitsServiceSetLimitRequestPeriod - Optional period override. Only valid together with the limit it denominates. +type MyFundLimitsServiceSetLimitRequestPeriod string + +const ( + MyFundLimitsServiceSetLimitRequestPeriodPeriodKindUnspecified MyFundLimitsServiceSetLimitRequestPeriod = "PERIOD_KIND_UNSPECIFIED" + MyFundLimitsServiceSetLimitRequestPeriodPeriodKindDaily MyFundLimitsServiceSetLimitRequestPeriod = "PERIOD_KIND_DAILY" + MyFundLimitsServiceSetLimitRequestPeriodPeriodKindWeekly MyFundLimitsServiceSetLimitRequestPeriod = "PERIOD_KIND_WEEKLY" + MyFundLimitsServiceSetLimitRequestPeriodPeriodKindMonthly MyFundLimitsServiceSetLimitRequestPeriod = "PERIOD_KIND_MONTHLY" + MyFundLimitsServiceSetLimitRequestPeriodPeriodKindQuarterly MyFundLimitsServiceSetLimitRequestPeriod = "PERIOD_KIND_QUARTERLY" + MyFundLimitsServiceSetLimitRequestPeriodPeriodKindYearly MyFundLimitsServiceSetLimitRequestPeriod = "PERIOD_KIND_YEARLY" +) + +func (e MyFundLimitsServiceSetLimitRequestPeriod) ToPointer() *MyFundLimitsServiceSetLimitRequestPeriod { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *MyFundLimitsServiceSetLimitRequestPeriod) IsExact() bool { + if e != nil { + switch *e { + case "PERIOD_KIND_UNSPECIFIED", "PERIOD_KIND_DAILY", "PERIOD_KIND_WEEKLY", "PERIOD_KIND_MONTHLY", "PERIOD_KIND_QUARTERLY", "PERIOD_KIND_YEARLY": + return true + } + } + return false +} + +// The MyFundLimitsServiceSetLimitRequest message. +type MyFundLimitsServiceSetLimitRequest struct { + Limit *SpendLimit `json:"limit,omitempty"` + // Optional period override. Only valid together with the limit it denominates. + Period *MyFundLimitsServiceSetLimitRequestPeriod `json:"period,omitempty"` +} + +func (m *MyFundLimitsServiceSetLimitRequest) GetLimit() *SpendLimit { + if m == nil { + return nil + } + return m.Limit +} + +func (m *MyFundLimitsServiceSetLimitRequest) GetPeriod() *MyFundLimitsServiceSetLimitRequestPeriod { + if m == nil { + return nil + } + return m.Period +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicesetlimitresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicesetlimitresponse.go new file mode 100644 index 00000000..5e6e0a30 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/myfundlimitsservicesetlimitresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The MyFundLimitsServiceSetLimitResponse message. +type MyFundLimitsServiceSetLimitResponse struct { + Limit *MyFundLimit `json:"limit,omitempty"` +} + +func (m *MyFundLimitsServiceSetLimitResponse) GetLimit() *MyFundLimit { + if m == nil { + return nil + } + return m.Limit +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/notifydispatcher.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/notifydispatcher.go new file mode 100644 index 00000000..bb7e9cd2 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/notifydispatcher.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// DetailLevel - How much the notification reveals. Defaults to SUMMARY. +type DetailLevel string + +const ( + DetailLevelFindingNotifyDetailLevelUnspecified DetailLevel = "FINDING_NOTIFY_DETAIL_LEVEL_UNSPECIFIED" + DetailLevelFindingNotifyDetailLevelSummary DetailLevel = "FINDING_NOTIFY_DETAIL_LEVEL_SUMMARY" + DetailLevelFindingNotifyDetailLevelFullDetail DetailLevel = "FINDING_NOTIFY_DETAIL_LEVEL_FULL_DETAIL" +) + +func (e DetailLevel) ToPointer() *DetailLevel { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DetailLevel) IsExact() bool { + if e != nil { + switch *e { + case "FINDING_NOTIFY_DETAIL_LEVEL_UNSPECIFIED", "FINDING_NOTIFY_DETAIL_LEVEL_SUMMARY", "FINDING_NOTIFY_DETAIL_LEVEL_FULL_DETAIL": + return true + } + } + return false +} + +// NotifyDispatcher emits a notifications_v2 notification about the matched +// +// finding. Exactly one of audience / slack_channel is set: audience notifies +// people (each on whichever channels they enabled in their own notification +// settings), slack_channel posts to one channel. +type NotifyDispatcher struct { + Audience *FindingAudience `json:"audience,omitempty"` + // Wait-group window in seconds; 0 sends immediately. A quiet-period length, + // not a fixed delay — the batcher slides it forward on each arrival. + BatchWindowSeconds *int64 `json:"batchWindowSeconds,omitempty"` + // How much the notification reveals. Defaults to SUMMARY. + DetailLevel *DetailLevel `json:"detailLevel,omitempty"` + SlackChannel *SlackChannelTarget `json:"slackChannel,omitempty"` +} + +func (n *NotifyDispatcher) GetAudience() *FindingAudience { + if n == nil { + return nil + } + return n.Audience +} + +func (n *NotifyDispatcher) GetBatchWindowSeconds() *int64 { + if n == nil { + return nil + } + return n.BatchWindowSeconds +} + +func (n *NotifyDispatcher) GetDetailLevel() *DetailLevel { + if n == nil { + return nil + } + return n.DetailLevel +} + +func (n *NotifyDispatcher) GetSlackChannel() *SlackChannelTarget { + if n == nil { + return nil + } + return n.SlackChannel +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/oidcclaimmapping.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/oidcclaimmapping.go new file mode 100644 index 00000000..0f00c95b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/oidcclaimmapping.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// Destination - Where the claim is released. +type Destination string + +const ( + DestinationOidcClaimDestinationUnspecified Destination = "OIDC_CLAIM_DESTINATION_UNSPECIFIED" + DestinationOidcClaimDestinationIDTokenOnly Destination = "OIDC_CLAIM_DESTINATION_ID_TOKEN_ONLY" + DestinationOidcClaimDestinationUserinfoOnly Destination = "OIDC_CLAIM_DESTINATION_USERINFO_ONLY" +) + +func (e Destination) ToPointer() *Destination { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Destination) IsExact() bool { + if e != nil { + switch *e { + case "OIDC_CLAIM_DESTINATION_UNSPECIFIED", "OIDC_CLAIM_DESTINATION_ID_TOKEN_ONLY", "OIDC_CLAIM_DESTINATION_USERINFO_ONLY": + return true + } + } + return false +} + +// OIDCClaimMapping releases one user attribute to the application as one +// +// OIDC claim. +type OIDCClaimMapping struct { + // The name of the claim as the application sees it. Namespace custom claims + // so they cannot collide with the registered OIDC claim set. + ClaimName string `json:"claimName"` + // Where the claim is released. + Destination *Destination `json:"destination,omitempty"` + // The user attribute mapping that resolves the value, including its fallback + // chain. + UserAttributeMappingID string `json:"userAttributeMappingId"` +} + +func (o *OIDCClaimMapping) GetClaimName() string { + if o == nil { + return "" + } + return o.ClaimName +} + +func (o *OIDCClaimMapping) GetDestination() *Destination { + if o == nil { + return nil + } + return o.Destination +} + +func (o *OIDCClaimMapping) GetUserAttributeMappingID() string { + if o == nil { + return "" + } + return o.UserAttributeMappingID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/papersecretservicesearchsecretssharedwithmerequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/papersecretservicesearchsecretssharedwithmerequest.go new file mode 100644 index 00000000..f8d574e0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/papersecretservicesearchsecretssharedwithmerequest.go @@ -0,0 +1,114 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType - Filter by secret type (optional) +type PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType string + +const ( + PaperSecretServiceSearchSecretsSharedWithMeRequestSecretTypeSecretTypeUnspecified PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType = "SECRET_TYPE_UNSPECIFIED" + PaperSecretServiceSearchSecretsSharedWithMeRequestSecretTypeSecretTypeText PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType = "SECRET_TYPE_TEXT" + PaperSecretServiceSearchSecretsSharedWithMeRequestSecretTypeSecretTypeFile PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType = "SECRET_TYPE_FILE" +) + +func (e PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType) ToPointer() *PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType) IsExact() bool { + if e != nil { + switch *e { + case "SECRET_TYPE_UNSPECIFIED", "SECRET_TYPE_TEXT", "SECRET_TYPE_FILE": + return true + } + } + return false +} + +type PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses string + +const ( + PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusUnspecified PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses = "SECRET_STATUS_UNSPECIFIED" + PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusActive PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses = "SECRET_STATUS_ACTIVE" + PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusExpired PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses = "SECRET_STATUS_EXPIRED" + PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusBurned PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses = "SECRET_STATUS_BURNED" + PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusRevoked PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses = "SECRET_STATUS_REVOKED" + PaperSecretServiceSearchSecretsSharedWithMeRequestStatusesSecretStatusDataDeleted PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses = "SECRET_STATUS_DATA_DELETED" +) + +func (e PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses) ToPointer() *PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses) IsExact() bool { + if e != nil { + switch *e { + case "SECRET_STATUS_UNSPECIFIED", "SECRET_STATUS_ACTIVE", "SECRET_STATUS_EXPIRED", "SECRET_STATUS_BURNED", "SECRET_STATUS_REVOKED", "SECRET_STATUS_DATA_DELETED": + return true + } + } + return false +} + +// PaperSecretServiceSearchSecretsSharedWithMeRequest - SearchSecretsSharedWithMe request - for end users viewing secrets others +// +// shared with them. Automatically scoped to current user. +type PaperSecretServiceSearchSecretsSharedWithMeRequest struct { + // Include secrets the caller created and also shared with themselves. Off by + // default so this list stays disjoint from SearchMySecrets. + IncludeOwn *bool `json:"includeOwn,omitempty"` + // The pageSize field. + PageSize *int `json:"pageSize,omitempty"` + // The pageToken field. + PageToken *string `json:"pageToken,omitempty"` + // Fuzzy search by display name + Query *string `json:"query,omitempty"` + // Filter by secret type (optional) + SecretType *PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType `json:"secretType,omitempty"` + // Filter by status (optional) + Statuses []PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses `json:"statuses,omitempty"` +} + +func (p *PaperSecretServiceSearchSecretsSharedWithMeRequest) GetIncludeOwn() *bool { + if p == nil { + return nil + } + return p.IncludeOwn +} + +func (p *PaperSecretServiceSearchSecretsSharedWithMeRequest) GetPageSize() *int { + if p == nil { + return nil + } + return p.PageSize +} + +func (p *PaperSecretServiceSearchSecretsSharedWithMeRequest) GetPageToken() *string { + if p == nil { + return nil + } + return p.PageToken +} + +func (p *PaperSecretServiceSearchSecretsSharedWithMeRequest) GetQuery() *string { + if p == nil { + return nil + } + return p.Query +} + +func (p *PaperSecretServiceSearchSecretsSharedWithMeRequest) GetSecretType() *PaperSecretServiceSearchSecretsSharedWithMeRequestSecretType { + if p == nil { + return nil + } + return p.SecretType +} + +func (p *PaperSecretServiceSearchSecretsSharedWithMeRequest) GetStatuses() []PaperSecretServiceSearchSecretsSharedWithMeRequestStatuses { + if p == nil { + return nil + } + return p.Statuses +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/payloadfindingdispatch.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/payloadfindingdispatch.go new file mode 100644 index 00000000..81fef839 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/payloadfindingdispatch.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The PayloadFindingDispatch message. +type PayloadFindingDispatch struct { + // The FindingDispatch row recording this execution. + DispatchID *string `json:"dispatchId,omitempty"` + Finding *Finding `json:"finding,omitempty"` + // The finding that matched the routing rule. + FindingID *string `json:"findingId,omitempty"` + // The dispatcher's rendered payload template. Empty when the dispatcher used + // the default finding payload. + PayloadTemplate *string `json:"payloadTemplate,omitempty"` + // The routing rule whose match caused this dispatch. + RuleID *string `json:"ruleId,omitempty"` +} + +func (p *PayloadFindingDispatch) GetDispatchID() *string { + if p == nil { + return nil + } + return p.DispatchID +} + +func (p *PayloadFindingDispatch) GetFinding() *Finding { + if p == nil { + return nil + } + return p.Finding +} + +func (p *PayloadFindingDispatch) GetFindingID() *string { + if p == nil { + return nil + } + return p.FindingID +} + +func (p *PayloadFindingDispatch) GetPayloadTemplate() *string { + if p == nil { + return nil + } + return p.PayloadTemplate +} + +func (p *PayloadFindingDispatch) GetRuleID() *string { + if p == nil { + return nil + } + return p.RuleID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policy.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policy.go index 7a65fa4a..3a233f17 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policy.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policy.go @@ -51,8 +51,16 @@ type Policy struct { // Well-known keys: `managed_by`, `iac_workspace`, // `iac_resource_address`, `iac_tool_version`. Annotations map[string]string `json:"annotations,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - DeletedAt *time.Time `json:"deletedAt,omitempty"` + // When set, the baseline defers to another policy of the same type when no + // rule matches, instead of the baseline entry in policy_steps (keyed by the + // lowercased policy_type). Mutually exclusive with that baseline entry: set + // one or the other, not both. The referenced policy must share this + // policy's policy_type, must not introduce a cycle or self-reference, and + // must not push any reachable chain over depth 5. Gated by the + // POLICY_REFERENCES_POLICY feature flag. + BaselinePolicyID *string `json:"baselinePolicyId,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` // The description of the Policy. Description *string `json:"description,omitempty"` // The display name of the Policy. @@ -77,7 +85,8 @@ type Policy struct { // Ordered conditional routing rules. Evaluated top-to-bottom; the first // matching rule selects a step sequence from policy_steps. If no rule matches // (or if this array is empty), the baseline entry in policy_steps is used. - Rules []Rule `json:"rules,omitempty"` + Rules []Rule `json:"rules,omitempty"` + Scope *PolicyScope `json:"scope,omitempty"` // Whether this policy is a builtin system policy. Builtin system policies cannot be edited. SystemBuiltin *bool `json:"systemBuiltin,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` @@ -101,6 +110,13 @@ func (p *Policy) GetAnnotations() map[string]string { return p.Annotations } +func (p *Policy) GetBaselinePolicyID() *string { + if p == nil { + return nil + } + return p.BaselinePolicyID +} + func (p *Policy) GetCreatedAt() *time.Time { if p == nil { return nil @@ -171,6 +187,13 @@ func (p *Policy) GetRules() []Rule { return p.Rules } +func (p *Policy) GetScope() *PolicyScope { + if p == nil { + return nil + } + return p.Scope +} + func (p *Policy) GetSystemBuiltin() *bool { if p == nil { return nil @@ -200,6 +223,14 @@ type PolicyInput struct { // Well-known keys: `managed_by`, `iac_workspace`, // `iac_resource_address`, `iac_tool_version`. Annotations map[string]string `json:"annotations,omitempty"` + // When set, the baseline defers to another policy of the same type when no + // rule matches, instead of the baseline entry in policy_steps (keyed by the + // lowercased policy_type). Mutually exclusive with that baseline entry: set + // one or the other, not both. The referenced policy must share this + // policy's policy_type, must not introduce a cycle or self-reference, and + // must not push any reachable chain over depth 5. Gated by the + // POLICY_REFERENCES_POLICY feature flag. + BaselinePolicyID *string `json:"baselinePolicyId,omitempty"` // The description of the Policy. Description *string `json:"description,omitempty"` // The display name of the Policy. @@ -222,7 +253,8 @@ type PolicyInput struct { // Ordered conditional routing rules. Evaluated top-to-bottom; the first // matching rule selects a step sequence from policy_steps. If no rule matches // (or if this array is empty), the baseline entry in policy_steps is used. - Rules []Rule `json:"rules,omitempty"` + Rules []Rule `json:"rules,omitempty"` + Scope *PolicyScope `json:"scope,omitempty"` } func (p *PolicyInput) GetAnnotations() map[string]string { @@ -232,6 +264,13 @@ func (p *PolicyInput) GetAnnotations() map[string]string { return p.Annotations } +func (p *PolicyInput) GetBaselinePolicyID() *string { + if p == nil { + return nil + } + return p.BaselinePolicyID +} + func (p *PolicyInput) GetDescription() *string { if p == nil { return nil @@ -280,3 +319,10 @@ func (p *PolicyInput) GetRules() []Rule { } return p.Rules } + +func (p *PolicyInput) GetScope() *PolicyScope { + if p == nil { + return nil + } + return p.Scope +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policyscope.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policyscope.go new file mode 100644 index 00000000..629f2fef --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policyscope.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// Slot - Which of the object's local-policy slots this policy occupies. Part of the +// +// scope, and immutable with it. +type Slot string + +const ( + SlotPolicyScopeSlotUnspecified Slot = "POLICY_SCOPE_SLOT_UNSPECIFIED" + SlotPolicyScopeSlotEmergency Slot = "POLICY_SCOPE_SLOT_EMERGENCY" +) + +func (e Slot) ToPointer() *Slot { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Slot) IsExact() bool { + if e != nil { + switch *e { + case "POLICY_SCOPE_SLOT_UNSPECIFIED", "POLICY_SCOPE_SLOT_EMERGENCY": + return true + } + } + return false +} + +// PolicyScope - Scopes a policy to an app or to a single entitlement within an app. +type PolicyScope struct { + // Optional. When set, the policy is scoped to this entitlement of app_id + // rather than to the whole app. + AppEntitlementID *string `json:"appEntitlementId,omitempty"` + // The ID of the app this policy is scoped to. + AppID *string `json:"appId,omitempty"` + // Which of the object's local-policy slots this policy occupies. Part of the + // scope, and immutable with it. + Slot *Slot `json:"slot,omitempty"` +} + +func (p *PolicyScope) GetAppEntitlementID() *string { + if p == nil { + return nil + } + return p.AppEntitlementID +} + +func (p *PolicyScope) GetAppID() *string { + if p == nil { + return nil + } + return p.AppID +} + +func (p *PolicyScope) GetSlot() *Slot { + if p == nil { + return nil + } + return p.Slot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policyuser.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policyuser.go new file mode 100644 index 00000000..d740d2d8 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/policyuser.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// PolicyUserSource - Why the policy applies to this user. DIRECT or GROUP. +type PolicyUserSource string + +const ( + PolicyUserSourceEffectiveSessionPolicySourceUnspecified PolicyUserSource = "EFFECTIVE_SESSION_POLICY_SOURCE_UNSPECIFIED" + PolicyUserSourceEffectiveSessionPolicySourceDirect PolicyUserSource = "EFFECTIVE_SESSION_POLICY_SOURCE_DIRECT" + PolicyUserSourceEffectiveSessionPolicySourceGroup PolicyUserSource = "EFFECTIVE_SESSION_POLICY_SOURCE_GROUP" + PolicyUserSourceEffectiveSessionPolicySourceTenantDefault PolicyUserSource = "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT" + PolicyUserSourceEffectiveSessionPolicySourceTenantDefaultNone PolicyUserSource = "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT_NONE" +) + +func (e PolicyUserSource) ToPointer() *PolicyUserSource { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PolicyUserSource) IsExact() bool { + if e != nil { + switch *e { + case "EFFECTIVE_SESSION_POLICY_SOURCE_UNSPECIFIED", "EFFECTIVE_SESSION_POLICY_SOURCE_DIRECT", "EFFECTIVE_SESSION_POLICY_SOURCE_GROUP", "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT", "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT_NONE": + return true + } + } + return false +} + +// PolicyUser is one user a session policy applies to. +type PolicyUser struct { + Group *AppEntitlement `json:"group,omitempty"` + // Why the policy applies to this user. DIRECT or GROUP. + Source *PolicyUserSource `json:"source,omitempty"` + User *User `json:"user,omitempty"` +} + +func (p *PolicyUser) GetGroup() *AppEntitlement { + if p == nil { + return nil + } + return p.Group +} + +func (p *PolicyUser) GetSource() *PolicyUserSource { + if p == nil { + return nil + } + return p.Source +} + +func (p *PolicyUser) GetUser() *User { + if p == nil { + return nil + } + return p.User +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/pretoolblockconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/pretoolblockconfig.go new file mode 100644 index 00000000..cf874cf3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/pretoolblockconfig.go @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// PreToolBlockConfig unconditionally denies the tool call before it executes +// +// when its hook's filter matches. Only valid for HOOK_EVENT_TYPE_PRE_TOOL_USE. +type PreToolBlockConfig struct { + // Message shown when the tool call is denied. Empty falls back to a + // generic default. + Message *string `json:"message,omitempty"` +} + +func (p *PreToolBlockConfig) GetMessage() *string { + if p == nil { + return nil + } + return p.Message +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/programref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/programref.go new file mode 100644 index 00000000..ac279dd7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/programref.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// ProgramRef identifies a report's own copy of an executable program. +type ProgramRef struct { + // The commitId field. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + CommitID *string `json:"commitId,omitempty"` + // Deprecated tombstones. Source-owned reports never populate Function or + // commit identity; these declarations remain only because c1api forbids + // deleting published fields. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + FunctionID *string `json:"functionId,omitempty"` + // The prompt this program was planned from. Report.prompt is editable and a + // refresh never re-plans, so this is the only way to detect that a report's + // question has drifted from the program answering it. + PlannedFromPrompt *string `json:"plannedFromPrompt,omitempty"` + // Identifies this durable source version. Minted for each save. + ProgramID *string `json:"programId,omitempty"` +} + +func (p *ProgramRef) GetCommitID() *string { + if p == nil { + return nil + } + return p.CommitID +} + +func (p *ProgramRef) GetFunctionID() *string { + if p == nil { + return nil + } + return p.FunctionID +} + +func (p *ProgramRef) GetPlannedFromPrompt() *string { + if p == nil { + return nil + } + return p.PlannedFromPrompt +} + +func (p *ProgramRef) GetProgramID() *string { + if p == nil { + return nil + } + return p.ProgramID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/promoteappmanagedstatebindingrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/promoteappmanagedstatebindingrequest.go new file mode 100644 index 00000000..81122950 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/promoteappmanagedstatebindingrequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// PromoteAppManagedStateBindingRequest identifies an unmanaged application and configures its owners. +type PromoteAppManagedStateBindingRequest struct { + // Entitlements to assign as owners of the new application. + AppEntitlementOwnerRefs []AppEntitlementRef `json:"appEntitlementOwnerRefs,omitempty"` + ExpandMask *AppManagedStateBindingExpandMask `json:"expandMask,omitempty"` + // User IDs to assign as owners of the new application. + // If omitted, the application inherits the owners of the source connector application. + UserIds []string `json:"userIds,omitempty"` +} + +func (p *PromoteAppManagedStateBindingRequest) GetAppEntitlementOwnerRefs() []AppEntitlementRef { + if p == nil { + return nil + } + return p.AppEntitlementOwnerRefs +} + +func (p *PromoteAppManagedStateBindingRequest) GetExpandMask() *AppManagedStateBindingExpandMask { + if p == nil { + return nil + } + return p.ExpandMask +} + +func (p *PromoteAppManagedStateBindingRequest) GetUserIds() []string { + if p == nil { + return nil + } + return p.UserIds +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/promptinjectionscanconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/promptinjectionscanconfig.go new file mode 100644 index 00000000..eb61e89b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/promptinjectionscanconfig.go @@ -0,0 +1,55 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// Threshold - Deny (or flag) when the judge scores at or above this level. Unspecified = +// +// HIGH. +type Threshold string + +const ( + ThresholdPromptInjectionThresholdUnspecified Threshold = "PROMPT_INJECTION_THRESHOLD_UNSPECIFIED" + ThresholdPromptInjectionThresholdLow Threshold = "PROMPT_INJECTION_THRESHOLD_LOW" + ThresholdPromptInjectionThresholdMedium Threshold = "PROMPT_INJECTION_THRESHOLD_MEDIUM" + ThresholdPromptInjectionThresholdHigh Threshold = "PROMPT_INJECTION_THRESHOLD_HIGH" +) + +func (e Threshold) ToPointer() *Threshold { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Threshold) IsExact() bool { + if e != nil { + switch *e { + case "PROMPT_INJECTION_THRESHOLD_UNSPECIFIED", "PROMPT_INJECTION_THRESHOLD_LOW", "PROMPT_INJECTION_THRESHOLD_MEDIUM", "PROMPT_INJECTION_THRESHOLD_HIGH": + return true + } + } + return false +} + +// PromptInjectionScanConfig scans tool output for prompt-injection using the +// +// aigov A2 judge and acts when the verdict is at or above threshold. +type PromptInjectionScanConfig struct { + // When true, a detection records the finding but does not deny (observe-only). + FlagOnly *bool `json:"flagOnly,omitempty"` + // Deny (or flag) when the judge scores at or above this level. Unspecified = + // HIGH. + Threshold *Threshold `json:"threshold,omitempty"` +} + +func (p *PromptInjectionScanConfig) GetFlagOnly() *bool { + if p == nil { + return nil + } + return p.FlagOnly +} + +func (p *PromptInjectionScanConfig) GetThreshold() *Threshold { + if p == nil { + return nil + } + return p.Threshold +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/providercredential.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/providercredential.go new file mode 100644 index 00000000..0941f437 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/providercredential.go @@ -0,0 +1,116 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// HeaderStyle - The headerStyle field. +type HeaderStyle string + +const ( + HeaderStyleProviderCredentialHeaderStyleUnspecified HeaderStyle = "PROVIDER_CREDENTIAL_HEADER_STYLE_UNSPECIFIED" + HeaderStyleProviderCredentialHeaderStyleXAPIKey HeaderStyle = "PROVIDER_CREDENTIAL_HEADER_STYLE_X_API_KEY" + HeaderStyleProviderCredentialHeaderStyleAuthorizationBearer HeaderStyle = "PROVIDER_CREDENTIAL_HEADER_STYLE_AUTHORIZATION_BEARER" +) + +func (e HeaderStyle) ToPointer() *HeaderStyle { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *HeaderStyle) IsExact() bool { + if e != nil { + switch *e { + case "PROVIDER_CREDENTIAL_HEADER_STYLE_UNSPECIFIED", "PROVIDER_CREDENTIAL_HEADER_STYLE_X_API_KEY", "PROVIDER_CREDENTIAL_HEADER_STYLE_AUTHORIZATION_BEARER": + return true + } + } + return false +} + +// The ProviderCredential message. +type ProviderCredential struct { + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The displayName field. + DisplayName *string `json:"displayName,omitempty"` + // The headerStyle field. + HeaderStyle *HeaderStyle `json:"headerStyle,omitempty"` + // The keyPrefix field. + KeyPrefix *string `json:"keyPrefix,omitempty"` + RevokedAt *time.Time `json:"revokedAt,omitempty"` + // The slotId field. + SlotID *string `json:"slotId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // The userId field. + UserID *string `json:"userId,omitempty"` +} + +func (p ProviderCredential) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *ProviderCredential) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *ProviderCredential) GetCreatedAt() *time.Time { + if p == nil { + return nil + } + return p.CreatedAt +} + +func (p *ProviderCredential) GetDisplayName() *string { + if p == nil { + return nil + } + return p.DisplayName +} + +func (p *ProviderCredential) GetHeaderStyle() *HeaderStyle { + if p == nil { + return nil + } + return p.HeaderStyle +} + +func (p *ProviderCredential) GetKeyPrefix() *string { + if p == nil { + return nil + } + return p.KeyPrefix +} + +func (p *ProviderCredential) GetRevokedAt() *time.Time { + if p == nil { + return nil + } + return p.RevokedAt +} + +func (p *ProviderCredential) GetSlotID() *string { + if p == nil { + return nil + } + return p.SlotID +} + +func (p *ProviderCredential) GetUpdatedAt() *time.Time { + if p == nil { + return nil + } + return p.UpdatedAt +} + +func (p *ProviderCredential) GetUserID() *string { + if p == nil { + return nil + } + return p.UserID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisioninstance.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisioninstance.go index 7698220e..c346789f 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisioninstance.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisioninstance.go @@ -17,6 +17,7 @@ const ( ProvisionInstanceStateProvisionInstanceStateExternalTicketWaiting ProvisionInstanceState = "PROVISION_INSTANCE_STATE_EXTERNAL_TICKET_WAITING" ProvisionInstanceStateProvisionInstanceStateAccountLifecycleActions ProvisionInstanceState = "PROVISION_INSTANCE_STATE_ACCOUNT_LIFECYCLE_ACTIONS" ProvisionInstanceStateProvisionInstanceStateAccountLifecycleActionsWaiting ProvisionInstanceState = "PROVISION_INSTANCE_STATE_ACCOUNT_LIFECYCLE_ACTIONS_WAITING" + ProvisionInstanceStateProvisionInstanceStateDevicePlacement ProvisionInstanceState = "PROVISION_INSTANCE_STATE_DEVICE_PLACEMENT" ProvisionInstanceStateProvisionInstanceStateDone ProvisionInstanceState = "PROVISION_INSTANCE_STATE_DONE" ) @@ -28,7 +29,7 @@ func (e ProvisionInstanceState) ToPointer() *ProvisionInstanceState { func (e *ProvisionInstanceState) IsExact() bool { if e != nil { switch *e { - case "PROVISION_INSTANCE_STATE_UNSPECIFIED", "PROVISION_INSTANCE_STATE_INIT", "PROVISION_INSTANCE_STATE_CREATE_CONNECTOR_ACTIONS_FOR_TARGET", "PROVISION_INSTANCE_STATE_SENDING_NOTIFICATIONS", "PROVISION_INSTANCE_STATE_WAITING", "PROVISION_INSTANCE_STATE_WEBHOOK", "PROVISION_INSTANCE_STATE_WEBHOOK_WAITING", "PROVISION_INSTANCE_STATE_EXTERNAL_TICKET", "PROVISION_INSTANCE_STATE_EXTERNAL_TICKET_WAITING", "PROVISION_INSTANCE_STATE_ACCOUNT_LIFECYCLE_ACTIONS", "PROVISION_INSTANCE_STATE_ACCOUNT_LIFECYCLE_ACTIONS_WAITING", "PROVISION_INSTANCE_STATE_DONE": + case "PROVISION_INSTANCE_STATE_UNSPECIFIED", "PROVISION_INSTANCE_STATE_INIT", "PROVISION_INSTANCE_STATE_CREATE_CONNECTOR_ACTIONS_FOR_TARGET", "PROVISION_INSTANCE_STATE_SENDING_NOTIFICATIONS", "PROVISION_INSTANCE_STATE_WAITING", "PROVISION_INSTANCE_STATE_WEBHOOK", "PROVISION_INSTANCE_STATE_WEBHOOK_WAITING", "PROVISION_INSTANCE_STATE_EXTERNAL_TICKET", "PROVISION_INSTANCE_STATE_EXTERNAL_TICKET_WAITING", "PROVISION_INSTANCE_STATE_ACCOUNT_LIFECYCLE_ACTIONS", "PROVISION_INSTANCE_STATE_ACCOUNT_LIFECYCLE_ACTIONS_WAITING", "PROVISION_INSTANCE_STATE_DEVICE_PLACEMENT", "PROVISION_INSTANCE_STATE_DONE": return true } } @@ -59,7 +60,8 @@ type ProvisionInstance struct { ReassignedByError *ReassignedByErrorAction `json:"reassignedByError,omitempty"` Skipped *SkippedAction `json:"skipped,omitempty"` // This property indicates the current state of this step. - State *ProvisionInstanceState `json:"state,omitempty"` + State *ProvisionInstanceState `json:"state,omitempty"` + WaitingOn *ProvisionWaitingOn `json:"waitingOn,omitempty"` // This indicates the webhook id for this step. WebhookID *string `json:"webhookId,omitempty"` // This indicates the webhook instance id for this step. @@ -143,6 +145,13 @@ func (p *ProvisionInstance) GetState() *ProvisionInstanceState { return p.State } +func (p *ProvisionInstance) GetWaitingOn() *ProvisionWaitingOn { + if p == nil { + return nil + } + return p.WaitingOn +} + func (p *ProvisionInstance) GetWebhookID() *string { if p == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionpolicy.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionpolicy.go index 7d2d1e5f..1b1024fe 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionpolicy.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionpolicy.go @@ -13,15 +13,17 @@ package shared // - externalTicket // - unconfigured // - action +// - devicePlacement type ProvisionPolicy struct { - Action *ActionProvision `json:"action,omitempty"` - Connector *ConnectorProvision `json:"connector,omitempty"` - Delegated *DelegatedProvision `json:"delegated,omitempty"` - ExternalTicket *ExternalTicketProvision `json:"externalTicket,omitempty"` - Manual *ManualProvision `json:"manual,omitempty"` - MultiStep *MultiStep `json:"multiStep,omitempty"` - Unconfigured *UnconfiguredProvision `json:"unconfigured,omitempty"` - Webhook *WebhookProvision `json:"webhook,omitempty"` + Action *ActionProvision `json:"action,omitempty"` + Connector *ConnectorProvision `json:"connector,omitempty"` + Delegated *DelegatedProvision `json:"delegated,omitempty"` + DevicePlacement *DevicePlacementProvision `json:"devicePlacement,omitempty"` + ExternalTicket *ExternalTicketProvision `json:"externalTicket,omitempty"` + Manual *ManualProvision `json:"manual,omitempty"` + MultiStep *MultiStep `json:"multiStep,omitempty"` + Unconfigured *UnconfiguredProvision `json:"unconfigured,omitempty"` + Webhook *WebhookProvision `json:"webhook,omitempty"` } func (p *ProvisionPolicy) GetAction() *ActionProvision { @@ -45,6 +47,13 @@ func (p *ProvisionPolicy) GetDelegated() *DelegatedProvision { return p.Delegated } +func (p *ProvisionPolicy) GetDevicePlacement() *DevicePlacementProvision { + if p == nil { + return nil + } + return p.DevicePlacement +} + func (p *ProvisionPolicy) GetExternalTicket() *ExternalTicketProvision { if p == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionpolicyinput.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionpolicyinput.go index 51f0bb75..e3582234 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionpolicyinput.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionpolicyinput.go @@ -13,15 +13,17 @@ package shared // - externalTicket // - unconfigured // - action +// - devicePlacement type ProvisionPolicyInput struct { - Action *ActionProvision `json:"action,omitempty"` - Connector *ConnectorProvision `json:"connector,omitempty"` - Delegated *DelegatedProvision `json:"delegated,omitempty"` - ExternalTicket *ExternalTicketProvision `json:"externalTicket,omitempty"` - Manual *ManualProvision `json:"manual,omitempty"` - MultiStep *MultiStep `json:"multiStep,omitempty"` - Unconfigured *UnconfiguredProvision `json:"unconfigured,omitempty"` - Webhook *WebhookProvision `json:"webhook,omitempty"` + Action *ActionProvision `json:"action,omitempty"` + Connector *ConnectorProvision `json:"connector,omitempty"` + Delegated *DelegatedProvision `json:"delegated,omitempty"` + DevicePlacement *DevicePlacementProvision `json:"devicePlacement,omitempty"` + ExternalTicket *ExternalTicketProvision `json:"externalTicket,omitempty"` + Manual *ManualProvision `json:"manual,omitempty"` + MultiStep *MultiStep `json:"multiStep,omitempty"` + Unconfigured *UnconfiguredProvision `json:"unconfigured,omitempty"` + Webhook *WebhookProvision `json:"webhook,omitempty"` } func (p *ProvisionPolicyInput) GetAction() *ActionProvision { @@ -45,6 +47,13 @@ func (p *ProvisionPolicyInput) GetDelegated() *DelegatedProvision { return p.Delegated } +func (p *ProvisionPolicyInput) GetDevicePlacement() *DevicePlacementProvision { + if p == nil { + return nil + } + return p.DevicePlacement +} + func (p *ProvisionPolicyInput) GetExternalTicket() *ExternalTicketProvision { if p == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionwaitingon.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionwaitingon.go new file mode 100644 index 00000000..5b1c79ac --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/provisionwaitingon.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// ProvisionWaitingOn - Describes why a provision step is paused in the WAITING state. +// +// This message contains a oneof named kind. Only a single field of the following list may be set at a time: +// - entitlementMerge +// - devicePlacement +type ProvisionWaitingOn struct { + DevicePlacement *WaitingForDevicePlacement `json:"devicePlacement,omitempty"` + EntitlementMerge *WaitingForEntitlementMerge `json:"entitlementMerge,omitempty"` + FallbackAt *time.Time `json:"fallbackAt,omitempty"` + StartedWaitingAt *time.Time `json:"startedWaitingAt,omitempty"` +} + +func (p ProvisionWaitingOn) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *ProvisionWaitingOn) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *ProvisionWaitingOn) GetDevicePlacement() *WaitingForDevicePlacement { + if p == nil { + return nil + } + return p.DevicePlacement +} + +func (p *ProvisionWaitingOn) GetEntitlementMerge() *WaitingForEntitlementMerge { + if p == nil { + return nil + } + return p.EntitlementMerge +} + +func (p *ProvisionWaitingOn) GetFallbackAt() *time.Time { + if p == nil { + return nil + } + return p.FallbackAt +} + +func (p *ProvisionWaitingOn) GetStartedWaitingAt() *time.Time { + if p == nil { + return nil + } + return p.StartedWaitingAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/recurrencerule.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/recurrencerule.go index 46a116ae..df7339a2 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/recurrencerule.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/recurrencerule.go @@ -7,7 +7,9 @@ import ( "time" ) -// RecurrenceRuleFrequency - The frequency field. +// RecurrenceRuleFrequency - Frequency of the recurrence: FREQUENCY_DAILY, FREQUENCY_WEEKLY, FREQUENCY_MONTHLY, or FREQUENCY_YEARLY. +// +// Use FREQUENCY_NONE for a non-recurring schedule. type RecurrenceRuleFrequency string const ( @@ -41,8 +43,9 @@ func (e *RecurrenceRuleFrequency) IsExact() bool { // - occurrences type RecurrenceRule struct { EndDate *time.Time `json:"endDate,omitempty"` - // The frequency field. - Frequency *RecurrenceRuleFrequency `json:"frequency,omitempty"` + // Frequency of the recurrence: FREQUENCY_DAILY, FREQUENCY_WEEKLY, FREQUENCY_MONTHLY, or FREQUENCY_YEARLY. + // Use FREQUENCY_NONE for a non-recurring schedule. + Frequency RecurrenceRuleFrequency `json:"frequency"` // The interval field. Interval *int `json:"interval,omitempty"` // The occurrences field. @@ -70,9 +73,9 @@ func (r *RecurrenceRule) GetEndDate() *time.Time { return r.EndDate } -func (r *RecurrenceRule) GetFrequency() *RecurrenceRuleFrequency { +func (r *RecurrenceRule) GetFrequency() RecurrenceRuleFrequency { if r == nil { - return nil + return RecurrenceRuleFrequency("") } return r.Frequency } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/report.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/report.go new file mode 100644 index 00000000..90a3e933 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/report.go @@ -0,0 +1,137 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// Report is a saved report: the question, the program that answers it, and the +// +// parameters a re-run may vary. +type Report struct { + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The createdByUserId field. + CreatedByUserID *string `json:"createdByUserId,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + // The displayName field. + DisplayName *string `json:"displayName,omitempty"` + // The id field. + ID *string `json:"id,omitempty"` + // Separate pointers: the last attempt may have failed while callers still need + // the last renderable result. + LatestRunID *string `json:"latestRunId,omitempty"` + // The latestSuccessfulRunId field. + LatestSuccessfulRunID *string `json:"latestSuccessfulRunId,omitempty"` + ParameterSchema map[string]any `json:"parameterSchema,omitempty"` + ParameterValues map[string]any `json:"parameterValues,omitempty"` + Program *ProgramRef `json:"program,omitempty"` + // The editable natural-language question. Only a re-plan reads this. + Prompt *string `json:"prompt,omitempty"` + // The tenantId field. + TenantID *string `json:"tenantId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (r Report) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *Report) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *Report) GetCreatedAt() *time.Time { + if r == nil { + return nil + } + return r.CreatedAt +} + +func (r *Report) GetCreatedByUserID() *string { + if r == nil { + return nil + } + return r.CreatedByUserID +} + +func (r *Report) GetDeletedAt() *time.Time { + if r == nil { + return nil + } + return r.DeletedAt +} + +func (r *Report) GetDisplayName() *string { + if r == nil { + return nil + } + return r.DisplayName +} + +func (r *Report) GetID() *string { + if r == nil { + return nil + } + return r.ID +} + +func (r *Report) GetLatestRunID() *string { + if r == nil { + return nil + } + return r.LatestRunID +} + +func (r *Report) GetLatestSuccessfulRunID() *string { + if r == nil { + return nil + } + return r.LatestSuccessfulRunID +} + +func (r *Report) GetParameterSchema() map[string]any { + if r == nil { + return nil + } + return r.ParameterSchema +} + +func (r *Report) GetParameterValues() map[string]any { + if r == nil { + return nil + } + return r.ParameterValues +} + +func (r *Report) GetProgram() *ProgramRef { + if r == nil { + return nil + } + return r.Program +} + +func (r *Report) GetPrompt() *string { + if r == nil { + return nil + } + return r.Prompt +} + +func (r *Report) GetTenantID() *string { + if r == nil { + return nil + } + return r.TenantID +} + +func (r *Report) GetUpdatedAt() *time.Time { + if r == nil { + return nil + } + return r.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicedeleterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicedeleterequest.go new file mode 100644 index 00000000..1575efbc --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicedeleterequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceDeleteRequest message. +type ReportingServiceDeleteRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicedeleteresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicedeleteresponse.go new file mode 100644 index 00000000..d1ab6d56 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicedeleteresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceDeleteResponse message. +type ReportingServiceDeleteResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetprogramresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetprogramresponse.go new file mode 100644 index 00000000..f2480d97 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetprogramresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceGetProgramResponse message. +type ReportingServiceGetProgramResponse struct { + // The files field. + Files map[string]string `json:"files,omitempty"` + // The programId field. + ProgramID *string `json:"programId,omitempty"` +} + +func (r *ReportingServiceGetProgramResponse) GetFiles() map[string]string { + if r == nil { + return nil + } + return r.Files +} + +func (r *ReportingServiceGetProgramResponse) GetProgramID() *string { + if r == nil { + return nil + } + return r.ProgramID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetresponse.go new file mode 100644 index 00000000..fc0babbb --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetresponse.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceGetResponse message. +type ReportingServiceGetResponse struct { + LatestRun *ReportRun `json:"latestRun,omitempty"` + LatestSuccessfulRun *ReportRun `json:"latestSuccessfulRun,omitempty"` + // True when prompt no longer matches program.planned_from_prompt. A rerun + // re-executes and never re-plans, so an edited question leaves the program + // answering the old one. + PromptDrifted *bool `json:"promptDrifted,omitempty"` + Report *Report `json:"report,omitempty"` +} + +func (r *ReportingServiceGetResponse) GetLatestRun() *ReportRun { + if r == nil { + return nil + } + return r.LatestRun +} + +func (r *ReportingServiceGetResponse) GetLatestSuccessfulRun() *ReportRun { + if r == nil { + return nil + } + return r.LatestSuccessfulRun +} + +func (r *ReportingServiceGetResponse) GetPromptDrifted() *bool { + if r == nil { + return nil + } + return r.PromptDrifted +} + +func (r *ReportingServiceGetResponse) GetReport() *Report { + if r == nil { + return nil + } + return r.Report +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetrunprovenanceresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetrunprovenanceresponse.go new file mode 100644 index 00000000..96c2ac73 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicegetrunprovenanceresponse.go @@ -0,0 +1,97 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceGetRunProvenanceResponse message. +type ReportingServiceGetRunProvenanceResponse struct { + // The immutable user instruction that produced an applied edit. + EditInstruction *string `json:"editInstruction,omitempty"` + // The programCommitId field. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + ProgramCommitID *string `json:"programCommitId,omitempty"` + // Deprecated tombstones. Source-owned reports never populate Function or + // commit identity; these declarations remain only because c1api forbids + // deleting published fields. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + ProgramFunctionID *string `json:"programFunctionId,omitempty"` + // The durable source version this run pinned. + ProgramID *string `json:"programId,omitempty"` + // The parameters this run was bound to, as JSON. "{}" for a program that + // takes none — a real answer, distinct from absent. + ProgramInput *string `json:"programInput,omitempty"` + // The programSource field. + ProgramSource *string `json:"programSource,omitempty"` + // What each part of the report shows, read off the run's own copy of the + // surface rather than a live one. + Sources []A2UIProvenanceSource `json:"sources,omitempty"` + // What the program looked at, derived from its source. + Steps []A2UIProvenanceStep `json:"steps,omitempty"` + // False when the program's source could not be read, which is what makes an + // empty steps list mean "unknown" rather than "it read nothing". + StepsAvailable *bool `json:"stepsAvailable,omitempty"` +} + +func (r *ReportingServiceGetRunProvenanceResponse) GetEditInstruction() *string { + if r == nil { + return nil + } + return r.EditInstruction +} + +func (r *ReportingServiceGetRunProvenanceResponse) GetProgramCommitID() *string { + if r == nil { + return nil + } + return r.ProgramCommitID +} + +func (r *ReportingServiceGetRunProvenanceResponse) GetProgramFunctionID() *string { + if r == nil { + return nil + } + return r.ProgramFunctionID +} + +func (r *ReportingServiceGetRunProvenanceResponse) GetProgramID() *string { + if r == nil { + return nil + } + return r.ProgramID +} + +func (r *ReportingServiceGetRunProvenanceResponse) GetProgramInput() *string { + if r == nil { + return nil + } + return r.ProgramInput +} + +func (r *ReportingServiceGetRunProvenanceResponse) GetProgramSource() *string { + if r == nil { + return nil + } + return r.ProgramSource +} + +func (r *ReportingServiceGetRunProvenanceResponse) GetSources() []A2UIProvenanceSource { + if r == nil { + return nil + } + return r.Sources +} + +func (r *ReportingServiceGetRunProvenanceResponse) GetSteps() []A2UIProvenanceStep { + if r == nil { + return nil + } + return r.Steps +} + +func (r *ReportingServiceGetRunProvenanceResponse) GetStepsAvailable() *bool { + if r == nil { + return nil + } + return r.StepsAvailable +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicelistresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicelistresponse.go new file mode 100644 index 00000000..dfbf3b1b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicelistresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceListResponse message. +type ReportingServiceListResponse struct { + // The list field. + List []Report `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (r *ReportingServiceListResponse) GetList() []Report { + if r == nil { + return nil + } + return r.List +} + +func (r *ReportingServiceListResponse) GetNextPageToken() *string { + if r == nil { + return nil + } + return r.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicerunrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicerunrequest.go new file mode 100644 index 00000000..3920e7bd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicerunrequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceRunRequest message. +type ReportingServiceRunRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicerunresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicerunresponse.go new file mode 100644 index 00000000..b9f0f980 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicerunresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceRunResponse message. +type ReportingServiceRunResponse struct { + Run *ReportRun `json:"run,omitempty"` +} + +func (r *ReportingServiceRunResponse) GetRun() *ReportRun { + if r == nil { + return nil + } + return r.Run +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicesaverequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicesaverequest.go new file mode 100644 index 00000000..ed91ed70 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicesaverequest.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceSaveRequest message. +type ReportingServiceSaveRequest struct { + // The conversation and surface are both required to address a rendered + // surface; neither identifies one alone. + ConversationID *string `json:"conversationId,omitempty"` + // Required for a new report and rejected when report_id is set. + DisplayName *string `json:"displayName,omitempty"` + // Required with report_id. A stale source version is rejected rather than + // silently overwriting a newer edit. + ExpectedProgramID *string `json:"expectedProgramId,omitempty"` + // The question this surface answered. Used only when creating a report; + // applying an edit preserves the report's canonical question and records the + // incremental instruction on the immutable run. + Prompt *string `json:"prompt,omitempty"` + // Empty creates a report. Set to apply the validated edit surface to an + // existing report without changing its identity or history. + ReportID *string `json:"reportId,omitempty"` + // The surfaceId field. + SurfaceID *string `json:"surfaceId,omitempty"` +} + +func (r *ReportingServiceSaveRequest) GetConversationID() *string { + if r == nil { + return nil + } + return r.ConversationID +} + +func (r *ReportingServiceSaveRequest) GetDisplayName() *string { + if r == nil { + return nil + } + return r.DisplayName +} + +func (r *ReportingServiceSaveRequest) GetExpectedProgramID() *string { + if r == nil { + return nil + } + return r.ExpectedProgramID +} + +func (r *ReportingServiceSaveRequest) GetPrompt() *string { + if r == nil { + return nil + } + return r.Prompt +} + +func (r *ReportingServiceSaveRequest) GetReportID() *string { + if r == nil { + return nil + } + return r.ReportID +} + +func (r *ReportingServiceSaveRequest) GetSurfaceID() *string { + if r == nil { + return nil + } + return r.SurfaceID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicesaveresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicesaveresponse.go new file mode 100644 index 00000000..e3e38ba3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingservicesaveresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceSaveResponse message. +type ReportingServiceSaveResponse struct { + Report *Report `json:"report,omitempty"` +} + +func (r *ReportingServiceSaveResponse) GetReport() *Report { + if r == nil { + return nil + } + return r.Report +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingserviceupdaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingserviceupdaterequest.go new file mode 100644 index 00000000..43e42010 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingserviceupdaterequest.go @@ -0,0 +1,46 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// ReportingServiceUpdateRequest - Both editable fields are optional; an empty one leaves the stored value alone. +// +// At least one must be set. +type ReportingServiceUpdateRequest struct { + // The displayName field. + DisplayName *string `json:"displayName,omitempty"` + // Required with parameter_values. Prevents values prepared for one source + // version from being installed after an assistant edit advances the report. + ExpectedProgramID *string `json:"expectedProgramId,omitempty"` + ParameterValues map[string]any `json:"parameterValues,omitempty"` + // Editing this does not re-plan, so it may drift from + // program.planned_from_prompt — that drift is how a stale report is detected. + Prompt *string `json:"prompt,omitempty"` +} + +func (r *ReportingServiceUpdateRequest) GetDisplayName() *string { + if r == nil { + return nil + } + return r.DisplayName +} + +func (r *ReportingServiceUpdateRequest) GetExpectedProgramID() *string { + if r == nil { + return nil + } + return r.ExpectedProgramID +} + +func (r *ReportingServiceUpdateRequest) GetParameterValues() map[string]any { + if r == nil { + return nil + } + return r.ParameterValues +} + +func (r *ReportingServiceUpdateRequest) GetPrompt() *string { + if r == nil { + return nil + } + return r.Prompt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingserviceupdateresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingserviceupdateresponse.go new file mode 100644 index 00000000..8cd4eee7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportingserviceupdateresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The ReportingServiceUpdateResponse message. +type ReportingServiceUpdateResponse struct { + Report *Report `json:"report,omitempty"` +} + +func (r *ReportingServiceUpdateResponse) GetReport() *Report { + if r == nil { + return nil + } + return r.Report +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportrun.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportrun.go new file mode 100644 index 00000000..62a66e94 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportrun.go @@ -0,0 +1,330 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// Phase - Durable execution progress and milestone timestamps. Pending refreshes +// +// expose their current phase; terminal runs retain timings for analysis. +type Phase string + +const ( + PhaseReportRunPhaseUnspecified Phase = "REPORT_RUN_PHASE_UNSPECIFIED" + PhaseReportRunPhaseRequested Phase = "REPORT_RUN_PHASE_REQUESTED" + PhaseReportRunPhasePreparingScratch Phase = "REPORT_RUN_PHASE_PREPARING_SCRATCH" + PhaseReportRunPhaseRunningFunction Phase = "REPORT_RUN_PHASE_RUNNING_FUNCTION" + PhaseReportRunPhaseFinalizingOutput Phase = "REPORT_RUN_PHASE_FINALIZING_OUTPUT" + PhaseReportRunPhaseSucceeded Phase = "REPORT_RUN_PHASE_SUCCEEDED" + PhaseReportRunPhaseFailed Phase = "REPORT_RUN_PHASE_FAILED" +) + +func (e Phase) ToPointer() *Phase { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Phase) IsExact() bool { + if e != nil { + switch *e { + case "REPORT_RUN_PHASE_UNSPECIFIED", "REPORT_RUN_PHASE_REQUESTED", "REPORT_RUN_PHASE_PREPARING_SCRATCH", "REPORT_RUN_PHASE_RUNNING_FUNCTION", "REPORT_RUN_PHASE_FINALIZING_OUTPUT", "REPORT_RUN_PHASE_SUCCEEDED", "REPORT_RUN_PHASE_FAILED": + return true + } + } + return false +} + +// ReportRunStatus - The status field. +type ReportRunStatus string + +const ( + ReportRunStatusReportRunStatusUnspecified ReportRunStatus = "REPORT_RUN_STATUS_UNSPECIFIED" + ReportRunStatusReportRunStatusPending ReportRunStatus = "REPORT_RUN_STATUS_PENDING" + ReportRunStatusReportRunStatusSucceeded ReportRunStatus = "REPORT_RUN_STATUS_SUCCEEDED" + ReportRunStatusReportRunStatusFailed ReportRunStatus = "REPORT_RUN_STATUS_FAILED" + ReportRunStatusReportRunStatusStaleProgram ReportRunStatus = "REPORT_RUN_STATUS_STALE_PROGRAM" +) + +func (e ReportRunStatus) ToPointer() *ReportRunStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ReportRunStatus) IsExact() bool { + if e != nil { + switch *e { + case "REPORT_RUN_STATUS_UNSPECIFIED", "REPORT_RUN_STATUS_PENDING", "REPORT_RUN_STATUS_SUCCEEDED", "REPORT_RUN_STATUS_FAILED", "REPORT_RUN_STATUS_STALE_PROGRAM": + return true + } + } + return false +} + +// ReportRun is one execution of a Report's program. Write-once. +type ReportRun struct { + // The artifactUrl field. + ArtifactURL *string `json:"artifactUrl,omitempty"` + // Historical source-surface address. New runs render from surface_snapshot + // without a live A2UI address and leave these empty. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + ConversationID *string `json:"conversationId,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + // The immutable user instruction that produced an applied edit. Empty for + // an initial save and for headless refreshes. + EditInstruction *string `json:"editInstruction,omitempty"` + // The error field. + Error *string `json:"error,omitempty"` + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + FinalizingAt *time.Time `json:"finalizingAt,omitempty"` + FinishedAt *time.Time `json:"finishedAt,omitempty"` + // KSUID, so runs sort by time. + ID *string `json:"id,omitempty"` + // Not a live join: the originating code-mode invocation is archived at the + // code-mode retention cutoff. + InvocationID *string `json:"invocationId,omitempty"` + Lineage map[string]any `json:"lineage,omitempty"` + ParameterSchema map[string]any `json:"parameterSchema,omitempty"` + ParameterValues map[string]any `json:"parameterValues,omitempty"` + // Durable execution progress and milestone timestamps. Pending refreshes + // expose their current phase; terminal runs retain timings for analysis. + Phase *Phase `json:"phase,omitempty"` + PreparingAt *time.Time `json:"preparingAt,omitempty"` + Program *ProgramRef `json:"program,omitempty"` + // The reportId field. + ReportID *string `json:"reportId,omitempty"` + RequestedAt *time.Time `json:"requestedAt,omitempty"` + // Copied from the invocation's user_id, which is archived at the code-mode + // retention cutoff. Not Report.created_by_user_id — a refresh may execute as a + // different principal than the report's owner. + RunByUserID *string `json:"runByUserId,omitempty"` + RunningAt *time.Time `json:"runningAt,omitempty"` + // Retired copied provenance. GetRunProvenance derives provenance from the + // durable surface and program snapshots for both saved and refreshed runs. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Sources []ReportSource `json:"sources,omitempty"` + // The status field. + Status *ReportRunStatus `json:"status,omitempty"` + // The surfaceId field. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + SurfaceID *string `json:"surfaceId,omitempty"` + SurfaceSnapshot *A2UISurface `json:"surfaceSnapshot,omitempty"` + // The tenantId field. + TenantID *string `json:"tenantId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // The vfsId field. + VfsID *string `json:"vfsId,omitempty"` +} + +func (r ReportRun) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReportRun) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *ReportRun) GetArtifactURL() *string { + if r == nil { + return nil + } + return r.ArtifactURL +} + +func (r *ReportRun) GetConversationID() *string { + if r == nil { + return nil + } + return r.ConversationID +} + +func (r *ReportRun) GetCreatedAt() *time.Time { + if r == nil { + return nil + } + return r.CreatedAt +} + +func (r *ReportRun) GetDeletedAt() *time.Time { + if r == nil { + return nil + } + return r.DeletedAt +} + +func (r *ReportRun) GetEditInstruction() *string { + if r == nil { + return nil + } + return r.EditInstruction +} + +func (r *ReportRun) GetError() *string { + if r == nil { + return nil + } + return r.Error +} + +func (r *ReportRun) GetExpiresAt() *time.Time { + if r == nil { + return nil + } + return r.ExpiresAt +} + +func (r *ReportRun) GetFinalizingAt() *time.Time { + if r == nil { + return nil + } + return r.FinalizingAt +} + +func (r *ReportRun) GetFinishedAt() *time.Time { + if r == nil { + return nil + } + return r.FinishedAt +} + +func (r *ReportRun) GetID() *string { + if r == nil { + return nil + } + return r.ID +} + +func (r *ReportRun) GetInvocationID() *string { + if r == nil { + return nil + } + return r.InvocationID +} + +func (r *ReportRun) GetLineage() map[string]any { + if r == nil { + return nil + } + return r.Lineage +} + +func (r *ReportRun) GetParameterSchema() map[string]any { + if r == nil { + return nil + } + return r.ParameterSchema +} + +func (r *ReportRun) GetParameterValues() map[string]any { + if r == nil { + return nil + } + return r.ParameterValues +} + +func (r *ReportRun) GetPhase() *Phase { + if r == nil { + return nil + } + return r.Phase +} + +func (r *ReportRun) GetPreparingAt() *time.Time { + if r == nil { + return nil + } + return r.PreparingAt +} + +func (r *ReportRun) GetProgram() *ProgramRef { + if r == nil { + return nil + } + return r.Program +} + +func (r *ReportRun) GetReportID() *string { + if r == nil { + return nil + } + return r.ReportID +} + +func (r *ReportRun) GetRequestedAt() *time.Time { + if r == nil { + return nil + } + return r.RequestedAt +} + +func (r *ReportRun) GetRunByUserID() *string { + if r == nil { + return nil + } + return r.RunByUserID +} + +func (r *ReportRun) GetRunningAt() *time.Time { + if r == nil { + return nil + } + return r.RunningAt +} + +func (r *ReportRun) GetSources() []ReportSource { + if r == nil { + return nil + } + return r.Sources +} + +func (r *ReportRun) GetStatus() *ReportRunStatus { + if r == nil { + return nil + } + return r.Status +} + +func (r *ReportRun) GetSurfaceID() *string { + if r == nil { + return nil + } + return r.SurfaceID +} + +func (r *ReportRun) GetSurfaceSnapshot() *A2UISurface { + if r == nil { + return nil + } + return r.SurfaceSnapshot +} + +func (r *ReportRun) GetTenantID() *string { + if r == nil { + return nil + } + return r.TenantID +} + +func (r *ReportRun) GetUpdatedAt() *time.Time { + if r == nil { + return nil + } + return r.UpdatedAt +} + +func (r *ReportRun) GetVfsID() *string { + if r == nil { + return nil + } + return r.VfsID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportsource.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportsource.go new file mode 100644 index 00000000..0321c2fd --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/reportsource.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" +) + +// ReportSource is one provenance entry: what a run read to produce its numbers. +// +// Retired: ReportingService.GetRunProvenance derives provenance from the +// durable surface and program snapshots rather than this copied list. Kept +// because a published message may not be deleted. +// +// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. +type ReportSource struct { + // Rows contributing. + Count *int64 `integer:"string" json:"count,omitempty"` + // The kind field. + Kind *string `json:"kind,omitempty"` + // The label field. + Label *string `json:"label,omitempty"` + // Tool + query fingerprint, or object type/id. + Ref *string `json:"ref,omitempty"` +} + +func (r ReportSource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReportSource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *ReportSource) GetCount() *int64 { + if r == nil { + return nil + } + return r.Count +} + +func (r *ReportSource) GetKind() *string { + if r == nil { + return nil + } + return r.Kind +} + +func (r *ReportSource) GetLabel() *string { + if r == nil { + return nil + } + return r.Label +} + +func (r *ReportSource) GetRef() *string { + if r == nil { + return nil + } + return r.Ref +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalog.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalog.go index 8cfc6129..94802c41 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalog.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalog.go @@ -31,6 +31,36 @@ func (e *EnrollmentBehavior) IsExact() bool { return false } +// RequestCatalogType - The type of this access profile. Reports CATALOG_AND_BUNDLE for a profile +// +// created before the type was recorded; UNSPECIFIED only for a tenant whose +// backfill has not been run. Updates require the access profile types feature +// and an update mask containing "type". +type RequestCatalogType string + +const ( + RequestCatalogTypeRequestCatalogTypeUnspecified RequestCatalogType = "REQUEST_CATALOG_TYPE_UNSPECIFIED" + RequestCatalogTypeRequestCatalogTypeCatalog RequestCatalogType = "REQUEST_CATALOG_TYPE_CATALOG" + RequestCatalogTypeRequestCatalogTypeProfile RequestCatalogType = "REQUEST_CATALOG_TYPE_PROFILE" + RequestCatalogTypeRequestCatalogTypeCatalogAndBundle RequestCatalogType = "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE" + RequestCatalogTypeRequestCatalogTypeBundle RequestCatalogType = "REQUEST_CATALOG_TYPE_BUNDLE" +) + +func (e RequestCatalogType) ToPointer() *RequestCatalogType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *RequestCatalogType) IsExact() bool { + if e != nil { + switch *e { + case "REQUEST_CATALOG_TYPE_UNSPECIFIED", "REQUEST_CATALOG_TYPE_CATALOG", "REQUEST_CATALOG_TYPE_PROFILE", "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE", "REQUEST_CATALOG_TYPE_BUNDLE": + return true + } + } + return false +} + // UnenrollmentBehavior - Defines how to handle the revocation of the entitlements in the catalog during unenrollment. type UnenrollmentBehavior string @@ -109,6 +139,11 @@ type RequestCatalog struct { Published *bool `json:"published,omitempty"` // Whether all the entitlements in the catalog can be requests at once. Your tenant must have the bundles feature to use this. RequestBundle *bool `json:"requestBundle,omitempty"` + // The type of this access profile. Reports CATALOG_AND_BUNDLE for a profile + // created before the type was recorded; UNSPECIFIED only for a tenant whose + // backfill has not been run. Updates require the access profile types feature + // and an update mask containing "type". + Type *RequestCatalogType `json:"type,omitempty"` // Defines how to handle the revocation of the entitlements in the catalog during unenrollment. UnenrollmentBehavior *UnenrollmentBehavior `json:"unenrollmentBehavior,omitempty"` // Defines how to handle the revoke policies of the entitlements in the catalog during unenrollment. @@ -206,6 +241,13 @@ func (r *RequestCatalog) GetRequestBundle() *bool { return r.RequestBundle } +func (r *RequestCatalog) GetType() *RequestCatalogType { + if r == nil { + return nil + } + return r.Type +} + func (r *RequestCatalog) GetUnenrollmentBehavior() *UnenrollmentBehavior { if r == nil { return nil @@ -261,6 +303,11 @@ type RequestCatalogInput struct { Published *bool `json:"published,omitempty"` // Whether all the entitlements in the catalog can be requests at once. Your tenant must have the bundles feature to use this. RequestBundle *bool `json:"requestBundle,omitempty"` + // The type of this access profile. Reports CATALOG_AND_BUNDLE for a profile + // created before the type was recorded; UNSPECIFIED only for a tenant whose + // backfill has not been run. Updates require the access profile types feature + // and an update mask containing "type". + Type *RequestCatalogType `json:"type,omitempty"` // Defines how to handle the revocation of the entitlements in the catalog during unenrollment. UnenrollmentBehavior *UnenrollmentBehavior `json:"unenrollmentBehavior,omitempty"` // Defines how to handle the revoke policies of the entitlements in the catalog during unenrollment. @@ -332,6 +379,13 @@ func (r *RequestCatalogInput) GetRequestBundle() *bool { return r.RequestBundle } +func (r *RequestCatalogInput) GetType() *RequestCatalogType { + if r == nil { + return nil + } + return r.Type +} + func (r *RequestCatalogInput) GetUnenrollmentBehavior() *UnenrollmentBehavior { if r == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementservicecreaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementservicecreaterequest.go index e08abf69..2a31e4c7 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementservicecreaterequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementservicecreaterequest.go @@ -26,6 +26,40 @@ func (e *RequestCatalogManagementServiceCreateRequestEnrollmentBehavior) IsExact return false } +// RequestCatalogManagementServiceCreateRequestType - The type of access profile to create. Leave unset for +// +// REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE, which is what every profile +// created before this field existed is. Setting it requires the +// ACCESS_PROFILE_TYPES feature. +// +// PROFILE is rejected rather than resolved: it is deprecated, has no stored +// counterpart, and shares wire number 2 with the stored BUNDLE, so honoring +// it would silently persist a type the caller did not ask for. +type RequestCatalogManagementServiceCreateRequestType string + +const ( + RequestCatalogManagementServiceCreateRequestTypeRequestCatalogTypeUnspecified RequestCatalogManagementServiceCreateRequestType = "REQUEST_CATALOG_TYPE_UNSPECIFIED" + RequestCatalogManagementServiceCreateRequestTypeRequestCatalogTypeCatalog RequestCatalogManagementServiceCreateRequestType = "REQUEST_CATALOG_TYPE_CATALOG" + RequestCatalogManagementServiceCreateRequestTypeRequestCatalogTypeProfile RequestCatalogManagementServiceCreateRequestType = "REQUEST_CATALOG_TYPE_PROFILE" + RequestCatalogManagementServiceCreateRequestTypeRequestCatalogTypeCatalogAndBundle RequestCatalogManagementServiceCreateRequestType = "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE" + RequestCatalogManagementServiceCreateRequestTypeRequestCatalogTypeBundle RequestCatalogManagementServiceCreateRequestType = "REQUEST_CATALOG_TYPE_BUNDLE" +) + +func (e RequestCatalogManagementServiceCreateRequestType) ToPointer() *RequestCatalogManagementServiceCreateRequestType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *RequestCatalogManagementServiceCreateRequestType) IsExact() bool { + if e != nil { + switch *e { + case "REQUEST_CATALOG_TYPE_UNSPECIFIED", "REQUEST_CATALOG_TYPE_CATALOG", "REQUEST_CATALOG_TYPE_PROFILE", "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE", "REQUEST_CATALOG_TYPE_BUNDLE": + return true + } + } + return false +} + // RequestCatalogManagementServiceCreateRequestUnenrollmentBehavior - Defines how to handle the revocation of the entitlements in the catalog during unenrollment. type RequestCatalogManagementServiceCreateRequestUnenrollmentBehavior string @@ -97,6 +131,15 @@ type RequestCatalogManagementServiceCreateRequest struct { Published *bool `json:"published,omitempty"` // Whether all the entitlements in the catalog can be requests at once. Your tenant must have the bundles feature to use this. RequestBundle *bool `json:"requestBundle,omitempty"` + // The type of access profile to create. Leave unset for + // REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE, which is what every profile + // created before this field existed is. Setting it requires the + // ACCESS_PROFILE_TYPES feature. + // + // PROFILE is rejected rather than resolved: it is deprecated, has no stored + // counterpart, and shares wire number 2 with the stored BUNDLE, so honoring + // it would silently persist a type the caller did not ask for. + Type *RequestCatalogManagementServiceCreateRequestType `json:"type,omitempty"` // Defines how to handle the revocation of the entitlements in the catalog during unenrollment. UnenrollmentBehavior *RequestCatalogManagementServiceCreateRequestUnenrollmentBehavior `json:"unenrollmentBehavior,omitempty"` // Defines how to handle the revoke policies of the entitlements in the catalog during unenrollment. @@ -154,6 +197,13 @@ func (r *RequestCatalogManagementServiceCreateRequest) GetRequestBundle() *bool return r.RequestBundle } +func (r *RequestCatalogManagementServiceCreateRequest) GetType() *RequestCatalogManagementServiceCreateRequestType { + if r == nil { + return nil + } + return r.Type +} + func (r *RequestCatalogManagementServiceCreateRequest) GetUnenrollmentBehavior() *RequestCatalogManagementServiceCreateRequestUnenrollmentBehavior { if r == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementserviceplantypechangerequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementserviceplantypechangerequest.go new file mode 100644 index 00000000..75ec916b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementserviceplantypechangerequest.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// TargetType - Requested type. UNSPECIFIED and the deprecated PROFILE value are rejected. +type TargetType string + +const ( + TargetTypeRequestCatalogTypeUnspecified TargetType = "REQUEST_CATALOG_TYPE_UNSPECIFIED" + TargetTypeRequestCatalogTypeCatalog TargetType = "REQUEST_CATALOG_TYPE_CATALOG" + TargetTypeRequestCatalogTypeProfile TargetType = "REQUEST_CATALOG_TYPE_PROFILE" + TargetTypeRequestCatalogTypeCatalogAndBundle TargetType = "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE" + TargetTypeRequestCatalogTypeBundle TargetType = "REQUEST_CATALOG_TYPE_BUNDLE" +) + +func (e TargetType) ToPointer() *TargetType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *TargetType) IsExact() bool { + if e != nil { + switch *e { + case "REQUEST_CATALOG_TYPE_UNSPECIFIED", "REQUEST_CATALOG_TYPE_CATALOG", "REQUEST_CATALOG_TYPE_PROFILE", "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE", "REQUEST_CATALOG_TYPE_BUNDLE": + return true + } + } + return false +} + +// RequestCatalogManagementServicePlanTypeChangeRequest - Requests a side-effect-free plan for changing an access profile's type. +type RequestCatalogManagementServicePlanTypeChangeRequest struct { + // Requested type. UNSPECIFIED and the deprecated PROFILE value are rejected. + TargetType *TargetType `json:"targetType,omitempty"` +} + +func (r *RequestCatalogManagementServicePlanTypeChangeRequest) GetTargetType() *TargetType { + if r == nil { + return nil + } + return r.TargetType +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementserviceplantypechangeresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementserviceplantypechangeresponse.go new file mode 100644 index 00000000..5b1cdbfe --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogmanagementserviceplantypechangeresponse.go @@ -0,0 +1,91 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// CurrentType - Current stored type. UNSPECIFIED means the profile predates type backfill +// +// or contains an unknown future value. +type CurrentType string + +const ( + CurrentTypeRequestCatalogTypeUnspecified CurrentType = "REQUEST_CATALOG_TYPE_UNSPECIFIED" + CurrentTypeRequestCatalogTypeCatalog CurrentType = "REQUEST_CATALOG_TYPE_CATALOG" + CurrentTypeRequestCatalogTypeProfile CurrentType = "REQUEST_CATALOG_TYPE_PROFILE" + CurrentTypeRequestCatalogTypeCatalogAndBundle CurrentType = "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE" + CurrentTypeRequestCatalogTypeBundle CurrentType = "REQUEST_CATALOG_TYPE_BUNDLE" +) + +func (e CurrentType) ToPointer() *CurrentType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *CurrentType) IsExact() bool { + if e != nil { + switch *e { + case "REQUEST_CATALOG_TYPE_UNSPECIFIED", "REQUEST_CATALOG_TYPE_CATALOG", "REQUEST_CATALOG_TYPE_PROFILE", "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE", "REQUEST_CATALOG_TYPE_BUNDLE": + return true + } + } + return false +} + +// RequestCatalogManagementServicePlanTypeChangeResponseTargetType - Type requested by the caller. +type RequestCatalogManagementServicePlanTypeChangeResponseTargetType string + +const ( + RequestCatalogManagementServicePlanTypeChangeResponseTargetTypeRequestCatalogTypeUnspecified RequestCatalogManagementServicePlanTypeChangeResponseTargetType = "REQUEST_CATALOG_TYPE_UNSPECIFIED" + RequestCatalogManagementServicePlanTypeChangeResponseTargetTypeRequestCatalogTypeCatalog RequestCatalogManagementServicePlanTypeChangeResponseTargetType = "REQUEST_CATALOG_TYPE_CATALOG" + RequestCatalogManagementServicePlanTypeChangeResponseTargetTypeRequestCatalogTypeProfile RequestCatalogManagementServicePlanTypeChangeResponseTargetType = "REQUEST_CATALOG_TYPE_PROFILE" + RequestCatalogManagementServicePlanTypeChangeResponseTargetTypeRequestCatalogTypeCatalogAndBundle RequestCatalogManagementServicePlanTypeChangeResponseTargetType = "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE" + RequestCatalogManagementServicePlanTypeChangeResponseTargetTypeRequestCatalogTypeBundle RequestCatalogManagementServicePlanTypeChangeResponseTargetType = "REQUEST_CATALOG_TYPE_BUNDLE" +) + +func (e RequestCatalogManagementServicePlanTypeChangeResponseTargetType) ToPointer() *RequestCatalogManagementServicePlanTypeChangeResponseTargetType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *RequestCatalogManagementServicePlanTypeChangeResponseTargetType) IsExact() bool { + if e != nil { + switch *e { + case "REQUEST_CATALOG_TYPE_UNSPECIFIED", "REQUEST_CATALOG_TYPE_CATALOG", "REQUEST_CATALOG_TYPE_PROFILE", "REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE", "REQUEST_CATALOG_TYPE_BUNDLE": + return true + } + } + return false +} + +// RequestCatalogManagementServicePlanTypeChangeResponse - Describes behavior affected by an access profile type change. +type RequestCatalogManagementServicePlanTypeChangeResponse struct { + // Current stored type. UNSPECIFIED means the profile predates type backfill + // or contains an unknown future value. + CurrentType *CurrentType `json:"currentType,omitempty"` + // Deterministically ordered behavior affected by the transition. These + // impacts describe what the target type does not support; the change does not + // remove or modify the underlying state. + Impacts []RequestCatalogTypeChangeImpact `json:"impacts,omitempty"` + // Type requested by the caller. + TargetType *RequestCatalogManagementServicePlanTypeChangeResponseTargetType `json:"targetType,omitempty"` +} + +func (r *RequestCatalogManagementServicePlanTypeChangeResponse) GetCurrentType() *CurrentType { + if r == nil { + return nil + } + return r.CurrentType +} + +func (r *RequestCatalogManagementServicePlanTypeChangeResponse) GetImpacts() []RequestCatalogTypeChangeImpact { + if r == nil { + return nil + } + return r.Impacts +} + +func (r *RequestCatalogManagementServicePlanTypeChangeResponse) GetTargetType() *RequestCatalogManagementServicePlanTypeChangeResponseTargetType { + if r == nil { + return nil + } + return r.TargetType +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogref.go new file mode 100644 index 00000000..a0b5879e --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogref.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The RequestCatalogRef message. +type RequestCatalogRef struct { + // The id field. + ID *string `json:"id,omitempty"` +} + +func (r *RequestCatalogRef) GetID() *string { + if r == nil { + return nil + } + return r.ID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogtypechangeimpact.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogtypechangeimpact.go new file mode 100644 index 00000000..24ab9453 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogtypechangeimpact.go @@ -0,0 +1,144 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" +) + +// Category - How the target type treats the current state. +type Category string + +const ( + CategoryRequestCatalogTypeChangeImpactCategoryUnspecified Category = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_UNSPECIFIED" + CategoryRequestCatalogTypeChangeImpactCategoryBlocksChange Category = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_BLOCKS_CHANGE" + CategoryRequestCatalogTypeChangeImpactCategoryWillDisable Category = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_WILL_DISABLE" + CategoryRequestCatalogTypeChangeImpactCategoryWillRemove Category = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_WILL_REMOVE" + CategoryRequestCatalogTypeChangeImpactCategoryInformational Category = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_INFORMATIONAL" + CategoryRequestCatalogTypeChangeImpactCategoryNeedsAttention Category = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_NEEDS_ATTENTION" + CategoryRequestCatalogTypeChangeImpactCategoryNotSupported Category = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_NOT_SUPPORTED" + CategoryRequestCatalogTypeChangeImpactCategoryIgnored Category = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_IGNORED" +) + +func (e Category) ToPointer() *Category { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Category) IsExact() bool { + if e != nil { + switch *e { + case "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_UNSPECIFIED", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_BLOCKS_CHANGE", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_WILL_DISABLE", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_WILL_REMOVE", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_INFORMATIONAL", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_NEEDS_ATTENTION", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_NOT_SUPPORTED", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CATEGORY_IGNORED": + return true + } + } + return false +} + +// Code - Stable reason identifier for rendering, diagnostics, and tests. +type Code string + +const ( + CodeRequestCatalogTypeChangeImpactCodeUnspecified Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_UNSPECIFIED" + CodeRequestCatalogTypeChangeImpactCodeSameType Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_SAME_TYPE" + CodeRequestCatalogTypeChangeImpactCodeCurrentTypeUnspecified Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_CURRENT_TYPE_UNSPECIFIED" + CodeRequestCatalogTypeChangeImpactCodeCurrentTypeUnknown Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_CURRENT_TYPE_UNKNOWN" + CodeRequestCatalogTypeChangeImpactCodeMembershipEntitlementMissing Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_MEMBERSHIP_ENTITLEMENT_MISSING" + CodeRequestCatalogTypeChangeImpactCodePublished Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_PUBLISHED" + CodeRequestCatalogTypeChangeImpactCodeVisibleToEveryone Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_VISIBLE_TO_EVERYONE" + CodeRequestCatalogTypeChangeImpactCodeVisibilityBindings Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_VISIBILITY_BINDINGS" + CodeRequestCatalogTypeChangeImpactCodeRequestBundle Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_REQUEST_BUNDLE" + CodeRequestCatalogTypeChangeImpactCodeEnrollmentBehavior Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_ENROLLMENT_BEHAVIOR" + CodeRequestCatalogTypeChangeImpactCodeUnenrollmentBehavior Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_UNENROLLMENT_BEHAVIOR" + CodeRequestCatalogTypeChangeImpactCodeUnenrollmentEntitlementBehavior Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_UNENROLLMENT_ENTITLEMENT_BEHAVIOR" + CodeRequestCatalogTypeChangeImpactCodeMembershipRequestSchema Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_MEMBERSHIP_REQUEST_SCHEMA" + CodeRequestCatalogTypeChangeImpactCodeMembershipRequestDefaultsOverride Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_MEMBERSHIP_REQUEST_DEFAULTS_OVERRIDE" + CodeRequestCatalogTypeChangeImpactCodeBundleAutomation Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_BUNDLE_AUTOMATION" + CodeRequestCatalogTypeChangeImpactCodeMembershipEntitlementAutomation Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_MEMBERSHIP_ENTITLEMENT_AUTOMATION" + CodeRequestCatalogTypeChangeImpactCodeAutomationExclusions Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_AUTOMATION_EXCLUSIONS" + CodeRequestCatalogTypeChangeImpactCodeEnrolledMembers Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_ENROLLED_MEMBERS" + CodeRequestCatalogTypeChangeImpactCodeCatalogMembershipGrants Code = "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_CATALOG_MEMBERSHIP_GRANTS" +) + +func (e Code) ToPointer() *Code { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Code) IsExact() bool { + if e != nil { + switch *e { + case "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_UNSPECIFIED", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_SAME_TYPE", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_CURRENT_TYPE_UNSPECIFIED", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_CURRENT_TYPE_UNKNOWN", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_MEMBERSHIP_ENTITLEMENT_MISSING", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_PUBLISHED", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_VISIBLE_TO_EVERYONE", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_VISIBILITY_BINDINGS", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_REQUEST_BUNDLE", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_ENROLLMENT_BEHAVIOR", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_UNENROLLMENT_BEHAVIOR", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_UNENROLLMENT_ENTITLEMENT_BEHAVIOR", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_MEMBERSHIP_REQUEST_SCHEMA", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_MEMBERSHIP_REQUEST_DEFAULTS_OVERRIDE", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_BUNDLE_AUTOMATION", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_MEMBERSHIP_ENTITLEMENT_AUTOMATION", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_AUTOMATION_EXCLUSIONS", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_ENROLLED_MEMBERS", "REQUEST_CATALOG_TYPE_CHANGE_IMPACT_CODE_CATALOG_MEMBERSHIP_GRANTS": + return true + } + } + return false +} + +// RequestCatalogTypeChangeImpact - Stable machine-readable impact produced by access profile type planning. +type RequestCatalogTypeChangeImpact struct { + // How the target type treats the current state. + Category *Category `json:"category,omitempty"` + // Stable reason identifier for rendering, diagnostics, and tests. + Code *Code `json:"code,omitempty"` + // Number of affected objects. Zero means the impact describes one setting. + Count *int64 `integer:"string" json:"count,omitempty"` + // True when count reached the service safety bound and is a lower bound. + CountIsLowerBound *bool `json:"countIsLowerBound,omitempty"` + // Protobuf-style field path when the impact is caused by stored settings. + FieldPath *string `json:"fieldPath,omitempty"` + Ref *RequestCatalogTypeChangeImpactRef `json:"ref,omitempty"` +} + +func (r RequestCatalogTypeChangeImpact) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RequestCatalogTypeChangeImpact) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RequestCatalogTypeChangeImpact) GetCategory() *Category { + if r == nil { + return nil + } + return r.Category +} + +func (r *RequestCatalogTypeChangeImpact) GetCode() *Code { + if r == nil { + return nil + } + return r.Code +} + +func (r *RequestCatalogTypeChangeImpact) GetCount() *int64 { + if r == nil { + return nil + } + return r.Count +} + +func (r *RequestCatalogTypeChangeImpact) GetCountIsLowerBound() *bool { + if r == nil { + return nil + } + return r.CountIsLowerBound +} + +func (r *RequestCatalogTypeChangeImpact) GetFieldPath() *string { + if r == nil { + return nil + } + return r.FieldPath +} + +func (r *RequestCatalogTypeChangeImpact) GetRef() *RequestCatalogTypeChangeImpactRef { + if r == nil { + return nil + } + return r.Ref +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogtypechangeimpactref.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogtypechangeimpactref.go new file mode 100644 index 00000000..1d8adf6d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcatalogtypechangeimpactref.go @@ -0,0 +1,36 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// RequestCatalogTypeChangeImpactRef - Object associated with a type-change impact. +// +// This message contains a oneof named ref. Only a single field of the following list may be set at a time: +// - requestCatalog +// - appEntitlement +// - bundleAutomation +type RequestCatalogTypeChangeImpactRef struct { + AppEntitlement *AppEntitlementRef `json:"appEntitlement,omitempty"` + BundleAutomation *BundleAutomationRef `json:"bundleAutomation,omitempty"` + RequestCatalog *RequestCatalogRef `json:"requestCatalog,omitempty"` +} + +func (r *RequestCatalogTypeChangeImpactRef) GetAppEntitlement() *AppEntitlementRef { + if r == nil { + return nil + } + return r.AppEntitlement +} + +func (r *RequestCatalogTypeChangeImpactRef) GetBundleAutomation() *BundleAutomationRef { + if r == nil { + return nil + } + return r.BundleAutomation +} + +func (r *RequestCatalogTypeChangeImpactRef) GetRequestCatalog() *RequestCatalogRef { + if r == nil { + return nil + } + return r.RequestCatalog +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcreatedpreference.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcreatedpreference.go new file mode 100644 index 00000000..991310e7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestcreatedpreference.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The RequestCreatedPreference message. +type RequestCreatedPreference struct { + // The enabled field. + Enabled *bool `json:"enabled,omitempty"` + // The locked field. + Locked *bool `json:"locked,omitempty"` +} + +func (r *RequestCreatedPreference) GetEnabled() *bool { + if r == nil { + return nil + } + return r.Enabled +} + +func (r *RequestCreatedPreference) GetLocked() *bool { + if r == nil { + return nil + } + return r.Locked +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestsettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestsettings.go index a5b9ac61..809c7b7b 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestsettings.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/requestsettings.go @@ -4,11 +4,23 @@ package shared // RequestSettings holds tenant-wide configuration for the access-request flow. type RequestSettings struct { + // MaxBulkEntitlementSelection caps the number of entitlements a requester + // may select in a single bulk access request. Reads always return the + // effective value — an unset (0) value is presented as the system default of + // 10. Writing 0 resets the field to unset in storage. Maximum 100. + MaxBulkEntitlementSelection *int `json:"maxBulkEntitlementSelection,omitempty"` // When true, request surfaces (webapp, Slack, MS Teams) skip prompting the // requester for a justification. SkipJustification *bool `json:"skipJustification,omitempty"` } +func (r *RequestSettings) GetMaxBulkEntitlementSelection() *int { + if r == nil { + return nil + } + return r.MaxBulkEntitlementSelection +} + func (r *RequestSettings) GetSkipJustification() *bool { if r == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/revokegatewaykeyrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/revokegatewaykeyrequest.go new file mode 100644 index 00000000..c6546c46 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/revokegatewaykeyrequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The RevokeGatewayKeyRequest message. +type RevokeGatewayKeyRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/revokegatewaykeyresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/revokegatewaykeyresponse.go new file mode 100644 index 00000000..641d4027 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/revokegatewaykeyresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The RevokeGatewayKeyResponse message. +type RevokeGatewayKeyResponse struct { + GatewayKey *GatewayKey `json:"gatewayKey,omitempty"` +} + +func (r *RevokeGatewayKeyResponse) GetGatewayKey() *GatewayKey { + if r == nil { + return nil + } + return r.GatewayKey +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/rule.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/rule.go index 89efdd51..e82cdd67 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/rule.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/rule.go @@ -2,18 +2,41 @@ package shared -// Rule - A conditional routing rule that maps a CEL expression to a step sequence. +// Rule - A conditional routing rule that maps a CEL expression to an outcome. // -// Rules are evaluated top-to-bottom; the first matching rule's policy_key -// selects the step sequence from the policy's policy_steps map. If no rule -// matches, the baseline entry is used. +// Rules are evaluated top-to-bottom; the first matching rule's outcome +// determines which steps run. If the outcome is policy_key, the step sequence +// of that key in this policy's policy_steps map is used. If the outcome is +// policy_id, the referenced policy is evaluated recursively (depth-bounded, +// cycle-free, same policy_type). If no rule matches, the baseline entry of +// policy_steps is used. +// +// This message contains a oneof named outcome. Only a single field of the following list may be set at a time: +// - stepKey +// - policyId type Rule struct { // A CEL expression that is evaluated against the request context. If it - // returns true, the step sequence identified by policy_key is used. + // returns true, the step sequence identified by the outcome is used. Condition *string `json:"condition,omitempty"` - // A key into the policy's policy_steps map identifying which step sequence - // to execute when this rule's condition matches. + // The ID of another Policy that is evaluated recursively when this + // rule matches. The referenced policy must share this policy's + // policy_type, must not introduce a cycle, and must not push any + // reachable chain over depth 5. Gated by the + // POLICY_REFERENCES_POLICY feature flag. + // This field is part of the `outcome` oneof. + // See the documentation for `c1.api.policy.v1.Rule` for more details. + PolicyID *string `json:"policyId,omitempty"` + // Deprecated: prefer outcome.step_key. Still read by the request path + // for backward compatibility with rules persisted before the outcome + // oneof existed. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. PolicyKey *string `json:"policyKey,omitempty"` + // A key into the policy's policy_steps map identifying which step + // sequence to execute when this rule's condition matches. + // This field is part of the `outcome` oneof. + // See the documentation for `c1.api.policy.v1.Rule` for more details. + StepKey *string `json:"stepKey,omitempty"` } func (r *Rule) GetCondition() *string { @@ -23,9 +46,23 @@ func (r *Rule) GetCondition() *string { return r.Condition } +func (r *Rule) GetPolicyID() *string { + if r == nil { + return nil + } + return r.PolicyID +} + func (r *Rule) GetPolicyKey() *string { if r == nil { return nil } return r.PolicyKey } + +func (r *Rule) GetStepKey() *string { + if r == nil { + return nil + } + return r.StepKey +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/samlattributemapping.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/samlattributemapping.go new file mode 100644 index 00000000..ad467418 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/samlattributemapping.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The NameFormat attribute. +type NameFormat string + +const ( + NameFormatSamlAttributeNameFormatUnspecified NameFormat = "SAML_ATTRIBUTE_NAME_FORMAT_UNSPECIFIED" + NameFormatSamlAttributeNameFormatURI NameFormat = "SAML_ATTRIBUTE_NAME_FORMAT_URI" + NameFormatSamlAttributeNameFormatBasic NameFormat = "SAML_ATTRIBUTE_NAME_FORMAT_BASIC" + NameFormatSamlAttributeNameFormatUnspecifiedUrn NameFormat = "SAML_ATTRIBUTE_NAME_FORMAT_UNSPECIFIED_URN" +) + +func (e NameFormat) ToPointer() *NameFormat { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *NameFormat) IsExact() bool { + if e != nil { + switch *e { + case "SAML_ATTRIBUTE_NAME_FORMAT_UNSPECIFIED", "SAML_ATTRIBUTE_NAME_FORMAT_URI", "SAML_ATTRIBUTE_NAME_FORMAT_BASIC", "SAML_ATTRIBUTE_NAME_FORMAT_UNSPECIFIED_URN": + return true + } + } + return false +} + +// SAMLAttributeMapping releases one user attribute to the service provider +// +// as one Attribute in the assertion's AttributeStatement. +type SAMLAttributeMapping struct { + // Optional FriendlyName, for service providers that display it. + FriendlyName *string `json:"friendlyName,omitempty"` + // The Name attribute, dictated by the service provider. + Name string `json:"name"` + // The NameFormat attribute. + NameFormat *NameFormat `json:"nameFormat,omitempty"` + // The user attribute mapping that resolves the value, including its fallback + // chain. + UserAttributeMappingID string `json:"userAttributeMappingId"` +} + +func (s *SAMLAttributeMapping) GetFriendlyName() *string { + if s == nil { + return nil + } + return s.FriendlyName +} + +func (s *SAMLAttributeMapping) GetName() string { + if s == nil { + return "" + } + return s.Name +} + +func (s *SAMLAttributeMapping) GetNameFormat() *NameFormat { + if s == nil { + return nil + } + return s.NameFormat +} + +func (s *SAMLAttributeMapping) GetUserAttributeMappingID() string { + if s == nil { + return "" + } + return s.UserAttributeMappingID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/samlmetadatafinding.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/samlmetadatafinding.go new file mode 100644 index 00000000..f4658ea7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/samlmetadatafinding.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// Component - Where the finding fits in the parsed document. +type Component string + +const ( + ComponentComponentUnspecified Component = "COMPONENT_UNSPECIFIED" + ComponentComponentDocument Component = "COMPONENT_DOCUMENT" + ComponentComponentEntityID Component = "COMPONENT_ENTITY_ID" + ComponentComponentAcsURL Component = "COMPONENT_ACS_URL" + ComponentComponentNameIDFormat Component = "COMPONENT_NAME_ID_FORMAT" + ComponentComponentSigningCertificate Component = "COMPONENT_SIGNING_CERTIFICATE" + ComponentComponentEncryptionCertificate Component = "COMPONENT_ENCRYPTION_CERTIFICATE" + ComponentComponentRequirement Component = "COMPONENT_REQUIREMENT" + ComponentComponentBinding Component = "COMPONENT_BINDING" +) + +func (e Component) ToPointer() *Component { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Component) IsExact() bool { + if e != nil { + switch *e { + case "COMPONENT_UNSPECIFIED", "COMPONENT_DOCUMENT", "COMPONENT_ENTITY_ID", "COMPONENT_ACS_URL", "COMPONENT_NAME_ID_FORMAT", "COMPONENT_SIGNING_CERTIFICATE", "COMPONENT_ENCRYPTION_CERTIFICATE", "COMPONENT_REQUIREMENT", "COMPONENT_BINDING": + return true + } + } + return false +} + +// Level - The severity of this finding. +type Level string + +const ( + LevelLevelUnspecified Level = "LEVEL_UNSPECIFIED" + LevelLevelBlocking Level = "LEVEL_BLOCKING" + LevelLevelWarning Level = "LEVEL_WARNING" +) + +func (e Level) ToPointer() *Level { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Level) IsExact() bool { + if e != nil { + switch *e { + case "LEVEL_UNSPECIFIED", "LEVEL_BLOCKING", "LEVEL_WARNING": + return true + } + } + return false +} + +// SAMLMetadataFinding is one thing ConductorOne noticed while parsing a service +// +// provider's metadata document. +type SAMLMetadataFinding struct { + // Where the finding fits in the parsed document. + Component *Component `json:"component,omitempty"` + // The severity of this finding. + Level *Level `json:"level,omitempty"` + // Plain-language explanation of why the finding was raised. + Reason *string `json:"reason,omitempty"` +} + +func (s *SAMLMetadataFinding) GetComponent() *Component { + if s == nil { + return nil + } + return s.Component +} + +func (s *SAMLMetadataFinding) GetLevel() *Level { + if s == nil { + return nil + } + return s.Level +} + +func (s *SAMLMetadataFinding) GetReason() *string { + if s == nil { + return nil + } + return s.Reason +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/screenshot.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/screenshot.go new file mode 100644 index 00000000..4fe1a14c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/screenshot.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// ScreenshotKind - The kind field. +type ScreenshotKind string + +const ( + ScreenshotKindKindUnspecified ScreenshotKind = "KIND_UNSPECIFIED" + ScreenshotKindKindScreen ScreenshotKind = "KIND_SCREEN" + ScreenshotKindKindRegion ScreenshotKind = "KIND_REGION" + ScreenshotKindKindUpload ScreenshotKind = "KIND_UPLOAD" +) + +func (e ScreenshotKind) ToPointer() *ScreenshotKind { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ScreenshotKind) IsExact() bool { + if e != nil { + switch *e { + case "KIND_UNSPECIFIED", "KIND_SCREEN", "KIND_REGION", "KIND_UPLOAD": + return true + } + } + return false +} + +// The Screenshot message. +type Screenshot struct { + // The contentType field. + ContentType *string `json:"contentType,omitempty"` + // The data field. + Data *string `json:"data,omitempty"` + // The kind field. + Kind *ScreenshotKind `json:"kind,omitempty"` + // Parameterized route the shot was taken on — never a raw URL. Optional. + Route *string `json:"route,omitempty"` +} + +func (s *Screenshot) GetContentType() *string { + if s == nil { + return nil + } + return s.ContentType +} + +func (s *Screenshot) GetData() *string { + if s == nil { + return nil + } + return s.Data +} + +func (s *Screenshot) GetKind() *ScreenshotKind { + if s == nil { + return nil + } + return s.Kind +} + +func (s *Screenshot) GetRoute() *string { + if s == nil { + return nil + } + return s.Route +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchappresourcesrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchappresourcesrequest.go index 6fb0136d..7dc0e9f7 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchappresourcesrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchappresourcesrequest.go @@ -2,21 +2,21 @@ package shared -type AgentStatuses string +type SearchAppResourcesRequestAgentStatuses string const ( - AgentStatusesAgentStatusUnspecified AgentStatuses = "AGENT_STATUS_UNSPECIFIED" - AgentStatusesAgentStatusReady AgentStatuses = "AGENT_STATUS_READY" - AgentStatusesAgentStatusDisabled AgentStatuses = "AGENT_STATUS_DISABLED" - AgentStatusesAgentStatusDeleted AgentStatuses = "AGENT_STATUS_DELETED" + SearchAppResourcesRequestAgentStatusesAgentStatusUnspecified SearchAppResourcesRequestAgentStatuses = "AGENT_STATUS_UNSPECIFIED" + SearchAppResourcesRequestAgentStatusesAgentStatusReady SearchAppResourcesRequestAgentStatuses = "AGENT_STATUS_READY" + SearchAppResourcesRequestAgentStatusesAgentStatusDisabled SearchAppResourcesRequestAgentStatuses = "AGENT_STATUS_DISABLED" + SearchAppResourcesRequestAgentStatusesAgentStatusDeleted SearchAppResourcesRequestAgentStatuses = "AGENT_STATUS_DELETED" ) -func (e AgentStatuses) ToPointer() *AgentStatuses { +func (e SearchAppResourcesRequestAgentStatuses) ToPointer() *SearchAppResourcesRequestAgentStatuses { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *AgentStatuses) IsExact() bool { +func (e *SearchAppResourcesRequestAgentStatuses) IsExact() bool { if e != nil { switch *e { case "AGENT_STATUS_UNSPECIFIED", "AGENT_STATUS_READY", "AGENT_STATUS_DISABLED", "AGENT_STATUS_DELETED": @@ -133,7 +133,7 @@ type SearchAppResourcesRequest struct { // Restrict the search to AI-agent resources with one of the given agent // lifecycle statuses (READY, DISABLED, DELETED). When empty, agent status is // not used as a filter. - AgentStatuses []AgentStatuses `json:"agentStatuses,omitempty"` + AgentStatuses []SearchAppResourcesRequestAgentStatuses `json:"agentStatuses,omitempty"` // The app ID to restrict the search to. AppID *string `json:"appId,omitempty"` // A list of app IDs to restrict the search to. Mirrors the singular app_id; @@ -193,7 +193,7 @@ type SearchAppResourcesRequest struct { WithOpenFindings *bool `json:"withOpenFindings,omitempty"` } -func (s *SearchAppResourcesRequest) GetAgentStatuses() []AgentStatuses { +func (s *SearchAppResourcesRequest) GetAgentStatuses() []SearchAppResourcesRequestAgentStatuses { if s == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchcohortusersrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchcohortusersrequest.go index 5f5c55ca..e9412087 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchcohortusersrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchcohortusersrequest.go @@ -10,7 +10,10 @@ type SearchCohortUsersRequest struct { PageToken *string `json:"pageToken,omitempty"` // Additional profile filters to narrow the cohort user search. ProfileFilters []ProfileFilter `json:"profileFilters,omitempty"` - // Optional list of entitlements to compute per-user coverage for. + // Deprecated. This endpoint no longer computes per-user coverage and + // ignores this field. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. SelectedEntitlements []EntitlementRef `json:"selectedEntitlements,omitempty"` } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchcohortusersresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchcohortusersresponse.go index a489307c..0717b99a 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchcohortusersresponse.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchcohortusersresponse.go @@ -8,7 +8,10 @@ type SearchCohortUsersResponse struct { List []User `json:"list,omitempty"` // Token to retrieve the next page of results, empty if no more results. NextPageToken *string `json:"nextPageToken,omitempty"` - // Per-user coverage counts, populated when selected_entitlements is non-empty. + // Deprecated. This endpoint no longer computes per-user coverage; this + // list is always empty. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. UsersWithCoverage []CohortUserWithCoverage `json:"usersWithCoverage,omitempty"` } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchpoliciesrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchpoliciesrequest.go index beed0626..1d8f3823 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchpoliciesrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchpoliciesrequest.go @@ -28,6 +28,87 @@ func (e *PolicyTypes) IsExact() bool { return false } +// ScopeObjectType - When scope_view is POLICY_SCOPE_VIEW_SCOPED, narrow local policies to a +// +// coarse object type (app-local vs entitlement-local). +type ScopeObjectType string + +const ( + ScopeObjectTypePolicyScopeObjectTypeUnspecified ScopeObjectType = "POLICY_SCOPE_OBJECT_TYPE_UNSPECIFIED" + ScopeObjectTypePolicyScopeObjectTypeApp ScopeObjectType = "POLICY_SCOPE_OBJECT_TYPE_APP" + ScopeObjectTypePolicyScopeObjectTypeEntitlement ScopeObjectType = "POLICY_SCOPE_OBJECT_TYPE_ENTITLEMENT" +) + +func (e ScopeObjectType) ToPointer() *ScopeObjectType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ScopeObjectType) IsExact() bool { + if e != nil { + switch *e { + case "POLICY_SCOPE_OBJECT_TYPE_UNSPECIFIED", "POLICY_SCOPE_OBJECT_TYPE_APP", "POLICY_SCOPE_OBJECT_TYPE_ENTITLEMENT": + return true + } + } + return false +} + +// ScopeSlot - When scope_view narrows to one object, only return that object's local +// +// policies in this slot. Ignored when no object is identified by +// scope_app_id, which lists every local policy regardless of slot. +type ScopeSlot string + +const ( + ScopeSlotPolicyScopeSlotUnspecified ScopeSlot = "POLICY_SCOPE_SLOT_UNSPECIFIED" + ScopeSlotPolicyScopeSlotEmergency ScopeSlot = "POLICY_SCOPE_SLOT_EMERGENCY" +) + +func (e ScopeSlot) ToPointer() *ScopeSlot { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ScopeSlot) IsExact() bool { + if e != nil { + switch *e { + case "POLICY_SCOPE_SLOT_UNSPECIFIED", "POLICY_SCOPE_SLOT_EMERGENCY": + return true + } + } + return false +} + +// ScopeView - Which policies to return based on scope. Defaults to global-only, so +// +// app/entitlement-scoped policies never appear unless explicitly requested. +// Ignored when refs are provided (explicit ID lookups always resolve). +type ScopeView string + +const ( + ScopeViewPolicyScopeViewUnspecified ScopeView = "POLICY_SCOPE_VIEW_UNSPECIFIED" + ScopeViewPolicyScopeViewGlobal ScopeView = "POLICY_SCOPE_VIEW_GLOBAL" + ScopeViewPolicyScopeViewScoped ScopeView = "POLICY_SCOPE_VIEW_SCOPED" + ScopeViewPolicyScopeViewAll ScopeView = "POLICY_SCOPE_VIEW_ALL" + ScopeViewPolicyScopeViewGlobalAndObject ScopeView = "POLICY_SCOPE_VIEW_GLOBAL_AND_OBJECT" +) + +func (e ScopeView) ToPointer() *ScopeView { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ScopeView) IsExact() bool { + if e != nil { + switch *e { + case "POLICY_SCOPE_VIEW_UNSPECIFIED", "POLICY_SCOPE_VIEW_GLOBAL", "POLICY_SCOPE_VIEW_SCOPED", "POLICY_SCOPE_VIEW_ALL", "POLICY_SCOPE_VIEW_GLOBAL_AND_OBJECT": + return true + } + } + return false +} + // SearchPoliciesRequest - Search Policies by a few properties. type SearchPoliciesRequest struct { // Search for policies with a case insensitive match on the display name. @@ -46,6 +127,23 @@ type SearchPoliciesRequest struct { Query *string `json:"query,omitempty"` // The refs field. Refs []PolicyRef `json:"refs,omitempty"` + // When scope_view is POLICY_SCOPE_VIEW_SCOPED, only return policies scoped + // to this entitlement. + ScopeAppEntitlementID *string `json:"scopeAppEntitlementId,omitempty"` + // When scope_view is POLICY_SCOPE_VIEW_SCOPED, only return policies scoped + // to this app. + ScopeAppID *string `json:"scopeAppId,omitempty"` + // When scope_view is POLICY_SCOPE_VIEW_SCOPED, narrow local policies to a + // coarse object type (app-local vs entitlement-local). + ScopeObjectType *ScopeObjectType `json:"scopeObjectType,omitempty"` + // When scope_view narrows to one object, only return that object's local + // policies in this slot. Ignored when no object is identified by + // scope_app_id, which lists every local policy regardless of slot. + ScopeSlot *ScopeSlot `json:"scopeSlot,omitempty"` + // Which policies to return based on scope. Defaults to global-only, so + // app/entitlement-scoped policies never appear unless explicitly requested. + // Ignored when refs are provided (explicit ID lookups always resolve). + ScopeView *ScopeView `json:"scopeView,omitempty"` } func (s *SearchPoliciesRequest) GetDisplayName() *string { @@ -103,3 +201,38 @@ func (s *SearchPoliciesRequest) GetRefs() []PolicyRef { } return s.Refs } + +func (s *SearchPoliciesRequest) GetScopeAppEntitlementID() *string { + if s == nil { + return nil + } + return s.ScopeAppEntitlementID +} + +func (s *SearchPoliciesRequest) GetScopeAppID() *string { + if s == nil { + return nil + } + return s.ScopeAppID +} + +func (s *SearchPoliciesRequest) GetScopeObjectType() *ScopeObjectType { + if s == nil { + return nil + } + return s.ScopeObjectType +} + +func (s *SearchPoliciesRequest) GetScopeSlot() *ScopeSlot { + if s == nil { + return nil + } + return s.ScopeSlot +} + +func (s *SearchPoliciesRequest) GetScopeView() *ScopeView { + if s == nil { + return nil + } + return s.ScopeView +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchstepuptransactionsrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchstepuptransactionsrequest.go index 5bc332df..492eb16a 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchstepuptransactionsrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchstepuptransactionsrequest.go @@ -32,21 +32,21 @@ func (e *SearchStepUpTransactionsRequestState) IsExact() bool { return false } -// TargetType - The targetType field. -type TargetType string +// SearchStepUpTransactionsRequestTargetType - The targetType field. +type SearchStepUpTransactionsRequestTargetType string const ( - TargetTypeTargetTypeUnspecified TargetType = "TARGET_TYPE_UNSPECIFIED" - TargetTypeTargetTypeTicket TargetType = "TARGET_TYPE_TICKET" - TargetTypeTargetTypeTest TargetType = "TARGET_TYPE_TEST" + SearchStepUpTransactionsRequestTargetTypeTargetTypeUnspecified SearchStepUpTransactionsRequestTargetType = "TARGET_TYPE_UNSPECIFIED" + SearchStepUpTransactionsRequestTargetTypeTargetTypeTicket SearchStepUpTransactionsRequestTargetType = "TARGET_TYPE_TICKET" + SearchStepUpTransactionsRequestTargetTypeTargetTypeTest SearchStepUpTransactionsRequestTargetType = "TARGET_TYPE_TEST" ) -func (e TargetType) ToPointer() *TargetType { +func (e SearchStepUpTransactionsRequestTargetType) ToPointer() *SearchStepUpTransactionsRequestTargetType { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *TargetType) IsExact() bool { +func (e *SearchStepUpTransactionsRequestTargetType) IsExact() bool { if e != nil { switch *e { case "TARGET_TYPE_UNSPECIFIED", "TARGET_TYPE_TICKET", "TARGET_TYPE_TEST": @@ -69,7 +69,7 @@ type SearchStepUpTransactionsRequest struct { // Filter by transaction state State *SearchStepUpTransactionsRequestState `json:"state,omitempty"` // The targetType field. - TargetType *TargetType `json:"targetType,omitempty"` + TargetType *SearchStepUpTransactionsRequestTargetType `json:"targetType,omitempty"` // Filter by task ID (only applicable if target_type is TICKET) TaskID *string `json:"taskId,omitempty"` // Filter by user ID @@ -129,7 +129,7 @@ func (s *SearchStepUpTransactionsRequest) GetState() *SearchStepUpTransactionsRe return s.State } -func (s *SearchStepUpTransactionsRequest) GetTargetType() *TargetType { +func (s *SearchStepUpTransactionsRequest) GetTargetType() *SearchStepUpTransactionsRequestTargetType { if s == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchusersrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchusersrequest.go index cdbfc9d0..0d8baf1c 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchusersrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/searchusersrequest.go @@ -160,6 +160,10 @@ type SearchUsersRequest struct { Refs []UserRef `json:"refs,omitempty"` // Search for users that have any of the role IDs on this list. RoleIds []string `json:"roleIds,omitempty"` + // Filter to include only users sourced from any of these apps (directories). + // Each value is an app ID; a user matches when its source_app_ids map + // contains any of the listed app IDs. Combined with `origins` using OR. + SourceAppIds []string `json:"sourceAppIds,omitempty"` // Search for users that have any of the statuses on this list. This can only be ENABLED, DISABLED, and DELETED UserStatuses []SearchUsersRequestUserStatuses `json:"userStatuses,omitempty"` } @@ -290,6 +294,13 @@ func (s *SearchUsersRequest) GetRoleIds() []string { return s.RoleIds } +func (s *SearchUsersRequest) GetSourceAppIds() []string { + if s == nil { + return nil + } + return s.SourceAppIds +} + func (s *SearchUsersRequest) GetUserStatuses() []SearchUsersRequestUserStatuses { if s == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/secretsmaskingconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/secretsmaskingconfig.go new file mode 100644 index 00000000..42c00d85 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/secretsmaskingconfig.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SecretsMaskingConfig configures post-tool-use redaction of secret-shaped +// +// substrings (API keys, tokens, private keys) in tool output. +type SecretsMaskingConfig struct { + // Extra RE2 regexes whose matches are redacted in addition to the built-in + // secret patterns. + AdditionalPatterns []string `json:"additionalPatterns,omitempty"` + // Replacement string for a matched secret. Empty = "***REDACTED-SECRET***". + Placeholder *string `json:"placeholder,omitempty"` +} + +func (s *SecretsMaskingConfig) GetAdditionalPatterns() []string { + if s == nil { + return nil + } + return s.AdditionalPatterns +} + +func (s *SecretsMaskingConfig) GetPlaceholder() *string { + if s == nil { + return nil + } + return s.Placeholder +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicegeteffectivesessionpolicyresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicegeteffectivesessionpolicyresponse.go new file mode 100644 index 00000000..c664fb87 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicegeteffectivesessionpolicyresponse.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SessionPolicyServiceGetEffectiveSessionPolicyResponseSource - Why the policy applies. +type SessionPolicyServiceGetEffectiveSessionPolicyResponseSource string + +const ( + SessionPolicyServiceGetEffectiveSessionPolicyResponseSourceEffectiveSessionPolicySourceUnspecified SessionPolicyServiceGetEffectiveSessionPolicyResponseSource = "EFFECTIVE_SESSION_POLICY_SOURCE_UNSPECIFIED" + SessionPolicyServiceGetEffectiveSessionPolicyResponseSourceEffectiveSessionPolicySourceDirect SessionPolicyServiceGetEffectiveSessionPolicyResponseSource = "EFFECTIVE_SESSION_POLICY_SOURCE_DIRECT" + SessionPolicyServiceGetEffectiveSessionPolicyResponseSourceEffectiveSessionPolicySourceGroup SessionPolicyServiceGetEffectiveSessionPolicyResponseSource = "EFFECTIVE_SESSION_POLICY_SOURCE_GROUP" + SessionPolicyServiceGetEffectiveSessionPolicyResponseSourceEffectiveSessionPolicySourceTenantDefault SessionPolicyServiceGetEffectiveSessionPolicyResponseSource = "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT" + SessionPolicyServiceGetEffectiveSessionPolicyResponseSourceEffectiveSessionPolicySourceTenantDefaultNone SessionPolicyServiceGetEffectiveSessionPolicyResponseSource = "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT_NONE" +) + +func (e SessionPolicyServiceGetEffectiveSessionPolicyResponseSource) ToPointer() *SessionPolicyServiceGetEffectiveSessionPolicyResponseSource { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SessionPolicyServiceGetEffectiveSessionPolicyResponseSource) IsExact() bool { + if e != nil { + switch *e { + case "EFFECTIVE_SESSION_POLICY_SOURCE_UNSPECIFIED", "EFFECTIVE_SESSION_POLICY_SOURCE_DIRECT", "EFFECTIVE_SESSION_POLICY_SOURCE_GROUP", "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT", "EFFECTIVE_SESSION_POLICY_SOURCE_TENANT_DEFAULT_NONE": + return true + } + } + return false +} + +// SessionPolicyServiceGetEffectiveSessionPolicyResponse carries the effective +// +// policy and why it applies. +type SessionPolicyServiceGetEffectiveSessionPolicyResponse struct { + Group *AppEntitlement `json:"group,omitempty"` + SessionPolicy *SessionPolicy `json:"sessionPolicy,omitempty"` + // Why the policy applies. + Source *SessionPolicyServiceGetEffectiveSessionPolicyResponseSource `json:"source,omitempty"` +} + +func (s *SessionPolicyServiceGetEffectiveSessionPolicyResponse) GetGroup() *AppEntitlement { + if s == nil { + return nil + } + return s.Group +} + +func (s *SessionPolicyServiceGetEffectiveSessionPolicyResponse) GetSessionPolicy() *SessionPolicy { + if s == nil { + return nil + } + return s.SessionPolicy +} + +func (s *SessionPolicyServiceGetEffectiveSessionPolicyResponse) GetSource() *SessionPolicyServiceGetEffectiveSessionPolicyResponseSource { + if s == nil { + return nil + } + return s.Source +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicelistuserpoliciesresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicelistuserpoliciesresponse.go new file mode 100644 index 00000000..feadbc1b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicelistuserpoliciesresponse.go @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SessionPolicyServiceListUserPoliciesResponse carries every policy that +// +// applies to the user. Unpaginated: the candidate set is the user's assigned +// policies plus at most one tenant default. +type SessionPolicyServiceListUserPoliciesResponse struct { + // Every policy that applies to the user, in assignment order. + Policies []EffectiveUserPolicy `json:"policies,omitempty"` +} + +func (s *SessionPolicyServiceListUserPoliciesResponse) GetPolicies() []EffectiveUserPolicy { + if s == nil { + return nil + } + return s.Policies +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicesearchpolicyusersrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicesearchpolicyusersrequest.go new file mode 100644 index 00000000..198f7678 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicesearchpolicyusersrequest.go @@ -0,0 +1,76 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SessionPolicyServiceSearchPolicyUsersRequestSource - When set, restrict results to this source. UNSPECIFIED returns all users. +type SessionPolicyServiceSearchPolicyUsersRequestSource string + +const ( + SessionPolicyServiceSearchPolicyUsersRequestSourceEffectiveSessionPolicySourceFilterUnspecified SessionPolicyServiceSearchPolicyUsersRequestSource = "EFFECTIVE_SESSION_POLICY_SOURCE_FILTER_UNSPECIFIED" + SessionPolicyServiceSearchPolicyUsersRequestSourceEffectiveSessionPolicySourceFilterDirect SessionPolicyServiceSearchPolicyUsersRequestSource = "EFFECTIVE_SESSION_POLICY_SOURCE_FILTER_DIRECT" + SessionPolicyServiceSearchPolicyUsersRequestSourceEffectiveSessionPolicySourceFilterGroup SessionPolicyServiceSearchPolicyUsersRequestSource = "EFFECTIVE_SESSION_POLICY_SOURCE_FILTER_GROUP" +) + +func (e SessionPolicyServiceSearchPolicyUsersRequestSource) ToPointer() *SessionPolicyServiceSearchPolicyUsersRequestSource { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SessionPolicyServiceSearchPolicyUsersRequestSource) IsExact() bool { + if e != nil { + switch *e { + case "EFFECTIVE_SESSION_POLICY_SOURCE_FILTER_UNSPECIFIED", "EFFECTIVE_SESSION_POLICY_SOURCE_FILTER_DIRECT", "EFFECTIVE_SESSION_POLICY_SOURCE_FILTER_GROUP": + return true + } + } + return false +} + +// SessionPolicyServiceSearchPolicyUsersRequest searches the users a policy +// +// applies to, one page at a time. This read is served from the +// asynchronously-replicated Postgres mirror of the binding store, so a +// just-made assignment may not appear immediately; the user-scoped reads +// (GetEffectiveSessionPolicy, ListUserPolicies) reflect current state. +type SessionPolicyServiceSearchPolicyUsersRequest struct { + // The maximum number of users to return per page. The server clamps this + // to its own bounds (currently 5..100). Always follow next_page_token to + // complete the search. + PageSize *int `json:"pageSize,omitempty"` + // The page token from the previous response. + PageToken *string `json:"pageToken,omitempty"` + // Fuzzy search on user display name and email. Empty matches all users + // the policy applies to. Applied in the query together with the source + // facet, so pages carry only matching rows. + Query *string `json:"query,omitempty"` + // When set, restrict results to this source. UNSPECIFIED returns all users. + Source *SessionPolicyServiceSearchPolicyUsersRequestSource `json:"source,omitempty"` +} + +func (s *SessionPolicyServiceSearchPolicyUsersRequest) GetPageSize() *int { + if s == nil { + return nil + } + return s.PageSize +} + +func (s *SessionPolicyServiceSearchPolicyUsersRequest) GetPageToken() *string { + if s == nil { + return nil + } + return s.PageToken +} + +func (s *SessionPolicyServiceSearchPolicyUsersRequest) GetQuery() *string { + if s == nil { + return nil + } + return s.Query +} + +func (s *SessionPolicyServiceSearchPolicyUsersRequest) GetSource() *SessionPolicyServiceSearchPolicyUsersRequestSource { + if s == nil { + return nil + } + return s.Source +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicesearchpolicyusersresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicesearchpolicyusersresponse.go new file mode 100644 index 00000000..62081d9d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicyservicesearchpolicyusersresponse.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SessionPolicyServiceSearchPolicyUsersResponse carries one page of the users +// +// a policy applies to. +type SessionPolicyServiceSearchPolicyUsersResponse struct { + // The token for the next page. Empty when this is the last page. + NextPageToken *string `json:"nextPageToken,omitempty"` + // The users on this page. + Users []PolicyUser `json:"users,omitempty"` +} + +func (s *SessionPolicyServiceSearchPolicyUsersResponse) GetNextPageToken() *string { + if s == nil { + return nil + } + return s.NextPageToken +} + +func (s *SessionPolicyServiceSearchPolicyUsersResponse) GetUsers() []PolicyUser { + if s == nil { + return nil + } + return s.Users +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicystepuprequired.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicystepuprequired.go index c14f88c3..90941adf 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicystepuprequired.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/sessionpolicystepuprequired.go @@ -2,24 +2,24 @@ package shared -// Level - The level field. -type Level string +// SessionPolicyStepUpRequiredLevel - The level field. +type SessionPolicyStepUpRequiredLevel string const ( - LevelAuthLevelUnspecified Level = "AUTH_LEVEL_UNSPECIFIED" - LevelAuthLevelNone Level = "AUTH_LEVEL_NONE" - LevelAuthLevelSingleFactor Level = "AUTH_LEVEL_SINGLE_FACTOR" - LevelAuthLevelMultiFactor Level = "AUTH_LEVEL_MULTI_FACTOR" - LevelAuthLevelPhr Level = "AUTH_LEVEL_PHR" - LevelAuthLevelPhrh Level = "AUTH_LEVEL_PHRH" + SessionPolicyStepUpRequiredLevelAuthLevelUnspecified SessionPolicyStepUpRequiredLevel = "AUTH_LEVEL_UNSPECIFIED" + SessionPolicyStepUpRequiredLevelAuthLevelNone SessionPolicyStepUpRequiredLevel = "AUTH_LEVEL_NONE" + SessionPolicyStepUpRequiredLevelAuthLevelSingleFactor SessionPolicyStepUpRequiredLevel = "AUTH_LEVEL_SINGLE_FACTOR" + SessionPolicyStepUpRequiredLevelAuthLevelMultiFactor SessionPolicyStepUpRequiredLevel = "AUTH_LEVEL_MULTI_FACTOR" + SessionPolicyStepUpRequiredLevelAuthLevelPhr SessionPolicyStepUpRequiredLevel = "AUTH_LEVEL_PHR" + SessionPolicyStepUpRequiredLevelAuthLevelPhrh SessionPolicyStepUpRequiredLevel = "AUTH_LEVEL_PHRH" ) -func (e Level) ToPointer() *Level { +func (e SessionPolicyStepUpRequiredLevel) ToPointer() *SessionPolicyStepUpRequiredLevel { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Level) IsExact() bool { +func (e *SessionPolicyStepUpRequiredLevel) IsExact() bool { if e != nil { switch *e { case "AUTH_LEVEL_UNSPECIFIED", "AUTH_LEVEL_NONE", "AUTH_LEVEL_SINGLE_FACTOR", "AUTH_LEVEL_MULTI_FACTOR", "AUTH_LEVEL_PHR", "AUTH_LEVEL_PHRH": @@ -63,14 +63,14 @@ func (e *SessionPolicyStepUpRequiredTypes) IsExact() bool { // continue. type SessionPolicyStepUpRequired struct { // The level field. - Level *Level `json:"level,omitempty"` + Level *SessionPolicyStepUpRequiredLevel `json:"level,omitempty"` // How fresh the step-up must be, in seconds. MaxAgeSeconds *int `json:"maxAgeSeconds,omitempty"` // The types field. Types []SessionPolicyStepUpRequiredTypes `json:"types,omitempty"` } -func (s *SessionPolicyStepUpRequired) GetLevel() *Level { +func (s *SessionPolicyStepUpRequired) GetLevel() *SessionPolicyStepUpRequiredLevel { if s == nil { return nil } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/setprovidercredentialrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/setprovidercredentialrequest.go new file mode 100644 index 00000000..1901932d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/setprovidercredentialrequest.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SetProviderCredentialRequestHeaderStyle - The headerStyle field. +type SetProviderCredentialRequestHeaderStyle string + +const ( + SetProviderCredentialRequestHeaderStyleProviderCredentialHeaderStyleUnspecified SetProviderCredentialRequestHeaderStyle = "PROVIDER_CREDENTIAL_HEADER_STYLE_UNSPECIFIED" + SetProviderCredentialRequestHeaderStyleProviderCredentialHeaderStyleXAPIKey SetProviderCredentialRequestHeaderStyle = "PROVIDER_CREDENTIAL_HEADER_STYLE_X_API_KEY" + SetProviderCredentialRequestHeaderStyleProviderCredentialHeaderStyleAuthorizationBearer SetProviderCredentialRequestHeaderStyle = "PROVIDER_CREDENTIAL_HEADER_STYLE_AUTHORIZATION_BEARER" +) + +func (e SetProviderCredentialRequestHeaderStyle) ToPointer() *SetProviderCredentialRequestHeaderStyle { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SetProviderCredentialRequestHeaderStyle) IsExact() bool { + if e != nil { + switch *e { + case "PROVIDER_CREDENTIAL_HEADER_STYLE_UNSPECIFIED", "PROVIDER_CREDENTIAL_HEADER_STYLE_X_API_KEY", "PROVIDER_CREDENTIAL_HEADER_STYLE_AUTHORIZATION_BEARER": + return true + } + } + return false +} + +// The SetProviderCredentialRequest message. +type SetProviderCredentialRequest struct { + // The apiKey field. + APIKey *string `json:"apiKey,omitempty"` + // The displayName field. + DisplayName *string `json:"displayName,omitempty"` + // The headerStyle field. + HeaderStyle *SetProviderCredentialRequestHeaderStyle `json:"headerStyle,omitempty"` +} + +func (s *SetProviderCredentialRequest) GetAPIKey() *string { + if s == nil { + return nil + } + return s.APIKey +} + +func (s *SetProviderCredentialRequest) GetDisplayName() *string { + if s == nil { + return nil + } + return s.DisplayName +} + +func (s *SetProviderCredentialRequest) GetHeaderStyle() *SetProviderCredentialRequestHeaderStyle { + if s == nil { + return nil + } + return s.HeaderStyle +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/setprovidercredentialresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/setprovidercredentialresponse.go new file mode 100644 index 00000000..3ea5b518 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/setprovidercredentialresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SetProviderCredentialResponse message. +type SetProviderCredentialResponse struct { + Credential *ProviderCredential `json:"credential,omitempty"` +} + +func (s *SetProviderCredentialResponse) GetCredential() *ProviderCredential { + if s == nil { + return nil + } + return s.Credential +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/shadowmcpevidence.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/shadowmcpevidence.go new file mode 100644 index 00000000..0c853b98 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/shadowmcpevidence.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// ShadowMcpEvidence carries counts only -- occurrence detail (which users, +// +// devices, harnesses) is resolved dynamically, not stored here. +type ShadowMcpEvidence struct { + // Distinct devices observed running the product outside the governed gateway. + DeviceCount *int64 `json:"deviceCount,omitempty"` + // Distinct users observed running the product outside the governed gateway. + UserCount *int64 `json:"userCount,omitempty"` +} + +func (s *ShadowMcpEvidence) GetDeviceCount() *int64 { + if s == nil { + return nil + } + return s.DeviceCount +} + +func (s *ShadowMcpEvidence) GetUserCount() *int64 { + if s == nil { + return nil + } + return s.UserCount +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/shadowmcptype.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/shadowmcptype.go new file mode 100644 index 00000000..e2e7eab1 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/shadowmcptype.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// ShadowMcpType - ShadowMcpType: a device is running an MCP server that isn't reached through +// +// the tenant's governed MCP gateway. Dedup is mcp_identifier -- one finding +// per tenant per distinct MCP product, regardless of how many +// users/devices/harnesses run it. Target: TenantTarget. +type ShadowMcpType struct { + // Stable identity of the MCP product, shared across every user/device/harness + // that runs it. Maps to DeviceInventoryMcpObservation.logical_product_key; + // display name is resolved from there, not duplicated here. + McpIdentifier *string `json:"mcpIdentifier,omitempty"` +} + +func (s *ShadowMcpType) GetMcpIdentifier() *string { + if s == nil { + return nil + } + return s.McpIdentifier +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/slackchannelsettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/slackchannelsettings.go index c4040e72..aeb70815 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/slackchannelsettings.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/slackchannelsettings.go @@ -16,7 +16,9 @@ type SlackChannelSettings struct { // The isConfigured field. IsConfigured *bool `json:"isConfigured,omitempty"` ProvisioningRequest *ProvisioningRequestPreference `json:"provisioningRequest,omitempty"` + RequestCreated *RequestCreatedPreference `json:"requestCreated,omitempty"` Reviews *ReviewsPreference `json:"reviews,omitempty"` + System *SystemPreference `json:"system,omitempty"` TaskReminders *TaskRemindersPreference `json:"taskReminders,omitempty"` } @@ -90,6 +92,13 @@ func (s *SlackChannelSettings) GetProvisioningRequest() *ProvisioningRequestPref return s.ProvisioningRequest } +func (s *SlackChannelSettings) GetRequestCreated() *RequestCreatedPreference { + if s == nil { + return nil + } + return s.RequestCreated +} + func (s *SlackChannelSettings) GetReviews() *ReviewsPreference { if s == nil { return nil @@ -97,6 +106,13 @@ func (s *SlackChannelSettings) GetReviews() *ReviewsPreference { return s.Reviews } +func (s *SlackChannelSettings) GetSystem() *SystemPreference { + if s == nil { + return nil + } + return s.System +} + func (s *SlackChannelSettings) GetTaskReminders() *TaskRemindersPreference { if s == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/slackchanneltarget.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/slackchanneltarget.go new file mode 100644 index 00000000..9bcc85b0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/slackchanneltarget.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SlackChannelTarget names one Slack channel. Exactly one of channel_name / +// +// channel_id is set; a name is resolved at send time, so an unresolvable name +// fails the dispatch rather than the rule edit. +type SlackChannelTarget struct { + // The channelId field. + ChannelID *string `json:"channelId,omitempty"` + // The channelName field. + ChannelName *string `json:"channelName,omitempty"` +} + +func (s *SlackChannelTarget) GetChannelID() *string { + if s == nil { + return nil + } + return s.ChannelID +} + +func (s *SlackChannelTarget) GetChannelName() *string { + if s == nil { + return nil + } + return s.ChannelName +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendcontrols.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendcontrols.go new file mode 100644 index 00000000..e1310549 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendcontrols.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SpendControlsPeriod - Only valid together with limit: a period without its amount would +// +// reinterpret some other layer's number in a cadence that layer never +// agreed to. +type SpendControlsPeriod string + +const ( + SpendControlsPeriodPeriodKindUnspecified SpendControlsPeriod = "PERIOD_KIND_UNSPECIFIED" + SpendControlsPeriodPeriodKindDaily SpendControlsPeriod = "PERIOD_KIND_DAILY" + SpendControlsPeriodPeriodKindWeekly SpendControlsPeriod = "PERIOD_KIND_WEEKLY" + SpendControlsPeriodPeriodKindMonthly SpendControlsPeriod = "PERIOD_KIND_MONTHLY" + SpendControlsPeriodPeriodKindQuarterly SpendControlsPeriod = "PERIOD_KIND_QUARTERLY" + SpendControlsPeriodPeriodKindYearly SpendControlsPeriod = "PERIOD_KIND_YEARLY" +) + +func (e SpendControlsPeriod) ToPointer() *SpendControlsPeriod { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SpendControlsPeriod) IsExact() bool { + if e != nil { + switch *e { + case "PERIOD_KIND_UNSPECIFIED", "PERIOD_KIND_DAILY", "PERIOD_KIND_WEEKLY", "PERIOD_KIND_MONTHLY", "PERIOD_KIND_QUARTERLY", "PERIOD_KIND_YEARLY": + return true + } + } + return false +} + +// SpendControls is the one control shape carried by every authority scope. +// +// Per-row resolution, identical everywhere: suspension present -> deny; +// unexpired extension -> extension.limit; limit present -> limit; +// otherwise this row states no opinion and resolution falls through. +// +// Not a oneof: two transitions need the losing field to survive. Unsuspending +// restores the limit it froze, and a lapsed extension falls back to its base +// rather than to the next layer. Pinned by +// TestControlsCoPresenceSurvivesEveryTransition in pkg/funds. +type SpendControls struct { + Extension *SpendExtension `json:"extension,omitempty"` + Limit *SpendLimit `json:"limit,omitempty"` + // Only valid together with limit: a period without its amount would + // reinterpret some other layer's number in a cadence that layer never + // agreed to. + Period *SpendControlsPeriod `json:"period,omitempty"` + Suspension *SpendSuspension `json:"suspension,omitempty"` +} + +func (s *SpendControls) GetExtension() *SpendExtension { + if s == nil { + return nil + } + return s.Extension +} + +func (s *SpendControls) GetLimit() *SpendLimit { + if s == nil { + return nil + } + return s.Limit +} + +func (s *SpendControls) GetPeriod() *SpendControlsPeriod { + if s == nil { + return nil + } + return s.Period +} + +func (s *SpendControls) GetSuspension() *SpendSuspension { + if s == nil { + return nil + } + return s.Suspension +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendextension.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendextension.go new file mode 100644 index 00000000..7c660235 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendextension.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// SpendExtension replaces the row's total with a temporary one until +// +// expires_at. It never changes the period, and it never expresses a refusal — +// a temporary refusal is a SpendSuspension. +type SpendExtension struct { + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + Limit *SpendLimit `json:"limit,omitempty"` + // Subject-visible: "why do I have this bump". Mutation rationale rides the + // history change_reason annotation instead. + Reason *string `json:"reason,omitempty"` +} + +func (s SpendExtension) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SpendExtension) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SpendExtension) GetExpiresAt() *time.Time { + if s == nil { + return nil + } + return s.ExpiresAt +} + +func (s *SpendExtension) GetLimit() *SpendLimit { + if s == nil { + return nil + } + return s.Limit +} + +func (s *SpendExtension) GetReason() *string { + if s == nil { + return nil + } + return s.Reason +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimit.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimit.go new file mode 100644 index 00000000..aa27da69 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimit.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SpendLimit is the three-way behavior fork. Which arms are legal depends on the +// +// scope carrying it; pkg/funds enforces that matrix, not the schema, because one +// SpendControls shape is shared by every scope. +// +// This message contains a oneof named kind. Only a single field of the following list may be set at a time: +// - unlimited +// - amount +// - blocked +type SpendLimit struct { + Amount *SpendLimitAmount `json:"amount,omitempty"` + Blocked *SpendLimitBlocked `json:"blocked,omitempty"` + Unlimited *SpendLimitUnlimited `json:"unlimited,omitempty"` +} + +func (s *SpendLimit) GetAmount() *SpendLimitAmount { + if s == nil { + return nil + } + return s.Amount +} + +func (s *SpendLimit) GetBlocked() *SpendLimitBlocked { + if s == nil { + return nil + } + return s.Blocked +} + +func (s *SpendLimit) GetUnlimited() *SpendLimitUnlimited { + if s == nil { + return nil + } + return s.Unlimited +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitamount.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitamount.go new file mode 100644 index 00000000..9ba59c05 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitamount.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SpendLimitAmount caps spend at money per resolved period. +type SpendLimitAmount struct { + Money *Money `json:"money,omitempty"` +} + +func (s *SpendLimitAmount) GetMoney() *Money { + if s == nil { + return nil + } + return s.Money +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitblocked.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitblocked.go new file mode 100644 index 00000000..4b504e15 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitblocked.go @@ -0,0 +1,10 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SpendLimitBlocked refuses supply at this scope. Distinct from suspension: +// +// blocked is a stated policy posture, suspension is a reversible freeze that +// preserves the numbers underneath it. +type SpendLimitBlocked struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitunlimited.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitunlimited.go new file mode 100644 index 00000000..21051476 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendlimitunlimited.go @@ -0,0 +1,10 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SpendLimitUnlimited is a tracking limit: full accounting, no admission +// +// condition. The maximum element, so an unlimited default makes grant rules +// no-ops. +type SpendLimitUnlimited struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendsuspension.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendsuspension.go new file mode 100644 index 00000000..597ff871 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/spendsuspension.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// SpendSuspension freezes a scope without erasing the limit it must restore +// +// on unsuspend, which is why it lives beside the SpendLimit oneof rather than +// inside it. +type SpendSuspension struct { + // The reason field. + Reason *string `json:"reason,omitempty"` + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` +} + +func (s SpendSuspension) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SpendSuspension) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SpendSuspension) GetReason() *string { + if s == nil { + return nil + } + return s.Reason +} + +func (s *SpendSuspension) GetSuspendedAt() *time.Time { + if s == nil { + return nil + } + return s.SuspendedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplication.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplication.go new file mode 100644 index 00000000..337de4aa --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplication.go @@ -0,0 +1,179 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// SubjectType - How the user's identifier reaches this application. +type SubjectType string + +const ( + SubjectTypeSsoSubjectTypeUnspecified SubjectType = "SSO_SUBJECT_TYPE_UNSPECIFIED" + SubjectTypeSsoSubjectTypePairwise SubjectType = "SSO_SUBJECT_TYPE_PAIRWISE" + SubjectTypeSsoSubjectTypePublic SubjectType = "SSO_SUBJECT_TYPE_PUBLIC" + SubjectTypeSsoSubjectTypeCompatibility SubjectType = "SSO_SUBJECT_TYPE_COMPATIBILITY" +) + +func (e SubjectType) ToPointer() *SubjectType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SubjectType) IsExact() bool { + if e != nil { + switch *e { + case "SSO_SUBJECT_TYPE_UNSPECIFIED", "SSO_SUBJECT_TYPE_PAIRWISE", "SSO_SUBJECT_TYPE_PUBLIC", "SSO_SUBJECT_TYPE_COMPATIBILITY": + return true + } + } + return false +} + +// SSOApplication is one application your users sign in to through ConductorOne. +// +// This message contains a oneof named protocol. Only a single field of the following list may be set at a time: +// - oidc +// - saml +type SSOApplication struct { + // The entitlement a user must hold to sign in. Created with the SSO + // application and not settable by the caller. + AppEntitlementID *string `json:"appEntitlementId,omitempty"` + // The application in your catalog that owns this sign-in configuration. Its + // owners, entitlements, and access reviews govern who may sign in. + AppID *string `json:"appId,omitempty"` + AssertionLifetime *string `json:"assertionLifetime,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description of the SSO application. + Description *string `json:"description,omitempty"` + // When true, sign-in through this application is refused. The application + // and its entitlement are left in place. + Disabled *bool `json:"disabled,omitempty"` + // Display name for the SSO application. + DisplayName *string `json:"displayName,omitempty"` + // Unique identifier for this SSO application. + ID *string `json:"id,omitempty"` + Oidc *SSOApplicationOIDCConfig `json:"oidc,omitempty"` + Saml *SSOApplicationSAMLConfig `json:"saml,omitempty"` + // The pairwise sector this application belongs to. Empty means the + // application is its own sector and shares linkability with nothing; set a + // shared value to issue one identifier across applications a user should + // appear the same to. Ignored when the subject type resolves to PUBLIC. + // Immutable once set. + SectorID *string `json:"sectorId,omitempty"` + SubjectCompatibility *SSOSubjectCompatibility `json:"subjectCompatibility,omitempty"` + // How the user's identifier reaches this application. + SubjectType *SubjectType `json:"subjectType,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (s SSOApplication) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SSOApplication) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SSOApplication) GetAppEntitlementID() *string { + if s == nil { + return nil + } + return s.AppEntitlementID +} + +func (s *SSOApplication) GetAppID() *string { + if s == nil { + return nil + } + return s.AppID +} + +func (s *SSOApplication) GetAssertionLifetime() *string { + if s == nil { + return nil + } + return s.AssertionLifetime +} + +func (s *SSOApplication) GetCreatedAt() *time.Time { + if s == nil { + return nil + } + return s.CreatedAt +} + +func (s *SSOApplication) GetDescription() *string { + if s == nil { + return nil + } + return s.Description +} + +func (s *SSOApplication) GetDisabled() *bool { + if s == nil { + return nil + } + return s.Disabled +} + +func (s *SSOApplication) GetDisplayName() *string { + if s == nil { + return nil + } + return s.DisplayName +} + +func (s *SSOApplication) GetID() *string { + if s == nil { + return nil + } + return s.ID +} + +func (s *SSOApplication) GetOidc() *SSOApplicationOIDCConfig { + if s == nil { + return nil + } + return s.Oidc +} + +func (s *SSOApplication) GetSaml() *SSOApplicationSAMLConfig { + if s == nil { + return nil + } + return s.Saml +} + +func (s *SSOApplication) GetSectorID() *string { + if s == nil { + return nil + } + return s.SectorID +} + +func (s *SSOApplication) GetSubjectCompatibility() *SSOSubjectCompatibility { + if s == nil { + return nil + } + return s.SubjectCompatibility +} + +func (s *SSOApplication) GetSubjectType() *SubjectType { + if s == nil { + return nil + } + return s.SubjectType +} + +func (s *SSOApplication) GetUpdatedAt() *time.Time { + if s == nil { + return nil + } + return s.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationhistoryentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationhistoryentry.go new file mode 100644 index 00000000..3cb0d52d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationhistoryentry.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationHistoryEntry is one version of an SSO application and its +// +// history metadata. +type SSOApplicationHistoryEntry struct { + Metadata *HistoryEntryMetadata `json:"metadata,omitempty"` + Snapshot *SSOApplication `json:"snapshot,omitempty"` +} + +func (s *SSOApplicationHistoryEntry) GetMetadata() *HistoryEntryMetadata { + if s == nil { + return nil + } + return s.Metadata +} + +func (s *SSOApplicationHistoryEntry) GetSnapshot() *SSOApplication { + if s == nil { + return nil + } + return s.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclient.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclient.go new file mode 100644 index 00000000..62e4ef9a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclient.go @@ -0,0 +1,125 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// PkcePolicy - Effective PKCE policy. +type PkcePolicy string + +const ( + PkcePolicySsoApplicationOidcPkcePolicyUnspecified PkcePolicy = "SSO_APPLICATION_OIDC_PKCE_POLICY_UNSPECIFIED" + PkcePolicySsoApplicationOidcPkcePolicyRequiredS256 PkcePolicy = "SSO_APPLICATION_OIDC_PKCE_POLICY_REQUIRED_S256" + PkcePolicySsoApplicationOidcPkcePolicyAllowMissingForLegacy PkcePolicy = "SSO_APPLICATION_OIDC_PKCE_POLICY_ALLOW_MISSING_FOR_LEGACY" +) + +func (e PkcePolicy) ToPointer() *PkcePolicy { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PkcePolicy) IsExact() bool { + if e != nil { + switch *e { + case "SSO_APPLICATION_OIDC_PKCE_POLICY_UNSPECIFIED", "SSO_APPLICATION_OIDC_PKCE_POLICY_REQUIRED_S256", "SSO_APPLICATION_OIDC_PKCE_POLICY_ALLOW_MISSING_FOR_LEGACY": + return true + } + } + return false +} + +// SSOApplicationOIDCClient is an App-owned OAuth client minted by C1. +type SSOApplicationOIDCClient struct { + // Application that owns this client. + AppID *string `json:"appId,omitempty"` + Authentication *SSOApplicationOIDCClientAuthentication `json:"authentication,omitempty"` + // Client ID generated by ConductorOne. + ClientID *string `json:"clientId,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Human-readable client name. + DisplayName *string `json:"displayName,omitempty"` + // Effective PKCE policy. + PkcePolicy *PkcePolicy `json:"pkcePolicy,omitempty"` + // Exact callback URLs registered for this client. + RedirectUris []string `json:"redirectUris,omitempty"` + // SSO application whose identity policy applies to this client. + SsoApplicationID *string `json:"ssoApplicationId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (s SSOApplicationOIDCClient) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SSOApplicationOIDCClient) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SSOApplicationOIDCClient) GetAppID() *string { + if s == nil { + return nil + } + return s.AppID +} + +func (s *SSOApplicationOIDCClient) GetAuthentication() *SSOApplicationOIDCClientAuthentication { + if s == nil { + return nil + } + return s.Authentication +} + +func (s *SSOApplicationOIDCClient) GetClientID() *string { + if s == nil { + return nil + } + return s.ClientID +} + +func (s *SSOApplicationOIDCClient) GetCreatedAt() *time.Time { + if s == nil { + return nil + } + return s.CreatedAt +} + +func (s *SSOApplicationOIDCClient) GetDisplayName() *string { + if s == nil { + return nil + } + return s.DisplayName +} + +func (s *SSOApplicationOIDCClient) GetPkcePolicy() *PkcePolicy { + if s == nil { + return nil + } + return s.PkcePolicy +} + +func (s *SSOApplicationOIDCClient) GetRedirectUris() []string { + if s == nil { + return nil + } + return s.RedirectUris +} + +func (s *SSOApplicationOIDCClient) GetSsoApplicationID() *string { + if s == nil { + return nil + } + return s.SsoApplicationID +} + +func (s *SSOApplicationOIDCClient) GetUpdatedAt() *time.Time { + if s == nil { + return nil + } + return s.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthclientsecretbasic.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthclientsecretbasic.go new file mode 100644 index 00000000..8fb6be6d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthclientsecretbasic.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationOIDCClientAuthClientSecretBasic - RFC 6749 client_secret_basic. C1 generates and returns the secret once. +type SSOApplicationOIDCClientAuthClientSecretBasic struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthclientsecretpost.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthclientsecretpost.go new file mode 100644 index 00000000..49eaa00a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthclientsecretpost.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationOIDCClientAuthClientSecretPost - RFC 6749 client_secret_post. C1 generates and returns the secret once. +type SSOApplicationOIDCClientAuthClientSecretPost struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthentication.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthentication.go new file mode 100644 index 00000000..fa099466 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthentication.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationOIDCClientAuthentication is the exact token-endpoint client +// +// authentication method assigned to an OIDC client. +// +// This message contains a oneof named method. Only a single field of the following list may be set at a time: +// - none +// - clientSecretBasic +// - clientSecretPost +// - privateKeyJwt +type SSOApplicationOIDCClientAuthentication struct { + ClientSecretBasic *SSOApplicationOIDCClientAuthClientSecretBasic `json:"clientSecretBasic,omitempty"` + ClientSecretPost *SSOApplicationOIDCClientAuthClientSecretPost `json:"clientSecretPost,omitempty"` + None *SSOApplicationOIDCClientAuthNone `json:"none,omitempty"` + PrivateKeyJwt *SSOApplicationOIDCClientAuthPrivateKeyJWT `json:"privateKeyJwt,omitempty"` +} + +func (s *SSOApplicationOIDCClientAuthentication) GetClientSecretBasic() *SSOApplicationOIDCClientAuthClientSecretBasic { + if s == nil { + return nil + } + return s.ClientSecretBasic +} + +func (s *SSOApplicationOIDCClientAuthentication) GetClientSecretPost() *SSOApplicationOIDCClientAuthClientSecretPost { + if s == nil { + return nil + } + return s.ClientSecretPost +} + +func (s *SSOApplicationOIDCClientAuthentication) GetNone() *SSOApplicationOIDCClientAuthNone { + if s == nil { + return nil + } + return s.None +} + +func (s *SSOApplicationOIDCClientAuthentication) GetPrivateKeyJwt() *SSOApplicationOIDCClientAuthPrivateKeyJWT { + if s == nil { + return nil + } + return s.PrivateKeyJwt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthnone.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthnone.go new file mode 100644 index 00000000..0fba744d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthnone.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationOIDCClientAuthNone - Public client authentication. No client credential is issued. +type SSOApplicationOIDCClientAuthNone struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthprivatekeyjwt.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthprivatekeyjwt.go new file mode 100644 index 00000000..9f25b913 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientauthprivatekeyjwt.go @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationOIDCClientAuthPrivateKeyJWT - RFC 7523 private_key_jwt using an inline RFC 7517 JWK Set. Multiple public +// +// signing keys allow overlap during relying-party key rotation; C1 selects by +// the assertion's `kid`. The relying party retains every private key. +type SSOApplicationOIDCClientAuthPrivateKeyJWT struct { + // The publicJwks field. + PublicJwks string `json:"publicJwks"` +} + +func (s *SSOApplicationOIDCClientAuthPrivateKeyJWT) GetPublicJwks() string { + if s == nil { + return "" + } + return s.PublicJwks +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientconfig.go new file mode 100644 index 00000000..4d41b48b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcclientconfig.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationOIDCClientConfigPkcePolicy - PKCE is required by default on create. On update, UNSPECIFIED preserves +// +// the current policy; set REQUIRED_S256 explicitly to tighten a legacy +// confidential client. +type SSOApplicationOIDCClientConfigPkcePolicy string + +const ( + SSOApplicationOIDCClientConfigPkcePolicySsoApplicationOidcPkcePolicyUnspecified SSOApplicationOIDCClientConfigPkcePolicy = "SSO_APPLICATION_OIDC_PKCE_POLICY_UNSPECIFIED" + SSOApplicationOIDCClientConfigPkcePolicySsoApplicationOidcPkcePolicyRequiredS256 SSOApplicationOIDCClientConfigPkcePolicy = "SSO_APPLICATION_OIDC_PKCE_POLICY_REQUIRED_S256" + SSOApplicationOIDCClientConfigPkcePolicySsoApplicationOidcPkcePolicyAllowMissingForLegacy SSOApplicationOIDCClientConfigPkcePolicy = "SSO_APPLICATION_OIDC_PKCE_POLICY_ALLOW_MISSING_FOR_LEGACY" +) + +func (e SSOApplicationOIDCClientConfigPkcePolicy) ToPointer() *SSOApplicationOIDCClientConfigPkcePolicy { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SSOApplicationOIDCClientConfigPkcePolicy) IsExact() bool { + if e != nil { + switch *e { + case "SSO_APPLICATION_OIDC_PKCE_POLICY_UNSPECIFIED", "SSO_APPLICATION_OIDC_PKCE_POLICY_REQUIRED_S256", "SSO_APPLICATION_OIDC_PKCE_POLICY_ALLOW_MISSING_FOR_LEGACY": + return true + } + } + return false +} + +// SSOApplicationOIDCClientConfig is the administrator-supplied configuration +// +// from which C1 mints an App-owned OAuth client. The client ID is never input. +type SSOApplicationOIDCClientConfig struct { + Authentication *SSOApplicationOIDCClientAuthentication `json:"authentication"` + // Human-readable client name shown to administrators. + DisplayName string `json:"displayName"` + // PKCE is required by default on create. On update, UNSPECIFIED preserves + // the current policy; set REQUIRED_S256 explicitly to tighten a legacy + // confidential client. + PkcePolicy *SSOApplicationOIDCClientConfigPkcePolicy `json:"pkcePolicy,omitempty"` + // Exact redirect URIs the client may use after authorization. HTTPS and + // loopback HTTP are accepted; public clients may also use a reversed-DNS + // private-use scheme for native-app redirects. + RedirectUris []string `json:"redirectUris,omitempty"` +} + +func (s *SSOApplicationOIDCClientConfig) GetAuthentication() *SSOApplicationOIDCClientAuthentication { + if s == nil { + return nil + } + return s.Authentication +} + +func (s *SSOApplicationOIDCClientConfig) GetDisplayName() string { + if s == nil { + return "" + } + return s.DisplayName +} + +func (s *SSOApplicationOIDCClientConfig) GetPkcePolicy() *SSOApplicationOIDCClientConfigPkcePolicy { + if s == nil { + return nil + } + return s.PkcePolicy +} + +func (s *SSOApplicationOIDCClientConfig) GetRedirectUris() []string { + if s == nil { + return nil + } + return s.RedirectUris +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcconfig.go new file mode 100644 index 00000000..1808ac21 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationoidcconfig.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// IDTokenSignedResponseAlg - The algorithm used to sign this application's id_token. +type IDTokenSignedResponseAlg string + +const ( + IDTokenSignedResponseAlgOidcSigningAlgorithmUnspecified IDTokenSignedResponseAlg = "OIDC_SIGNING_ALGORITHM_UNSPECIFIED" + IDTokenSignedResponseAlgOidcSigningAlgorithmEddsa IDTokenSignedResponseAlg = "OIDC_SIGNING_ALGORITHM_EDDSA" + IDTokenSignedResponseAlgOidcSigningAlgorithmEs256 IDTokenSignedResponseAlg = "OIDC_SIGNING_ALGORITHM_ES256" + IDTokenSignedResponseAlgOidcSigningAlgorithmRs256 IDTokenSignedResponseAlg = "OIDC_SIGNING_ALGORITHM_RS256" +) + +func (e IDTokenSignedResponseAlg) ToPointer() *IDTokenSignedResponseAlg { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *IDTokenSignedResponseAlg) IsExact() bool { + if e != nil { + switch *e { + case "OIDC_SIGNING_ALGORITHM_UNSPECIFIED", "OIDC_SIGNING_ALGORITHM_EDDSA", "OIDC_SIGNING_ALGORITHM_ES256", "OIDC_SIGNING_ALGORITHM_RS256": + return true + } + } + return false +} + +// SSOApplicationOIDCConfig is the OIDC-specific sign-in configuration. +type SSOApplicationOIDCConfig struct { + // Custom claims released to this application, in addition to the standard + // claims its granted scopes already release. + ClaimMappings []OIDCClaimMapping `json:"claimMappings,omitempty"` + // The algorithm used to sign this application's id_token. + IDTokenSignedResponseAlg *IDTokenSignedResponseAlg `json:"idTokenSignedResponseAlg,omitempty"` +} + +func (s *SSOApplicationOIDCConfig) GetClaimMappings() []OIDCClaimMapping { + if s == nil { + return nil + } + return s.ClaimMappings +} + +func (s *SSOApplicationOIDCConfig) GetIDTokenSignedResponseAlg() *IDTokenSignedResponseAlg { + if s == nil { + return nil + } + return s.IDTokenSignedResponseAlg +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationsamlconfig.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationsamlconfig.go new file mode 100644 index 00000000..e9325db3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationsamlconfig.go @@ -0,0 +1,179 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// EncryptionAlgorithm - The algorithm used when encrypt_assertions is set. +type EncryptionAlgorithm string + +const ( + EncryptionAlgorithmSamlEncryptionAlgorithmUnspecified EncryptionAlgorithm = "SAML_ENCRYPTION_ALGORITHM_UNSPECIFIED" + EncryptionAlgorithmSamlEncryptionAlgorithmAes256Gcm EncryptionAlgorithm = "SAML_ENCRYPTION_ALGORITHM_AES256_GCM" + EncryptionAlgorithmSamlEncryptionAlgorithmAes128Gcm EncryptionAlgorithm = "SAML_ENCRYPTION_ALGORITHM_AES128_GCM" + EncryptionAlgorithmSamlEncryptionAlgorithmAes256Cbc EncryptionAlgorithm = "SAML_ENCRYPTION_ALGORITHM_AES256_CBC" +) + +func (e EncryptionAlgorithm) ToPointer() *EncryptionAlgorithm { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *EncryptionAlgorithm) IsExact() bool { + if e != nil { + switch *e { + case "SAML_ENCRYPTION_ALGORITHM_UNSPECIFIED", "SAML_ENCRYPTION_ALGORITHM_AES256_GCM", "SAML_ENCRYPTION_ALGORITHM_AES128_GCM", "SAML_ENCRYPTION_ALGORITHM_AES256_CBC": + return true + } + } + return false +} + +// NameIDFormat - Set this when the service provider requires a specific NameID format. This +// +// also selects the NameID value semantics: EMAIL_ADDRESS uses the user's +// primary email, TRANSIENT creates a new value for each sign-in, and +// PERSISTENT uses the application's pairwise subject. Immutable once set. +type NameIDFormat string + +const ( + NameIDFormatSamlNameIDFormatUnspecified NameIDFormat = "SAML_NAME_ID_FORMAT_UNSPECIFIED" + NameIDFormatSamlNameIDFormatPersistent NameIDFormat = "SAML_NAME_ID_FORMAT_PERSISTENT" + NameIDFormatSamlNameIDFormatEmailAddress NameIDFormat = "SAML_NAME_ID_FORMAT_EMAIL_ADDRESS" + NameIDFormatSamlNameIDFormatUnspecifiedUrn NameIDFormat = "SAML_NAME_ID_FORMAT_UNSPECIFIED_URN" + NameIDFormatSamlNameIDFormatTransient NameIDFormat = "SAML_NAME_ID_FORMAT_TRANSIENT" +) + +func (e NameIDFormat) ToPointer() *NameIDFormat { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *NameIDFormat) IsExact() bool { + if e != nil { + switch *e { + case "SAML_NAME_ID_FORMAT_UNSPECIFIED", "SAML_NAME_ID_FORMAT_PERSISTENT", "SAML_NAME_ID_FORMAT_EMAIL_ADDRESS", "SAML_NAME_ID_FORMAT_UNSPECIFIED_URN", "SAML_NAME_ID_FORMAT_TRANSIENT": + return true + } + } + return false +} + +// SSOApplicationSAMLConfig is the SAML-specific sign-in configuration. +type SSOApplicationSAMLConfig struct { + // The Assertion Consumer Service URLs the assertion may be posted to. + // Matched exactly; a URL that is not in this list is refused. + AcsUrls []string `json:"acsUrls"` + // The attributes released in the assertion's AttributeStatement. SAML has no + // scopes, so this list is the whole release: the NameID carries the + // identifier and these carry everything else. + AttributeMappings []SAMLAttributeMapping `json:"attributeMappings,omitempty"` + // Encrypt the assertion. + EncryptAssertions *bool `json:"encryptAssertions,omitempty"` + // The algorithm used when encrypt_assertions is set. + EncryptionAlgorithm *EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"` + // Set this when the service provider requires a specific NameID format. This + // also selects the NameID value semantics: EMAIL_ADDRESS uses the user's + // primary email, TRANSIENT creates a new value for each sign-in, and + // PERSISTENT uses the application's pairwise subject. Immutable once set. + NameIDFormat *NameIDFormat `json:"nameIdFormat,omitempty"` + // Reject any AuthnRequest that is not signed by one of + // sp_signing_certificates. At least one signing certificate is required when + // this is set. + RequireSignedAuthnRequests *bool `json:"requireSignedAuthnRequests,omitempty"` + // Sign the assertion. At least one of sign_assertions or sign_responses must + // be set. + SignAssertions *bool `json:"signAssertions,omitempty"` + // Sign the response envelope. At least one of sign_assertions or + // sign_responses must be set. + SignResponses *bool `json:"signResponses,omitempty"` + // The service provider's DER-encoded encryption certificate, taken from the + // encryption KeyDescriptor in its metadata. Required when encrypt_assertions + // is set. + SpEncryptionCertificate *string `json:"spEncryptionCertificate,omitempty"` + // The service provider's entity ID, taken from its metadata. It is the + // audience every assertion this application issues is restricted to, and it + // is what the service provider presents at sign-in. Set it at creation: it is + // fixed for the life of the application, because changing it re-points every + // assertion already issued. An entity ID already in use by another SSO + // application in the tenant is rejected. + SpEntityID string `json:"spEntityId"` + // The service provider's DER-encoded signing certificates, taken from the + // signing KeyDescriptors in its metadata. + SpSigningCertificates []string `json:"spSigningCertificates,omitempty"` +} + +func (s *SSOApplicationSAMLConfig) GetAcsUrls() []string { + if s == nil { + return nil + } + return s.AcsUrls +} + +func (s *SSOApplicationSAMLConfig) GetAttributeMappings() []SAMLAttributeMapping { + if s == nil { + return nil + } + return s.AttributeMappings +} + +func (s *SSOApplicationSAMLConfig) GetEncryptAssertions() *bool { + if s == nil { + return nil + } + return s.EncryptAssertions +} + +func (s *SSOApplicationSAMLConfig) GetEncryptionAlgorithm() *EncryptionAlgorithm { + if s == nil { + return nil + } + return s.EncryptionAlgorithm +} + +func (s *SSOApplicationSAMLConfig) GetNameIDFormat() *NameIDFormat { + if s == nil { + return nil + } + return s.NameIDFormat +} + +func (s *SSOApplicationSAMLConfig) GetRequireSignedAuthnRequests() *bool { + if s == nil { + return nil + } + return s.RequireSignedAuthnRequests +} + +func (s *SSOApplicationSAMLConfig) GetSignAssertions() *bool { + if s == nil { + return nil + } + return s.SignAssertions +} + +func (s *SSOApplicationSAMLConfig) GetSignResponses() *bool { + if s == nil { + return nil + } + return s.SignResponses +} + +func (s *SSOApplicationSAMLConfig) GetSpEncryptionCertificate() *string { + if s == nil { + return nil + } + return s.SpEncryptionCertificate +} + +func (s *SSOApplicationSAMLConfig) GetSpEntityID() string { + if s == nil { + return "" + } + return s.SpEntityID +} + +func (s *SSOApplicationSAMLConfig) GetSpSigningCertificates() []string { + if s == nil { + return nil + } + return s.SpSigningCertificates +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchdeletesubjectcompatibilityrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchdeletesubjectcompatibilityrequest.go new file mode 100644 index 00000000..da0978ec --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchdeletesubjectcompatibilityrequest.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest deletes a +// +// bounded batch of compatibility-subject bindings. +type SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest struct { + // The userIds field. + UserIds []string `json:"userIds,omitempty"` +} + +func (s *SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest) GetUserIds() []string { + if s == nil { + return nil + } + return s.UserIds +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchdeletesubjectcompatibilityresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchdeletesubjectcompatibilityresponse.go new file mode 100644 index 00000000..62298454 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchdeletesubjectcompatibilityresponse.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse reports bounded +// +// recovery progress. +type SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse struct { + // The deletedRows field. + DeletedRows *int `json:"deletedRows,omitempty"` + // The issues field. + Issues []SSOSubjectCompatibilityDeleteIssue `json:"issues,omitempty"` +} + +func (s *SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse) GetDeletedRows() *int { + if s == nil { + return nil + } + return s.DeletedRows +} + +func (s *SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse) GetIssues() []SSOSubjectCompatibilityDeleteIssue { + if s == nil { + return nil + } + return s.Issues +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchimportsubjectcompatibilityrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchimportsubjectcompatibilityrequest.go new file mode 100644 index 00000000..820e19e9 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchimportsubjectcompatibilityrequest.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceBatchImportSubjectCompatibilityRequest validates or +// +// imports a bounded batch of per-user subject bindings. +type SSOApplicationServiceBatchImportSubjectCompatibilityRequest struct { + // When false, validate without writing. Clients should validate every batch + // before beginning the apply pass. + Apply *bool `json:"apply,omitempty"` + // Client-parsed rows. Each request is bounded to 50 entries. + Entries []SSOSubjectCompatibilityImportEntry `json:"entries,omitempty"` + // Client-generated identifier shared by every batch from one source file. + ImportID *string `json:"importId,omitempty"` +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityRequest) GetApply() *bool { + if s == nil { + return nil + } + return s.Apply +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityRequest) GetEntries() []SSOSubjectCompatibilityImportEntry { + if s == nil { + return nil + } + return s.Entries +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityRequest) GetImportID() *string { + if s == nil { + return nil + } + return s.ImportID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchimportsubjectcompatibilityresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchimportsubjectcompatibilityresponse.go new file mode 100644 index 00000000..1ff2c8f6 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicebatchimportsubjectcompatibilityresponse.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceBatchImportSubjectCompatibilityResponse summarizes one +// +// bounded validation or apply batch. +type SSOApplicationServiceBatchImportSubjectCompatibilityResponse struct { + // Import-created binding owners that block one or more submitted corrections. + // This is a subset of recoverable_user_ids. + BlockingUserIds []string `json:"blockingUserIds,omitempty"` + // Number of bindings successfully written. Zero for validation-only + // requests; may be less than valid_rows if apply stops on a write failure. + ImportedRows *int `json:"importedRows,omitempty"` + // Users whose bindings were created by this import, or were already created + // by an earlier retry carrying the same import_id. + ImportedUserIds []string `json:"importedUserIds,omitempty"` + // Row-level validation or apply failures. + Issues []SSOSubjectCompatibilityImportIssue `json:"issues,omitempty"` + // Users whose import-created binding is implicated by a submitted row. This + // may include the current owner of a submitted subject even when that owner + // was not itself submitted. + RecoverableUserIds []string `json:"recoverableUserIds,omitempty"` + // Number of entries in this batch. + TotalRows *int `json:"totalRows,omitempty"` + // Number of rows that can be imported. + ValidRows *int `json:"validRows,omitempty"` +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetBlockingUserIds() []string { + if s == nil { + return nil + } + return s.BlockingUserIds +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetImportedRows() *int { + if s == nil { + return nil + } + return s.ImportedRows +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetImportedUserIds() []string { + if s == nil { + return nil + } + return s.ImportedUserIds +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetIssues() []SSOSubjectCompatibilityImportIssue { + if s == nil { + return nil + } + return s.Issues +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetRecoverableUserIds() []string { + if s == nil { + return nil + } + return s.RecoverableUserIds +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetTotalRows() *int { + if s == nil { + return nil + } + return s.TotalRows +} + +func (s *SSOApplicationServiceBatchImportSubjectCompatibilityResponse) GetValidRows() *int { + if s == nil { + return nil + } + return s.ValidRows +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateclientrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateclientrequest.go new file mode 100644 index 00000000..7cdb446b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateclientrequest.go @@ -0,0 +1,17 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceCreateClientRequest mints an additional App-owned +// +// client. The caller supplies configuration, never a client ID. +type SSOApplicationServiceCreateClientRequest struct { + Client *SSOApplicationOIDCClientConfig `json:"client"` +} + +func (s *SSOApplicationServiceCreateClientRequest) GetClient() *SSOApplicationOIDCClientConfig { + if s == nil { + return nil + } + return s.Client +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateclientresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateclientresponse.go new file mode 100644 index 00000000..5ee4e618 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateclientresponse.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceCreateClientResponse contains the generated client and +// +// its one-time secret, when applicable. +type SSOApplicationServiceCreateClientResponse struct { + Client *SSOApplicationOIDCClient `json:"client,omitempty"` + // Returned once for client_secret_basic/client_secret_post; empty for + // none/private_key_jwt. + ClientSecret *string `json:"clientSecret,omitempty"` +} + +func (s *SSOApplicationServiceCreateClientResponse) GetClient() *SSOApplicationOIDCClient { + if s == nil { + return nil + } + return s.Client +} + +func (s *SSOApplicationServiceCreateClientResponse) GetClientSecret() *string { + if s == nil { + return nil + } + return s.ClientSecret +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreaterequest.go new file mode 100644 index 00000000..72668f79 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreaterequest.go @@ -0,0 +1,116 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceCreateRequestSubjectType - How the user's identifier reaches this application. Leave unset to use the +// +// tenant default. +type SSOApplicationServiceCreateRequestSubjectType string + +const ( + SSOApplicationServiceCreateRequestSubjectTypeSsoSubjectTypeUnspecified SSOApplicationServiceCreateRequestSubjectType = "SSO_SUBJECT_TYPE_UNSPECIFIED" + SSOApplicationServiceCreateRequestSubjectTypeSsoSubjectTypePairwise SSOApplicationServiceCreateRequestSubjectType = "SSO_SUBJECT_TYPE_PAIRWISE" + SSOApplicationServiceCreateRequestSubjectTypeSsoSubjectTypePublic SSOApplicationServiceCreateRequestSubjectType = "SSO_SUBJECT_TYPE_PUBLIC" + SSOApplicationServiceCreateRequestSubjectTypeSsoSubjectTypeCompatibility SSOApplicationServiceCreateRequestSubjectType = "SSO_SUBJECT_TYPE_COMPATIBILITY" +) + +func (e SSOApplicationServiceCreateRequestSubjectType) ToPointer() *SSOApplicationServiceCreateRequestSubjectType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SSOApplicationServiceCreateRequestSubjectType) IsExact() bool { + if e != nil { + switch *e { + case "SSO_SUBJECT_TYPE_UNSPECIFIED", "SSO_SUBJECT_TYPE_PAIRWISE", "SSO_SUBJECT_TYPE_PUBLIC", "SSO_SUBJECT_TYPE_COMPATIBILITY": + return true + } + } + return false +} + +// SSOApplicationServiceCreateRequest creates an SSO application. +// +// This message contains a oneof named protocol. Only a single field of the following list may be set at a time: +// - oidc +// - saml +type SSOApplicationServiceCreateRequest struct { + AssertionLifetime *string `json:"assertionLifetime,omitempty"` + // Description of the SSO application. + Description *string `json:"description,omitempty"` + // Display name for the SSO application. + DisplayName string `json:"displayName"` + InitialClient *SSOApplicationOIDCClientConfig `json:"initialClient,omitempty"` + Oidc *SSOApplicationOIDCConfig `json:"oidc,omitempty"` + Saml *SSOApplicationSAMLConfig `json:"saml,omitempty"` + // The pairwise sector this application belongs to. Empty means the + // application is its own sector. Immutable after creation. + SectorID *string `json:"sectorId,omitempty"` + SubjectCompatibility *SSOSubjectCompatibility `json:"subjectCompatibility,omitempty"` + // How the user's identifier reaches this application. Leave unset to use the + // tenant default. + SubjectType *SSOApplicationServiceCreateRequestSubjectType `json:"subjectType,omitempty"` +} + +func (s *SSOApplicationServiceCreateRequest) GetAssertionLifetime() *string { + if s == nil { + return nil + } + return s.AssertionLifetime +} + +func (s *SSOApplicationServiceCreateRequest) GetDescription() *string { + if s == nil { + return nil + } + return s.Description +} + +func (s *SSOApplicationServiceCreateRequest) GetDisplayName() string { + if s == nil { + return "" + } + return s.DisplayName +} + +func (s *SSOApplicationServiceCreateRequest) GetInitialClient() *SSOApplicationOIDCClientConfig { + if s == nil { + return nil + } + return s.InitialClient +} + +func (s *SSOApplicationServiceCreateRequest) GetOidc() *SSOApplicationOIDCConfig { + if s == nil { + return nil + } + return s.Oidc +} + +func (s *SSOApplicationServiceCreateRequest) GetSaml() *SSOApplicationSAMLConfig { + if s == nil { + return nil + } + return s.Saml +} + +func (s *SSOApplicationServiceCreateRequest) GetSectorID() *string { + if s == nil { + return nil + } + return s.SectorID +} + +func (s *SSOApplicationServiceCreateRequest) GetSubjectCompatibility() *SSOSubjectCompatibility { + if s == nil { + return nil + } + return s.SubjectCompatibility +} + +func (s *SSOApplicationServiceCreateRequest) GetSubjectType() *SSOApplicationServiceCreateRequestSubjectType { + if s == nil { + return nil + } + return s.SubjectType +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateresponse.go new file mode 100644 index 00000000..b97bee66 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicecreateresponse.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceCreateResponse returns the created SSO application. +type SSOApplicationServiceCreateResponse struct { + Application *SSOApplication `json:"application,omitempty"` + Client *SSOApplicationOIDCClient `json:"client,omitempty"` + // Confidential-client secret returned once. Empty for SAML and public OIDC + // clients. C1 stores only its hash. + ClientSecret *string `json:"clientSecret,omitempty"` +} + +func (s *SSOApplicationServiceCreateResponse) GetApplication() *SSOApplication { + if s == nil { + return nil + } + return s.Application +} + +func (s *SSOApplicationServiceCreateResponse) GetClient() *SSOApplicationOIDCClient { + if s == nil { + return nil + } + return s.Client +} + +func (s *SSOApplicationServiceCreateResponse) GetClientSecret() *string { + if s == nil { + return nil + } + return s.ClientSecret +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteclientrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteclientrequest.go new file mode 100644 index 00000000..e2097f70 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteclientrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceDeleteClientRequest deletes one App-owned OAuth client. +type SSOApplicationServiceDeleteClientRequest struct { + // Generated client ID to delete. + ClientID string `json:"clientId"` +} + +func (s *SSOApplicationServiceDeleteClientRequest) GetClientID() string { + if s == nil { + return "" + } + return s.ClientID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteclientresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteclientresponse.go new file mode 100644 index 00000000..bca373b6 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteclientresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceDeleteClientResponse confirms deletion. +type SSOApplicationServiceDeleteClientResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleterequest.go new file mode 100644 index 00000000..06477bff --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleterequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceDeleteRequest deletes an SSO application. +type SSOApplicationServiceDeleteRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteresponse.go new file mode 100644 index 00000000..ba66bb55 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicedeleteresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceDeleteResponse confirms deletion. +type SSOApplicationServiceDeleteResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicegetresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicegetresponse.go new file mode 100644 index 00000000..d3a0da5a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicegetresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceGetResponse returns a single SSO application. +type SSOApplicationServiceGetResponse struct { + Application *SSOApplication `json:"application,omitempty"` +} + +func (s *SSOApplicationServiceGetResponse) GetApplication() *SSOApplication { + if s == nil { + return nil + } + return s.Application +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelistclientsresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelistclientsresponse.go new file mode 100644 index 00000000..db61a783 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelistclientsresponse.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceListClientsResponse contains a page of App-owned OAuth +// +// clients. +type SSOApplicationServiceListClientsResponse struct { + // App-owned clients in this page. + List []SSOApplicationOIDCClient `json:"list,omitempty"` + // Pagination token for the next page, or empty when complete. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (s *SSOApplicationServiceListClientsResponse) GetList() []SSOApplicationOIDCClient { + if s == nil { + return nil + } + return s.List +} + +func (s *SSOApplicationServiceListClientsResponse) GetNextPageToken() *string { + if s == nil { + return nil + } + return s.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelisthistoryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelisthistoryresponse.go new file mode 100644 index 00000000..0cd2f21c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelisthistoryresponse.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceListHistoryResponse returns SSO application history +// +// entries. +type SSOApplicationServiceListHistoryResponse struct { + // The page of history entries, newest first. + List []SSOApplicationHistoryEntry `json:"list,omitempty"` + // Pagination token for the next page, or empty if there are no more results. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (s *SSOApplicationServiceListHistoryResponse) GetList() []SSOApplicationHistoryEntry { + if s == nil { + return nil + } + return s.List +} + +func (s *SSOApplicationServiceListHistoryResponse) GetNextPageToken() *string { + if s == nil { + return nil + } + return s.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelistresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelistresponse.go new file mode 100644 index 00000000..1d98bb8f --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicelistresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceListResponse returns a page of SSO applications. +type SSOApplicationServiceListResponse struct { + // The page of SSO applications. + List []SSOApplication `json:"list,omitempty"` + // Pagination token for the next page, or empty if there are no more results. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (s *SSOApplicationServiceListResponse) GetList() []SSOApplication { + if s == nil { + return nil + } + return s.List +} + +func (s *SSOApplicationServiceListResponse) GetNextPageToken() *string { + if s == nil { + return nil + } + return s.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceparsesamlserviceprovidermetadatarequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceparsesamlserviceprovidermetadatarequest.go new file mode 100644 index 00000000..3ba93ce0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceparsesamlserviceprovidermetadatarequest.go @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceParseSAMLServiceProviderMetadataRequest carries one +// +// SAML service-provider metadata document to parse. +type SSOApplicationServiceParseSAMLServiceProviderMetadataRequest struct { + // The SP metadata XML document, exactly as downloaded or exported from the + // service provider. Maximum 1 MiB. The document is parsed, never stored. + MetadataXML string `json:"metadataXml"` +} + +func (s *SSOApplicationServiceParseSAMLServiceProviderMetadataRequest) GetMetadataXML() string { + if s == nil { + return "" + } + return s.MetadataXML +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceparsesamlserviceprovidermetadataresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceparsesamlserviceprovidermetadataresponse.go new file mode 100644 index 00000000..4adea223 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceparsesamlserviceprovidermetadataresponse.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceParseSAMLServiceProviderMetadataResponse returns the +// +// SAML configuration derived from one metadata document and every finding the +// parser raised about it. +type SSOApplicationServiceParseSAMLServiceProviderMetadataResponse struct { + Config *SSOApplicationSAMLConfig `json:"config,omitempty"` + // Everything the parser noticed about the document, including requirements + // it could not map into the configuration. + Findings []SAMLMetadataFinding `json:"findings,omitempty"` +} + +func (s *SSOApplicationServiceParseSAMLServiceProviderMetadataResponse) GetConfig() *SSOApplicationSAMLConfig { + if s == nil { + return nil + } + return s.Config +} + +func (s *SSOApplicationServiceParseSAMLServiceProviderMetadataResponse) GetFindings() []SAMLMetadataFinding { + if s == nil { + return nil + } + return s.Findings +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicerotateclientsecretrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicerotateclientsecretrequest.go new file mode 100644 index 00000000..7ca0fd13 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicerotateclientsecretrequest.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceRotateClientSecretRequest rotates one confidential +// +// App-owned client's secret. +type SSOApplicationServiceRotateClientSecretRequest struct { + // Generated client ID whose secret will be rotated. + ClientID string `json:"clientId"` +} + +func (s *SSOApplicationServiceRotateClientSecretRequest) GetClientID() string { + if s == nil { + return "" + } + return s.ClientID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicerotateclientsecretresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicerotateclientsecretresponse.go new file mode 100644 index 00000000..ddbbec9d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicerotateclientsecretresponse.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceRotateClientSecretResponse contains the replacement +// +// secret. The value cannot be retrieved again. +type SSOApplicationServiceRotateClientSecretResponse struct { + // New client secret, shown exactly once. + ClientSecret *string `json:"clientSecret,omitempty"` +} + +func (s *SSOApplicationServiceRotateClientSecretResponse) GetClientSecret() *string { + if s == nil { + return nil + } + return s.ClientSecret +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicesearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicesearchrequest.go new file mode 100644 index 00000000..40dbc31a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicesearchrequest.go @@ -0,0 +1,44 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceSearchRequest searches SSO applications with filters. +type SSOApplicationServiceSearchRequest struct { + // Optional filter by applications in your catalog. Empty matches any + // application. + AppIds []string `json:"appIds,omitempty"` + // Maximum number of results to return per page. + PageSize *int `json:"pageSize,omitempty"` + // Pagination token from a previous response. + PageToken *string `json:"pageToken,omitempty"` + // Optional text query matched against display_name and description. + Query *string `json:"query,omitempty"` +} + +func (s *SSOApplicationServiceSearchRequest) GetAppIds() []string { + if s == nil { + return nil + } + return s.AppIds +} + +func (s *SSOApplicationServiceSearchRequest) GetPageSize() *int { + if s == nil { + return nil + } + return s.PageSize +} + +func (s *SSOApplicationServiceSearchRequest) GetPageToken() *string { + if s == nil { + return nil + } + return s.PageToken +} + +func (s *SSOApplicationServiceSearchRequest) GetQuery() *string { + if s == nil { + return nil + } + return s.Query +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicesearchresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicesearchresponse.go new file mode 100644 index 00000000..7c2ac2d1 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationservicesearchresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceSearchResponse returns matching SSO applications. +type SSOApplicationServiceSearchResponse struct { + // Matching SSO applications. + List []SSOApplication `json:"list,omitempty"` + // Token for the next page. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (s *SSOApplicationServiceSearchResponse) GetList() []SSOApplication { + if s == nil { + return nil + } + return s.List +} + +func (s *SSOApplicationServiceSearchResponse) GetNextPageToken() *string { + if s == nil { + return nil + } + return s.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateclientrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateclientrequest.go new file mode 100644 index 00000000..695fe912 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateclientrequest.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceUpdateClientRequest replaces display name, redirect +// +// URIs, private-key JWKS, or tightens legacy PKCE to required. +type SSOApplicationServiceUpdateClientRequest struct { + Client *SSOApplicationOIDCClientConfig `json:"client"` + // Generated client ID to update. + ClientID string `json:"clientId"` +} + +func (s *SSOApplicationServiceUpdateClientRequest) GetClient() *SSOApplicationOIDCClientConfig { + if s == nil { + return nil + } + return s.Client +} + +func (s *SSOApplicationServiceUpdateClientRequest) GetClientID() string { + if s == nil { + return "" + } + return s.ClientID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateclientresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateclientresponse.go new file mode 100644 index 00000000..d07ab615 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateclientresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceUpdateClientResponse contains the updated client. +type SSOApplicationServiceUpdateClientResponse struct { + Client *SSOApplicationOIDCClient `json:"client,omitempty"` +} + +func (s *SSOApplicationServiceUpdateClientResponse) GetClient() *SSOApplicationOIDCClient { + if s == nil { + return nil + } + return s.Client +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdaterequest.go new file mode 100644 index 00000000..650b409c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdaterequest.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceUpdateRequest updates an SSO application. +type SSOApplicationServiceUpdateRequest struct { + Application *SSOApplication `json:"application"` + UpdateMask *string `json:"updateMask"` +} + +func (s *SSOApplicationServiceUpdateRequest) GetApplication() *SSOApplication { + if s == nil { + return nil + } + return s.Application +} + +func (s *SSOApplicationServiceUpdateRequest) GetUpdateMask() *string { + if s == nil { + return nil + } + return s.UpdateMask +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateresponse.go new file mode 100644 index 00000000..03f3d2d9 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssoapplicationserviceupdateresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOApplicationServiceUpdateResponse returns the updated SSO application. +type SSOApplicationServiceUpdateResponse struct { + Application *SSOApplication `json:"application,omitempty"` +} + +func (s *SSOApplicationServiceUpdateResponse) GetApplication() *SSOApplication { + if s == nil { + return nil + } + return s.Application +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettings.go new file mode 100644 index 00000000..80f9f629 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettings.go @@ -0,0 +1,137 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// DefaultIDTokenSignedResponseAlg - The id_token signing algorithm applied to OIDC applications that do not +// +// choose one. When unset, the server uses EdDSA. +type DefaultIDTokenSignedResponseAlg string + +const ( + DefaultIDTokenSignedResponseAlgOidcSigningAlgorithmUnspecified DefaultIDTokenSignedResponseAlg = "OIDC_SIGNING_ALGORITHM_UNSPECIFIED" + DefaultIDTokenSignedResponseAlgOidcSigningAlgorithmEddsa DefaultIDTokenSignedResponseAlg = "OIDC_SIGNING_ALGORITHM_EDDSA" + DefaultIDTokenSignedResponseAlgOidcSigningAlgorithmEs256 DefaultIDTokenSignedResponseAlg = "OIDC_SIGNING_ALGORITHM_ES256" + DefaultIDTokenSignedResponseAlgOidcSigningAlgorithmRs256 DefaultIDTokenSignedResponseAlg = "OIDC_SIGNING_ALGORITHM_RS256" +) + +func (e DefaultIDTokenSignedResponseAlg) ToPointer() *DefaultIDTokenSignedResponseAlg { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DefaultIDTokenSignedResponseAlg) IsExact() bool { + if e != nil { + switch *e { + case "OIDC_SIGNING_ALGORITHM_UNSPECIFIED", "OIDC_SIGNING_ALGORITHM_EDDSA", "OIDC_SIGNING_ALGORITHM_ES256", "OIDC_SIGNING_ALGORITHM_RS256": + return true + } + } + return false +} + +// DefaultSubjectType - The subject type materialized onto new SSO applications that do not choose +// +// one. Changing this default does not change existing applications. When +// unset, the server uses pairwise subjects. +type DefaultSubjectType string + +const ( + DefaultSubjectTypeSsoSubjectTypeUnspecified DefaultSubjectType = "SSO_SUBJECT_TYPE_UNSPECIFIED" + DefaultSubjectTypeSsoSubjectTypePairwise DefaultSubjectType = "SSO_SUBJECT_TYPE_PAIRWISE" + DefaultSubjectTypeSsoSubjectTypePublic DefaultSubjectType = "SSO_SUBJECT_TYPE_PUBLIC" + DefaultSubjectTypeSsoSubjectTypeCompatibility DefaultSubjectType = "SSO_SUBJECT_TYPE_COMPATIBILITY" +) + +func (e DefaultSubjectType) ToPointer() *DefaultSubjectType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DefaultSubjectType) IsExact() bool { + if e != nil { + switch *e { + case "SSO_SUBJECT_TYPE_UNSPECIFIED", "SSO_SUBJECT_TYPE_PAIRWISE", "SSO_SUBJECT_TYPE_PUBLIC", "SSO_SUBJECT_TYPE_COMPATIBILITY": + return true + } + } + return false +} + +// SSOSettings is the per-tenant configuration for ConductorOne acting as an SSO +// +// provider. +type SSOSettings struct { + CreatedAt *time.Time `json:"createdAt,omitempty"` + DefaultAssertionLifetime *string `json:"defaultAssertionLifetime,omitempty"` + // The id_token signing algorithm applied to OIDC applications that do not + // choose one. When unset, the server uses EdDSA. + DefaultIDTokenSignedResponseAlg *DefaultIDTokenSignedResponseAlg `json:"defaultIdTokenSignedResponseAlg,omitempty"` + // The subject type materialized onto new SSO applications that do not choose + // one. Changing this default does not change existing applications. When + // unset, the server uses pairwise subjects. + DefaultSubjectType *DefaultSubjectType `json:"defaultSubjectType,omitempty"` + // Master switch for the SSO provider. ConductorOne also gates the feature + // behind an operator-controlled rollout flag; this is the tenant + // administrator's intent. Individual SSO applications can still be disabled + // one at a time. + Enabled *bool `json:"enabled,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (s SSOSettings) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SSOSettings) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SSOSettings) GetCreatedAt() *time.Time { + if s == nil { + return nil + } + return s.CreatedAt +} + +func (s *SSOSettings) GetDefaultAssertionLifetime() *string { + if s == nil { + return nil + } + return s.DefaultAssertionLifetime +} + +func (s *SSOSettings) GetDefaultIDTokenSignedResponseAlg() *DefaultIDTokenSignedResponseAlg { + if s == nil { + return nil + } + return s.DefaultIDTokenSignedResponseAlg +} + +func (s *SSOSettings) GetDefaultSubjectType() *DefaultSubjectType { + if s == nil { + return nil + } + return s.DefaultSubjectType +} + +func (s *SSOSettings) GetEnabled() *bool { + if s == nil { + return nil + } + return s.Enabled +} + +func (s *SSOSettings) GetUpdatedAt() *time.Time { + if s == nil { + return nil + } + return s.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingshistoryentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingshistoryentry.go new file mode 100644 index 00000000..d4ca5e22 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingshistoryentry.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOSettingsHistoryEntry is one version of the tenant's SSO settings and its +// +// change metadata. +type SSOSettingsHistoryEntry struct { + Metadata *HistoryEntryMetadata `json:"metadata,omitempty"` + Snapshot *SSOSettings `json:"snapshot,omitempty"` +} + +func (s *SSOSettingsHistoryEntry) GetMetadata() *HistoryEntryMetadata { + if s == nil { + return nil + } + return s.Metadata +} + +func (s *SSOSettingsHistoryEntry) GetSnapshot() *SSOSettings { + if s == nil { + return nil + } + return s.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsservicegetresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsservicegetresponse.go new file mode 100644 index 00000000..7b2f8583 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsservicegetresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOSettingsServiceGetResponse returns the tenant's SSO provider settings. +type SSOSettingsServiceGetResponse struct { + Settings *SSOSettings `json:"settings,omitempty"` +} + +func (s *SSOSettingsServiceGetResponse) GetSettings() *SSOSettings { + if s == nil { + return nil + } + return s.Settings +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsservicelisthistoryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsservicelisthistoryresponse.go new file mode 100644 index 00000000..052f6cdc --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsservicelisthistoryresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOSettingsServiceListHistoryResponse returns SSO settings history entries. +type SSOSettingsServiceListHistoryResponse struct { + // The page of history entries, newest first. + List []SSOSettingsHistoryEntry `json:"list,omitempty"` + // Pagination token for the next page, or empty if there are no more results. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (s *SSOSettingsServiceListHistoryResponse) GetList() []SSOSettingsHistoryEntry { + if s == nil { + return nil + } + return s.List +} + +func (s *SSOSettingsServiceListHistoryResponse) GetNextPageToken() *string { + if s == nil { + return nil + } + return s.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsserviceupdaterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsserviceupdaterequest.go new file mode 100644 index 00000000..25dbb80b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsserviceupdaterequest.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOSettingsServiceUpdateRequest updates the tenant's SSO provider settings. +type SSOSettingsServiceUpdateRequest struct { + Settings *SSOSettings `json:"settings"` + UpdateMask *string `json:"updateMask"` +} + +func (s *SSOSettingsServiceUpdateRequest) GetSettings() *SSOSettings { + if s == nil { + return nil + } + return s.Settings +} + +func (s *SSOSettingsServiceUpdateRequest) GetUpdateMask() *string { + if s == nil { + return nil + } + return s.UpdateMask +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsserviceupdateresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsserviceupdateresponse.go new file mode 100644 index 00000000..4027a7ff --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosettingsserviceupdateresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOSettingsServiceUpdateResponse returns the updated settings. +type SSOSettingsServiceUpdateResponse struct { + Settings *SSOSettings `json:"settings,omitempty"` +} + +func (s *SSOSettingsServiceUpdateResponse) GetSettings() *SSOSettings { + if s == nil { + return nil + } + return s.Settings +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibility.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibility.go new file mode 100644 index 00000000..f0f40442 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibility.go @@ -0,0 +1,21 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOSubjectCompatibility configures preservation of subjects issued by a +// +// previous identity provider. +type SSOSubjectCompatibility struct { + // Optional user-attribute mapping used to resolve a legacy subject on first + // sign-in. The resolved value is frozen in an immutable per-user binding. + // Correct the source attribute before deleting an attribute-derived binding; + // otherwise the next sign-in resolves and freezes the same value again. + UserAttributeMappingID *string `json:"userAttributeMappingId,omitempty"` +} + +func (s *SSOSubjectCompatibility) GetUserAttributeMappingID() *string { + if s == nil { + return nil + } + return s.UserAttributeMappingID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilitydeleteissue.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilitydeleteissue.go new file mode 100644 index 00000000..55b6ddda --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilitydeleteissue.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOSubjectCompatibilityDeleteIssue describes one compatibility binding that +// +// could not be deleted. +type SSOSubjectCompatibilityDeleteIssue struct { + // The reason field. + Reason *string `json:"reason,omitempty"` + // The userId field. + UserID *string `json:"userId,omitempty"` +} + +func (s *SSOSubjectCompatibilityDeleteIssue) GetReason() *string { + if s == nil { + return nil + } + return s.Reason +} + +func (s *SSOSubjectCompatibilityDeleteIssue) GetUserID() *string { + if s == nil { + return nil + } + return s.UserID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilityimportentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilityimportentry.go new file mode 100644 index 00000000..8dace5ed --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilityimportentry.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOSubjectCompatibilityImportEntry is one client-parsed source row. +type SSOSubjectCompatibilityImportEntry struct { + // One-based row number in the source file, including its header. + Row *int `json:"row,omitempty"` + // Exact legacy subject. C1 preserves these UTF-8 bytes without trimming. + Subject *string `json:"subject,omitempty"` + // ConductorOne user ID resolved by the client before this batch is sent. + UserID *string `json:"userId,omitempty"` +} + +func (s *SSOSubjectCompatibilityImportEntry) GetRow() *int { + if s == nil { + return nil + } + return s.Row +} + +func (s *SSOSubjectCompatibilityImportEntry) GetSubject() *string { + if s == nil { + return nil + } + return s.Subject +} + +func (s *SSOSubjectCompatibilityImportEntry) GetUserID() *string { + if s == nil { + return nil + } + return s.UserID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilityimportissue.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilityimportissue.go new file mode 100644 index 00000000..69d35bfe --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/ssosubjectcompatibilityimportissue.go @@ -0,0 +1,45 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SSOSubjectCompatibilityImportIssue describes one CSV row that cannot be +// +// imported. +type SSOSubjectCompatibilityImportIssue struct { + // Human-readable reason this row cannot be imported. + Reason *string `json:"reason,omitempty"` + // One-based CSV row number, including the header row. + Row *int `json:"row,omitempty"` + // Legacy subject supplied by the batch entry. + Subject *string `json:"subject,omitempty"` + // ConductorOne user ID supplied by the batch entry. + UserID *string `json:"userId,omitempty"` +} + +func (s *SSOSubjectCompatibilityImportIssue) GetReason() *string { + if s == nil { + return nil + } + return s.Reason +} + +func (s *SSOSubjectCompatibilityImportIssue) GetRow() *int { + if s == nil { + return nil + } + return s.Row +} + +func (s *SSOSubjectCompatibilityImportIssue) GetSubject() *string { + if s == nil { + return nil + } + return s.Subject +} + +func (s *SSOSubjectCompatibilityImportIssue) GetUserID() *string { + if s == nil { + return nil + } + return s.UserID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimit.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimit.go new file mode 100644 index 00000000..1f9dc099 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimit.go @@ -0,0 +1,85 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// SubjectAppLimit is one subject's per-app limit row as the admin plane +// +// renders it. The subject is named explicitly, unlike MyFundLimit, which is +// always the caller's. +type SubjectAppLimit struct { + // The C1 App this limit applies to. + AppID *string `json:"appId,omitempty"` + Controls *SpendControls `json:"controls,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + // The tenantId field. + TenantID *string `json:"tenantId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Canonical c1.models.user.v2.User id. + UserID *string `json:"userId,omitempty"` +} + +func (s SubjectAppLimit) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SubjectAppLimit) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SubjectAppLimit) GetAppID() *string { + if s == nil { + return nil + } + return s.AppID +} + +func (s *SubjectAppLimit) GetControls() *SpendControls { + if s == nil { + return nil + } + return s.Controls +} + +func (s *SubjectAppLimit) GetCreatedAt() *time.Time { + if s == nil { + return nil + } + return s.CreatedAt +} + +func (s *SubjectAppLimit) GetDeletedAt() *time.Time { + if s == nil { + return nil + } + return s.DeletedAt +} + +func (s *SubjectAppLimit) GetTenantID() *string { + if s == nil { + return nil + } + return s.TenantID +} + +func (s *SubjectAppLimit) GetUpdatedAt() *time.Time { + if s == nil { + return nil + } + return s.UpdatedAt +} + +func (s *SubjectAppLimit) GetUserID() *string { + if s == nil { + return nil + } + return s.UserID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimithistoryentry.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimithistoryentry.go new file mode 100644 index 00000000..e975b414 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimithistoryentry.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitHistoryEntry message. +type SubjectAppLimitHistoryEntry struct { + Metadata *HistoryEntryMetadata `json:"metadata,omitempty"` + Snapshot *SubjectAppLimit `json:"snapshot,omitempty"` +} + +func (s *SubjectAppLimitHistoryEntry) GetMetadata() *HistoryEntryMetadata { + if s == nil { + return nil + } + return s.Metadata +} + +func (s *SubjectAppLimitHistoryEntry) GetSnapshot() *SubjectAppLimit { + if s == nil { + return nil + } + return s.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicedeleterequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicedeleterequest.go new file mode 100644 index 00000000..22c5d4b1 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicedeleterequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceDeleteRequest message. +type SubjectAppLimitServiceDeleteRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicedeleteresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicedeleteresponse.go new file mode 100644 index 00000000..7ab790cc --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicedeleteresponse.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceDeleteResponse message. +type SubjectAppLimitServiceDeleteResponse struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicegetresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicegetresponse.go new file mode 100644 index 00000000..b8f38809 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicegetresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceGetResponse message. +type SubjectAppLimitServiceGetResponse struct { + Limit *SubjectAppLimit `json:"limit,omitempty"` +} + +func (s *SubjectAppLimitServiceGetResponse) GetLimit() *SubjectAppLimit { + if s == nil { + return nil + } + return s.Limit +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicelisthistoryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicelisthistoryresponse.go new file mode 100644 index 00000000..8c3c7d18 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicelisthistoryresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceListHistoryResponse message. +type SubjectAppLimitServiceListHistoryResponse struct { + // The list field. + List []SubjectAppLimitHistoryEntry `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (s *SubjectAppLimitServiceListHistoryResponse) GetList() []SubjectAppLimitHistoryEntry { + if s == nil { + return nil + } + return s.List +} + +func (s *SubjectAppLimitServiceListHistoryResponse) GetNextPageToken() *string { + if s == nil { + return nil + } + return s.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesearchrequest.go new file mode 100644 index 00000000..bdba1a8f --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesearchrequest.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceSearchRequest message. +type SubjectAppLimitServiceSearchRequest struct { + // Restrict to these apps; empty returns every app. + AppIds []string `json:"appIds,omitempty"` + // The pageSize field. + PageSize *int `json:"pageSize,omitempty"` + // The pageToken field. + PageToken *string `json:"pageToken,omitempty"` + States *SubjectAppLimitStateFilter `json:"states,omitempty"` + // Restrict to these subjects; empty returns every row in the tenant. + UserIds []string `json:"userIds,omitempty"` +} + +func (s *SubjectAppLimitServiceSearchRequest) GetAppIds() []string { + if s == nil { + return nil + } + return s.AppIds +} + +func (s *SubjectAppLimitServiceSearchRequest) GetPageSize() *int { + if s == nil { + return nil + } + return s.PageSize +} + +func (s *SubjectAppLimitServiceSearchRequest) GetPageToken() *string { + if s == nil { + return nil + } + return s.PageToken +} + +func (s *SubjectAppLimitServiceSearchRequest) GetStates() *SubjectAppLimitStateFilter { + if s == nil { + return nil + } + return s.States +} + +func (s *SubjectAppLimitServiceSearchRequest) GetUserIds() []string { + if s == nil { + return nil + } + return s.UserIds +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesearchresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesearchresponse.go new file mode 100644 index 00000000..13d5354c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesearchresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceSearchResponse message. +type SubjectAppLimitServiceSearchResponse struct { + // The list field. + List []SubjectAppLimit `json:"list,omitempty"` + // The nextPageToken field. + NextPageToken *string `json:"nextPageToken,omitempty"` +} + +func (s *SubjectAppLimitServiceSearchResponse) GetList() []SubjectAppLimit { + if s == nil { + return nil + } + return s.List +} + +func (s *SubjectAppLimitServiceSearchResponse) GetNextPageToken() *string { + if s == nil { + return nil + } + return s.NextPageToken +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesetlimitrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesetlimitrequest.go new file mode 100644 index 00000000..32ffa78c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesetlimitrequest.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SubjectAppLimitServiceSetLimitRequestPeriod - Optional period override. Only valid together with the limit it denominates. +type SubjectAppLimitServiceSetLimitRequestPeriod string + +const ( + SubjectAppLimitServiceSetLimitRequestPeriodPeriodKindUnspecified SubjectAppLimitServiceSetLimitRequestPeriod = "PERIOD_KIND_UNSPECIFIED" + SubjectAppLimitServiceSetLimitRequestPeriodPeriodKindDaily SubjectAppLimitServiceSetLimitRequestPeriod = "PERIOD_KIND_DAILY" + SubjectAppLimitServiceSetLimitRequestPeriodPeriodKindWeekly SubjectAppLimitServiceSetLimitRequestPeriod = "PERIOD_KIND_WEEKLY" + SubjectAppLimitServiceSetLimitRequestPeriodPeriodKindMonthly SubjectAppLimitServiceSetLimitRequestPeriod = "PERIOD_KIND_MONTHLY" + SubjectAppLimitServiceSetLimitRequestPeriodPeriodKindQuarterly SubjectAppLimitServiceSetLimitRequestPeriod = "PERIOD_KIND_QUARTERLY" + SubjectAppLimitServiceSetLimitRequestPeriodPeriodKindYearly SubjectAppLimitServiceSetLimitRequestPeriod = "PERIOD_KIND_YEARLY" +) + +func (e SubjectAppLimitServiceSetLimitRequestPeriod) ToPointer() *SubjectAppLimitServiceSetLimitRequestPeriod { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SubjectAppLimitServiceSetLimitRequestPeriod) IsExact() bool { + if e != nil { + switch *e { + case "PERIOD_KIND_UNSPECIFIED", "PERIOD_KIND_DAILY", "PERIOD_KIND_WEEKLY", "PERIOD_KIND_MONTHLY", "PERIOD_KIND_QUARTERLY", "PERIOD_KIND_YEARLY": + return true + } + } + return false +} + +// The SubjectAppLimitServiceSetLimitRequest message. +type SubjectAppLimitServiceSetLimitRequest struct { + Limit *SpendLimit `json:"limit,omitempty"` + // Optional period override. Only valid together with the limit it denominates. + Period *SubjectAppLimitServiceSetLimitRequestPeriod `json:"period,omitempty"` +} + +func (s *SubjectAppLimitServiceSetLimitRequest) GetLimit() *SpendLimit { + if s == nil { + return nil + } + return s.Limit +} + +func (s *SubjectAppLimitServiceSetLimitRequest) GetPeriod() *SubjectAppLimitServiceSetLimitRequestPeriod { + if s == nil { + return nil + } + return s.Period +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesetlimitresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesetlimitresponse.go new file mode 100644 index 00000000..4b39080d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesetlimitresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceSetLimitResponse message. +type SubjectAppLimitServiceSetLimitResponse struct { + Limit *SubjectAppLimit `json:"limit,omitempty"` +} + +func (s *SubjectAppLimitServiceSetLimitResponse) GetLimit() *SubjectAppLimit { + if s == nil { + return nil + } + return s.Limit +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesuspendrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesuspendrequest.go new file mode 100644 index 00000000..9d1006d3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesuspendrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceSuspendRequest message. +type SubjectAppLimitServiceSuspendRequest struct { + // The reason field. + Reason *string `json:"reason,omitempty"` +} + +func (s *SubjectAppLimitServiceSuspendRequest) GetReason() *string { + if s == nil { + return nil + } + return s.Reason +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesuspendresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesuspendresponse.go new file mode 100644 index 00000000..0d580372 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitservicesuspendresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceSuspendResponse message. +type SubjectAppLimitServiceSuspendResponse struct { + Limit *SubjectAppLimit `json:"limit,omitempty"` +} + +func (s *SubjectAppLimitServiceSuspendResponse) GetLimit() *SubjectAppLimit { + if s == nil { + return nil + } + return s.Limit +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitserviceunsuspendrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitserviceunsuspendrequest.go new file mode 100644 index 00000000..125f9595 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitserviceunsuspendrequest.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceUnsuspendRequest message. +type SubjectAppLimitServiceUnsuspendRequest struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitserviceunsuspendresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitserviceunsuspendresponse.go new file mode 100644 index 00000000..a3e0083c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitserviceunsuspendresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SubjectAppLimitServiceUnsuspendResponse message. +type SubjectAppLimitServiceUnsuspendResponse struct { + Limit *SubjectAppLimit `json:"limit,omitempty"` +} + +func (s *SubjectAppLimitServiceUnsuspendResponse) GetLimit() *SubjectAppLimit { + if s == nil { + return nil + } + return s.Limit +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitstatefilter.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitstatefilter.go new file mode 100644 index 00000000..826d7627 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/subjectapplimitstatefilter.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// SubjectAppLimitStateFilter is the structured state filter. The three states +// +// are mutually exclusive by construction: suspended is suspension present; +// explicit-limit is suspension absent AND limit present; inheriting is +// neither. Combining them is a union. Unset (all false) does not filter by +// state at all. +type SubjectAppLimitStateFilter struct { + // No suspension and a limit arm is present, whatever it states. True for + // the seeded support case: "show me everyone with an explicit per-app + // number". + ExplicitLimit *bool `json:"explicitLimit,omitempty"` + // No suspension and no limit: the row exists but states no opinion, so + // resolution falls through it. No compliant write persists such a row — + // the clearing verbs delete it — so a match is a legacy or corrupt row, + // which is exactly what an admin auditing "which rows are doing nothing" + // needs the filter to surface. + Inheriting *bool `json:"inheriting,omitempty"` + // A suspension is present: the app is paused for this subject. A row that + // also carries a limit is still suspended — the suspension is what its + // subject experiences. + Suspended *bool `json:"suspended,omitempty"` +} + +func (s *SubjectAppLimitStateFilter) GetExplicitLimit() *bool { + if s == nil { + return nil + } + return s.ExplicitLimit +} + +func (s *SubjectAppLimitStateFilter) GetInheriting() *bool { + if s == nil { + return nil + } + return s.Inheriting +} + +func (s *SubjectAppLimitStateFilter) GetSuspended() *bool { + if s == nil { + return nil + } + return s.Suspended +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/submittedtaskaction.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/submittedtaskaction.go index d00f9ae8..b2511b62 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/submittedtaskaction.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/submittedtaskaction.go @@ -38,6 +38,7 @@ const ( ActionTypeTaskActionTypeRollbackCancelled ActionType = "TASK_ACTION_TYPE_ROLLBACK_CANCELLED" ActionTypeTaskActionTypeUpdateRequestData ActionType = "TASK_ACTION_TYPE_UPDATE_REQUEST_DATA" ActionTypeTaskActionTypeUpdateGrantDuration ActionType = "TASK_ACTION_TYPE_UPDATE_GRANT_DURATION" + ActionTypeTaskActionTypeRetryProvisioning ActionType = "TASK_ACTION_TYPE_RETRY_PROVISIONING" ) func (e ActionType) ToPointer() *ActionType { @@ -48,7 +49,7 @@ func (e ActionType) ToPointer() *ActionType { func (e *ActionType) IsExact() bool { if e != nil { switch *e { - case "TASK_ACTION_TYPE_UNSPECIFIED", "TASK_ACTION_TYPE_CLOSE", "TASK_ACTION_TYPE_APPROVE", "TASK_ACTION_TYPE_DENY", "TASK_ACTION_TYPE_COMMENT", "TASK_ACTION_TYPE_DELETE", "TASK_ACTION_TYPE_REASSIGN", "TASK_ACTION_TYPE_RESTART", "TASK_ACTION_TYPE_SEND_REMINDER", "TASK_ACTION_TYPE_PROVISION_COMPLETE", "TASK_ACTION_TYPE_PROVISION_CANCELLED", "TASK_ACTION_TYPE_PROVISION_ERRORED", "TASK_ACTION_TYPE_ROLLBACK_SKIPPED", "TASK_ACTION_TYPE_PROVISION_APP_USER_TARGET_CREATED", "TASK_ACTION_TYPE_HARD_RESET", "TASK_ACTION_TYPE_ESCALATE_TO_EMERGENCY_ACCESS", "TASK_ACTION_TYPE_CHANGE_POLICY", "TASK_ACTION_TYPE_RECALCULATE_DENIAL_FROM_BASE_POLICY_DECISIONS", "TASK_ACTION_TYPE_SET_INSIGHTS_AND_RECOMMENDATION", "TASK_ACTION_TYPE_SET_ANALYSIS_ID", "TASK_ACTION_TYPE_RECALCULATE_APPROVERS_LIST", "TASK_ACTION_TYPE_PROCESS_NOW", "TASK_ACTION_TYPE_APPROVE_WITH_STEP_UP", "TASK_ACTION_TYPE_SKIP_STEP", "TASK_ACTION_TYPE_ROLLBACK_CANCELLED", "TASK_ACTION_TYPE_UPDATE_REQUEST_DATA", "TASK_ACTION_TYPE_UPDATE_GRANT_DURATION": + case "TASK_ACTION_TYPE_UNSPECIFIED", "TASK_ACTION_TYPE_CLOSE", "TASK_ACTION_TYPE_APPROVE", "TASK_ACTION_TYPE_DENY", "TASK_ACTION_TYPE_COMMENT", "TASK_ACTION_TYPE_DELETE", "TASK_ACTION_TYPE_REASSIGN", "TASK_ACTION_TYPE_RESTART", "TASK_ACTION_TYPE_SEND_REMINDER", "TASK_ACTION_TYPE_PROVISION_COMPLETE", "TASK_ACTION_TYPE_PROVISION_CANCELLED", "TASK_ACTION_TYPE_PROVISION_ERRORED", "TASK_ACTION_TYPE_ROLLBACK_SKIPPED", "TASK_ACTION_TYPE_PROVISION_APP_USER_TARGET_CREATED", "TASK_ACTION_TYPE_HARD_RESET", "TASK_ACTION_TYPE_ESCALATE_TO_EMERGENCY_ACCESS", "TASK_ACTION_TYPE_CHANGE_POLICY", "TASK_ACTION_TYPE_RECALCULATE_DENIAL_FROM_BASE_POLICY_DECISIONS", "TASK_ACTION_TYPE_SET_INSIGHTS_AND_RECOMMENDATION", "TASK_ACTION_TYPE_SET_ANALYSIS_ID", "TASK_ACTION_TYPE_RECALCULATE_APPROVERS_LIST", "TASK_ACTION_TYPE_PROCESS_NOW", "TASK_ACTION_TYPE_APPROVE_WITH_STEP_UP", "TASK_ACTION_TYPE_SKIP_STEP", "TASK_ACTION_TYPE_ROLLBACK_CANCELLED", "TASK_ACTION_TYPE_UPDATE_REQUEST_DATA", "TASK_ACTION_TYPE_UPDATE_GRANT_DURATION", "TASK_ACTION_TYPE_RETRY_PROVISIONING": return true } } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/systempreference.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/systempreference.go new file mode 100644 index 00000000..cac10433 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/systempreference.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The SystemPreference message. +type SystemPreference struct { + // The enabled field. + Enabled *bool `json:"enabled,omitempty"` + // The locked field. + Locked *bool `json:"locked,omitempty"` +} + +func (s *SystemPreference) GetEnabled() *bool { + if s == nil { + return nil + } + return s.Enabled +} + +func (s *SystemPreference) GetLocked() *bool { + if s == nil { + return nil + } + return s.Locked +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/task.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/task.go index e4318092..2ed14bc0 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/task.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/task.go @@ -37,6 +37,7 @@ const ( ActionsTaskActionTypeRollbackCancelled Actions = "TASK_ACTION_TYPE_ROLLBACK_CANCELLED" ActionsTaskActionTypeUpdateRequestData Actions = "TASK_ACTION_TYPE_UPDATE_REQUEST_DATA" ActionsTaskActionTypeUpdateGrantDuration Actions = "TASK_ACTION_TYPE_UPDATE_GRANT_DURATION" + ActionsTaskActionTypeRetryProvisioning Actions = "TASK_ACTION_TYPE_RETRY_PROVISIONING" ) func (e Actions) ToPointer() *Actions { @@ -47,7 +48,7 @@ func (e Actions) ToPointer() *Actions { func (e *Actions) IsExact() bool { if e != nil { switch *e { - case "TASK_ACTION_TYPE_UNSPECIFIED", "TASK_ACTION_TYPE_CLOSE", "TASK_ACTION_TYPE_APPROVE", "TASK_ACTION_TYPE_DENY", "TASK_ACTION_TYPE_COMMENT", "TASK_ACTION_TYPE_DELETE", "TASK_ACTION_TYPE_REASSIGN", "TASK_ACTION_TYPE_RESTART", "TASK_ACTION_TYPE_SEND_REMINDER", "TASK_ACTION_TYPE_PROVISION_COMPLETE", "TASK_ACTION_TYPE_PROVISION_CANCELLED", "TASK_ACTION_TYPE_PROVISION_ERRORED", "TASK_ACTION_TYPE_ROLLBACK_SKIPPED", "TASK_ACTION_TYPE_PROVISION_APP_USER_TARGET_CREATED", "TASK_ACTION_TYPE_HARD_RESET", "TASK_ACTION_TYPE_ESCALATE_TO_EMERGENCY_ACCESS", "TASK_ACTION_TYPE_CHANGE_POLICY", "TASK_ACTION_TYPE_RECALCULATE_DENIAL_FROM_BASE_POLICY_DECISIONS", "TASK_ACTION_TYPE_SET_INSIGHTS_AND_RECOMMENDATION", "TASK_ACTION_TYPE_SET_ANALYSIS_ID", "TASK_ACTION_TYPE_RECALCULATE_APPROVERS_LIST", "TASK_ACTION_TYPE_PROCESS_NOW", "TASK_ACTION_TYPE_APPROVE_WITH_STEP_UP", "TASK_ACTION_TYPE_SKIP_STEP", "TASK_ACTION_TYPE_ROLLBACK_CANCELLED", "TASK_ACTION_TYPE_UPDATE_REQUEST_DATA", "TASK_ACTION_TYPE_UPDATE_GRANT_DURATION": + case "TASK_ACTION_TYPE_UNSPECIFIED", "TASK_ACTION_TYPE_CLOSE", "TASK_ACTION_TYPE_APPROVE", "TASK_ACTION_TYPE_DENY", "TASK_ACTION_TYPE_COMMENT", "TASK_ACTION_TYPE_DELETE", "TASK_ACTION_TYPE_REASSIGN", "TASK_ACTION_TYPE_RESTART", "TASK_ACTION_TYPE_SEND_REMINDER", "TASK_ACTION_TYPE_PROVISION_COMPLETE", "TASK_ACTION_TYPE_PROVISION_CANCELLED", "TASK_ACTION_TYPE_PROVISION_ERRORED", "TASK_ACTION_TYPE_ROLLBACK_SKIPPED", "TASK_ACTION_TYPE_PROVISION_APP_USER_TARGET_CREATED", "TASK_ACTION_TYPE_HARD_RESET", "TASK_ACTION_TYPE_ESCALATE_TO_EMERGENCY_ACCESS", "TASK_ACTION_TYPE_CHANGE_POLICY", "TASK_ACTION_TYPE_RECALCULATE_DENIAL_FROM_BASE_POLICY_DECISIONS", "TASK_ACTION_TYPE_SET_INSIGHTS_AND_RECOMMENDATION", "TASK_ACTION_TYPE_SET_ANALYSIS_ID", "TASK_ACTION_TYPE_RECALCULATE_APPROVERS_LIST", "TASK_ACTION_TYPE_PROCESS_NOW", "TASK_ACTION_TYPE_APPROVE_WITH_STEP_UP", "TASK_ACTION_TYPE_SKIP_STEP", "TASK_ACTION_TYPE_ROLLBACK_CANCELLED", "TASK_ACTION_TYPE_UPDATE_REQUEST_DATA", "TASK_ACTION_TYPE_UPDATE_GRANT_DURATION", "TASK_ACTION_TYPE_RETRY_PROVISIONING": return true } } diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskactionsserviceretryprovisioningrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskactionsserviceretryprovisioningrequest.go new file mode 100644 index 00000000..31ecddc6 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskactionsserviceretryprovisioningrequest.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// TaskActionsServiceRetryProvisioningRequest - Request to retry a task's failed connector provisioning. +type TaskActionsServiceRetryProvisioningRequest struct { + // An optional comment attached to the action. + Comment *string `json:"comment,omitempty"` + ExpandMask *TaskExpandMask `json:"expandMask,omitempty"` + // The ID of the provision policy step to retry. + PolicyStepID *string `json:"policyStepId,omitempty"` +} + +func (t *TaskActionsServiceRetryProvisioningRequest) GetComment() *string { + if t == nil { + return nil + } + return t.Comment +} + +func (t *TaskActionsServiceRetryProvisioningRequest) GetExpandMask() *TaskExpandMask { + if t == nil { + return nil + } + return t.ExpandMask +} + +func (t *TaskActionsServiceRetryProvisioningRequest) GetPolicyStepID() *string { + if t == nil { + return nil + } + return t.PolicyStepID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditaccountdeleted.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditaccountdeleted.go new file mode 100644 index 00000000..c5c69ef3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditaccountdeleted.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// TaskAuditAccountDeleted records an account deletion reported by a connector +// +// while completing a revoke action. +type TaskAuditAccountDeleted struct { + // The appId field. + AppID *string `json:"appId,omitempty"` + // The appUserId field. + AppUserID *string `json:"appUserId,omitempty"` + // The connectorResourceId field. + ConnectorResourceID *string `json:"connectorResourceId,omitempty"` + // The displayName field. + DisplayName *string `json:"displayName,omitempty"` + // The email field. + Email *string `json:"email,omitempty"` + // The username field. + Username *string `json:"username,omitempty"` +} + +func (t *TaskAuditAccountDeleted) GetAppID() *string { + if t == nil { + return nil + } + return t.AppID +} + +func (t *TaskAuditAccountDeleted) GetAppUserID() *string { + if t == nil { + return nil + } + return t.AppUserID +} + +func (t *TaskAuditAccountDeleted) GetConnectorResourceID() *string { + if t == nil { + return nil + } + return t.ConnectorResourceID +} + +func (t *TaskAuditAccountDeleted) GetDisplayName() *string { + if t == nil { + return nil + } + return t.DisplayName +} + +func (t *TaskAuditAccountDeleted) GetEmail() *string { + if t == nil { + return nil + } + return t.Email +} + +func (t *TaskAuditAccountDeleted) GetUsername() *string { + if t == nil { + return nil + } + return t.Username +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditautomationtriggered.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditautomationtriggered.go new file mode 100644 index 00000000..a356df92 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditautomationtriggered.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" +) + +// TaskAuditAutomationTriggered attributes a system-created task to the +// +// automation execution that created it. +type TaskAuditAutomationTriggered struct { + // The specific execution of the automation that created the task. + AutomationExecutionID *int64 `integer:"string" json:"automationExecutionId,omitempty"` + // The automation that created the task. + AutomationID *string `json:"automationId,omitempty"` + // The automation's display name as of task creation, so the event stays + // readable after the automation is renamed or deleted. + AutomationName *string `json:"automationName,omitempty"` +} + +func (t TaskAuditAutomationTriggered) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskAuditAutomationTriggered) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TaskAuditAutomationTriggered) GetAutomationExecutionID() *int64 { + if t == nil { + return nil + } + return t.AutomationExecutionID +} + +func (t *TaskAuditAutomationTriggered) GetAutomationID() *string { + if t == nil { + return nil + } + return t.AutomationID +} + +func (t *TaskAuditAutomationTriggered) GetAutomationName() *string { + if t == nil { + return nil + } + return t.AutomationName +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditconditionalpolicyexecutionresult.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditconditionalpolicyexecutionresult.go index 72ee081f..8e803778 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditconditionalpolicyexecutionresult.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditconditionalpolicyexecutionresult.go @@ -4,6 +4,8 @@ package shared // The TaskAuditConditionalPolicyExecutionResult message. type TaskAuditConditionalPolicyExecutionResult struct { + // The depth of this policy in the chain (0 = root, 1 = first hop, etc.). + ChainDepth *int `json:"chainDepth,omitempty"` // The condition field. Condition *string `json:"condition,omitempty"` // The conditionMatched field. @@ -12,10 +14,24 @@ type TaskAuditConditionalPolicyExecutionResult struct { DefaultCondition *bool `json:"defaultCondition,omitempty"` // The error field. Error *string `json:"error,omitempty"` + // When this rule's outcome is a reference to another Policy, the ID of + // that referenced policy. Empty when the outcome is an inline policy_key. + OutcomePolicyID *string `json:"outcomePolicyId,omitempty"` + // The policy in which this rule was evaluated. Empty for results recorded + // before chained policy references existed; populated for every result + // emitted by recursive evaluation. + PolicyID *string `json:"policyId,omitempty"` // The policyKey field. PolicyKey *string `json:"policyKey,omitempty"` } +func (t *TaskAuditConditionalPolicyExecutionResult) GetChainDepth() *int { + if t == nil { + return nil + } + return t.ChainDepth +} + func (t *TaskAuditConditionalPolicyExecutionResult) GetCondition() *string { if t == nil { return nil @@ -44,6 +60,20 @@ func (t *TaskAuditConditionalPolicyExecutionResult) GetError() *string { return t.Error } +func (t *TaskAuditConditionalPolicyExecutionResult) GetOutcomePolicyID() *string { + if t == nil { + return nil + } + return t.OutcomePolicyID +} + +func (t *TaskAuditConditionalPolicyExecutionResult) GetPolicyID() *string { + if t == nil { + return nil + } + return t.PolicyID +} + func (t *TaskAuditConditionalPolicyExecutionResult) GetPolicyKey() *string { if t == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditlistrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditlistrequest.go index 8a41fb94..7bcab676 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditlistrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditlistrequest.go @@ -7,6 +7,10 @@ type TaskAuditListRequest struct { // When true, only comment events are returned, so a page of page_size holds // page_size comments rather than a mix of comments and state-change events. CommentsOnly *bool `json:"commentsOnly,omitempty"` + // When true, comment events are excluded from the response and the count, so + // a page of page_size holds page_size non-comment events. Mutually exclusive + // with comments_only. + ExcludeComments *bool `json:"excludeComments,omitempty"` // When true, events are returned newest-first (descending created_at) instead // of the default chronological (ascending) order. NewestFirst *bool `json:"newestFirst,omitempty"` @@ -27,6 +31,13 @@ func (t *TaskAuditListRequest) GetCommentsOnly() *bool { return t.CommentsOnly } +func (t *TaskAuditListRequest) GetExcludeComments() *bool { + if t == nil { + return nil + } + return t.ExcludeComments +} + func (t *TaskAuditListRequest) GetNewestFirst() *bool { if t == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditlistresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditlistresponse.go index eef51213..5575c074 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditlistresponse.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditlistresponse.go @@ -2,12 +2,36 @@ package shared +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" +) + // The TaskAuditListResponse message. type TaskAuditListResponse struct { // The list of audit events for the task. List []TaskAuditView `json:"list,omitempty"` // A pagination token to retrieve the next page of results. NextPageToken *string `json:"nextPageToken,omitempty"` + // The total number of audit events the list returns for this request: + // comment events when comments_only is true, non-comment events when + // exclude_comments is true, all events otherwise. This is an upper bound: + // a small number of internal-only events (e.g. connector-action results + // with no pending reason) are omitted from list, so the count can exceed + // the rows reachable by paging. Only returned for the first page (a request + // with no page_token). Unset when the request filters by refs (the count is + // undefined for ref lookups) or when the count could not be computed. + TotalCount *int64 `integer:"string" json:"totalCount,omitempty"` +} + +func (t TaskAuditListResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskAuditListResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil } func (t *TaskAuditListResponse) GetList() []TaskAuditView { @@ -23,3 +47,10 @@ func (t *TaskAuditListResponse) GetNextPageToken() *string { } return t.NextPageToken } + +func (t *TaskAuditListResponse) GetTotalCount() *int64 { + if t == nil { + return nil + } + return t.TotalCount +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionentitlementmergecompleted.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionentitlementmergecompleted.go new file mode 100644 index 00000000..7e287a1b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionentitlementmergecompleted.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The TaskAuditProvisionEntitlementMergeCompleted message. +type TaskAuditProvisionEntitlementMergeCompleted struct { + // The appEntitlementId field. + AppEntitlementID *string `json:"appEntitlementId,omitempty"` + // The appId field. + AppID *string `json:"appId,omitempty"` +} + +func (t *TaskAuditProvisionEntitlementMergeCompleted) GetAppEntitlementID() *string { + if t == nil { + return nil + } + return t.AppEntitlementID +} + +func (t *TaskAuditProvisionEntitlementMergeCompleted) GetAppID() *string { + if t == nil { + return nil + } + return t.AppID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionentitlementmergetimedout.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionentitlementmergetimedout.go new file mode 100644 index 00000000..f9434817 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionentitlementmergetimedout.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The TaskAuditProvisionEntitlementMergeTimedOut message. +type TaskAuditProvisionEntitlementMergeTimedOut struct { + // The appEntitlementId field. + AppEntitlementID *string `json:"appEntitlementId,omitempty"` + // The appId field. + AppID *string `json:"appId,omitempty"` +} + +func (t *TaskAuditProvisionEntitlementMergeTimedOut) GetAppEntitlementID() *string { + if t == nil { + return nil + } + return t.AppEntitlementID +} + +func (t *TaskAuditProvisionEntitlementMergeTimedOut) GetAppID() *string { + if t == nil { + return nil + } + return t.AppID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionwaitingforentitlementmerge.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionwaitingforentitlementmerge.go new file mode 100644 index 00000000..3ed9702b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditprovisionwaitingforentitlementmerge.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// The TaskAuditProvisionWaitingForEntitlementMerge message. +type TaskAuditProvisionWaitingForEntitlementMerge struct { + // The appEntitlementId field. + AppEntitlementID *string `json:"appEntitlementId,omitempty"` + // The appId field. + AppID *string `json:"appId,omitempty"` + FallbackAt *time.Time `json:"fallbackAt,omitempty"` +} + +func (t TaskAuditProvisionWaitingForEntitlementMerge) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskAuditProvisionWaitingForEntitlementMerge) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TaskAuditProvisionWaitingForEntitlementMerge) GetAppEntitlementID() *string { + if t == nil { + return nil + } + return t.AppEntitlementID +} + +func (t *TaskAuditProvisionWaitingForEntitlementMerge) GetAppID() *string { + if t == nil { + return nil + } + return t.AppID +} + +func (t *TaskAuditProvisionWaitingForEntitlementMerge) GetFallbackAt() *time.Time { + if t == nil { + return nil + } + return t.FallbackAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditview.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditview.go index ab4a700a..ea6360ae 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditview.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditview.go @@ -146,8 +146,14 @@ func (e *TaskAuditViewSource) IsExact() bool { // - taskCreatedFrom // - reassignmentFallbackToAdmin // - requestDefaultsApplied +// - provisionWaitingForEntitlementMerge +// - provisionEntitlementMergeCompleted +// - provisionEntitlementMergeTimedOut +// - accountDeleted +// - automationTriggered type TaskAuditView struct { AccessRequestOutcome *TaskAuditAccessRequestOutcome `json:"accessRequestOutcome,omitempty"` + AccountDeleted *TaskAuditAccountDeleted `json:"accountDeleted,omitempty"` AccountLifecycleActionCreated *TaskAuditAccountLifecycleActionCreated `json:"accountLifecycleActionCreated,omitempty"` AccountLifecycleActionFailed *TaskAuditAccountLifecycleActionFailed `json:"accountLifecycleActionFailed,omitempty"` ActionInstanceCreated *TaskAuditActionInstanceCreated `json:"actionInstanceCreated,omitempty"` @@ -160,6 +166,7 @@ type TaskAuditView struct { ApprovalInstanceChange *TaskAuditApprovalInstanceChange `json:"approvalInstanceChange,omitempty"` ApprovalReassigned *TaskAuditPolicyApprovalReassigned `json:"approvalReassigned,omitempty"` ApprovedAutomatically *TaskAuditApprovalHappenedAutomatically `json:"approvedAutomatically,omitempty"` + AutomationTriggered *TaskAuditAutomationTriggered `json:"automationTriggered,omitempty"` BulkActionError *TaskAuditBulkActionError `json:"bulkActionError,omitempty"` CertifyOutcome *TaskAuditCertifyOutcome `json:"certifyOutcome,omitempty"` Comment *TaskAuditComment `json:"comment,omitempty"` @@ -182,19 +189,22 @@ type TaskAuditView struct { GrantOutcome *TaskAuditGrantOutcome `json:"grantOutcome,omitempty"` HardReset *TaskAuditHardReset `json:"hardReset,omitempty"` // The id field. - ID *string `json:"id,omitempty"` - Metadata *TaskAuditMetaData `json:"metadata,omitempty"` - PolicyChanged *TaskAuditPolicyChanged `json:"policyChanged,omitempty"` - PolicyEvaluationStep *TaskAuditPolicyEvaluationStep `json:"policyEvaluationStep,omitempty"` - ProvisionCancelled *TaskAuditPolicyProvisionCancelled `json:"provisionCancelled,omitempty"` - ProvisionError *TaskAuditPolicyProvisionError `json:"provisionError,omitempty"` - ProvisionReassigned *TaskAuditPolicyProvisionReassigned `json:"provisionReassigned,omitempty"` - ReassignedToDelegate *TaskAuditReassignedToDelegate `json:"reassignedToDelegate,omitempty"` - ReassignmentFallbackToAdmin *TaskAuditReassignmentFallbackToAdmin `json:"reassignmentFallbackToAdmin,omitempty"` - ReassignmentListError *TaskAuditReassignmentListError `json:"reassignmentListError,omitempty"` - RequestDefaultsApplied *TaskAuditRequestDefaultsApplied `json:"requestDefaultsApplied,omitempty"` - RevokeOutcome *TaskAuditRevokeOutcome `json:"revokeOutcome,omitempty"` - SLAEscalation *TaskAuditSLAEscalation `json:"slaEscalation,omitempty"` + ID *string `json:"id,omitempty"` + Metadata *TaskAuditMetaData `json:"metadata,omitempty"` + PolicyChanged *TaskAuditPolicyChanged `json:"policyChanged,omitempty"` + PolicyEvaluationStep *TaskAuditPolicyEvaluationStep `json:"policyEvaluationStep,omitempty"` + ProvisionCancelled *TaskAuditPolicyProvisionCancelled `json:"provisionCancelled,omitempty"` + ProvisionEntitlementMergeCompleted *TaskAuditProvisionEntitlementMergeCompleted `json:"provisionEntitlementMergeCompleted,omitempty"` + ProvisionEntitlementMergeTimedOut *TaskAuditProvisionEntitlementMergeTimedOut `json:"provisionEntitlementMergeTimedOut,omitempty"` + ProvisionError *TaskAuditPolicyProvisionError `json:"provisionError,omitempty"` + ProvisionReassigned *TaskAuditPolicyProvisionReassigned `json:"provisionReassigned,omitempty"` + ProvisionWaitingForEntitlementMerge *TaskAuditProvisionWaitingForEntitlementMerge `json:"provisionWaitingForEntitlementMerge,omitempty"` + ReassignedToDelegate *TaskAuditReassignedToDelegate `json:"reassignedToDelegate,omitempty"` + ReassignmentFallbackToAdmin *TaskAuditReassignmentFallbackToAdmin `json:"reassignmentFallbackToAdmin,omitempty"` + ReassignmentListError *TaskAuditReassignmentListError `json:"reassignmentListError,omitempty"` + RequestDefaultsApplied *TaskAuditRequestDefaultsApplied `json:"requestDefaultsApplied,omitempty"` + RevokeOutcome *TaskAuditRevokeOutcome `json:"revokeOutcome,omitempty"` + SLAEscalation *TaskAuditSLAEscalation `json:"slaEscalation,omitempty"` // The source field. Source *TaskAuditViewSource `json:"source,omitempty"` StateChange *TaskAuditStateChange `json:"stateChange,omitempty"` @@ -245,6 +255,13 @@ func (t *TaskAuditView) GetAccessRequestOutcome() *TaskAuditAccessRequestOutcome return t.AccessRequestOutcome } +func (t *TaskAuditView) GetAccountDeleted() *TaskAuditAccountDeleted { + if t == nil { + return nil + } + return t.AccountDeleted +} + func (t *TaskAuditView) GetAccountLifecycleActionCreated() *TaskAuditAccountLifecycleActionCreated { if t == nil { return nil @@ -329,6 +346,13 @@ func (t *TaskAuditView) GetApprovedAutomatically() *TaskAuditApprovalHappenedAut return t.ApprovedAutomatically } +func (t *TaskAuditView) GetAutomationTriggered() *TaskAuditAutomationTriggered { + if t == nil { + return nil + } + return t.AutomationTriggered +} + func (t *TaskAuditView) GetBulkActionError() *TaskAuditBulkActionError { if t == nil { return nil @@ -497,6 +521,20 @@ func (t *TaskAuditView) GetProvisionCancelled() *TaskAuditPolicyProvisionCancell return t.ProvisionCancelled } +func (t *TaskAuditView) GetProvisionEntitlementMergeCompleted() *TaskAuditProvisionEntitlementMergeCompleted { + if t == nil { + return nil + } + return t.ProvisionEntitlementMergeCompleted +} + +func (t *TaskAuditView) GetProvisionEntitlementMergeTimedOut() *TaskAuditProvisionEntitlementMergeTimedOut { + if t == nil { + return nil + } + return t.ProvisionEntitlementMergeTimedOut +} + func (t *TaskAuditView) GetProvisionError() *TaskAuditPolicyProvisionError { if t == nil { return nil @@ -511,6 +549,13 @@ func (t *TaskAuditView) GetProvisionReassigned() *TaskAuditPolicyProvisionReassi return t.ProvisionReassigned } +func (t *TaskAuditView) GetProvisionWaitingForEntitlementMerge() *TaskAuditProvisionWaitingForEntitlementMerge { + if t == nil { + return nil + } + return t.ProvisionWaitingForEntitlementMerge +} + func (t *TaskAuditView) GetReassignedToDelegate() *TaskAuditReassignedToDelegate { if t == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditwebhooksuccess.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditwebhooksuccess.go index eedc29b8..6bd213d7 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditwebhooksuccess.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/taskauditwebhooksuccess.go @@ -4,6 +4,8 @@ package shared // The TaskAuditWebhookSuccess message. type TaskAuditWebhookSuccess struct { + // Optional comment supplied by the provisioning callback. + Comment *string `json:"comment,omitempty"` // The webhookId field. WebhookID *string `json:"webhookId,omitempty"` // The webhookInstanceId field. @@ -14,6 +16,13 @@ type TaskAuditWebhookSuccess struct { WebhookURL *string `json:"webhookUrl,omitempty"` } +func (t *TaskAuditWebhookSuccess) GetComment() *string { + if t == nil { + return nil + } + return t.Comment +} + func (t *TaskAuditWebhookSuccess) GetWebhookID() *string { if t == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasksearchrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasksearchrequest.go index e7a0c6c2..2759ed71 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasksearchrequest.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasksearchrequest.go @@ -7,6 +7,30 @@ import ( "time" ) +type AccountStatuses string + +const ( + AccountStatusesStatusUnspecified AccountStatuses = "STATUS_UNSPECIFIED" + AccountStatusesStatusEnabled AccountStatuses = "STATUS_ENABLED" + AccountStatusesStatusDisabled AccountStatuses = "STATUS_DISABLED" + AccountStatusesStatusDeleted AccountStatuses = "STATUS_DELETED" +) + +func (e AccountStatuses) ToPointer() *AccountStatuses { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AccountStatuses) IsExact() bool { + if e != nil { + switch *e { + case "STATUS_UNSPECIFIED", "STATUS_ENABLED", "STATUS_DISABLED", "STATUS_DELETED": + return true + } + } + return false +} + type TaskSearchRequestAccountTypes string const ( @@ -274,6 +298,8 @@ type TaskSearchRequest struct { AccessReviewIds []string `json:"accessReviewIds,omitempty"` // Search tasks that have any of these account owners. AccountOwnerIds []string `json:"accountOwnerIds,omitempty"` + // Search tasks by the account status of the app user subject. + AccountStatuses []AccountStatuses `json:"accountStatuses,omitempty"` // The accountTypes field. AccountTypes []TaskSearchRequestAccountTypes `json:"accountTypes,omitempty"` // Search tasks that have this actor ID. @@ -381,6 +407,13 @@ func (t *TaskSearchRequest) GetAccountOwnerIds() []string { return t.AccountOwnerIds } +func (t *TaskSearchRequest) GetAccountStatuses() []AccountStatuses { + if t == nil { + return nil + } + return t.AccountStatuses +} + func (t *TaskSearchRequest) GetAccountTypes() []TaskSearchRequestAccountTypes { if t == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasktypeaction.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasktypeaction.go index 147d004d..ca99bbce 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasktypeaction.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasktypeaction.go @@ -39,12 +39,13 @@ func (e *TaskTypeActionOutcome) IsExact() bool { type TaskTypeActionType string const ( - TaskTypeActionTypeTypeUnspecified TaskTypeActionType = "TYPE_UNSPECIFIED" - TaskTypeActionTypeTypeGrant TaskTypeActionType = "TYPE_GRANT" - TaskTypeActionTypeTypeWorkflow TaskTypeActionType = "TYPE_WORKFLOW" - TaskTypeActionTypeTypeResourceAction TaskTypeActionType = "TYPE_RESOURCE_ACTION" - TaskTypeActionTypeTypeToolCall TaskTypeActionType = "TYPE_TOOL_CALL" - TaskTypeActionTypeTypeManual TaskTypeActionType = "TYPE_MANUAL" + TaskTypeActionTypeTypeUnspecified TaskTypeActionType = "TYPE_UNSPECIFIED" + TaskTypeActionTypeTypeGrant TaskTypeActionType = "TYPE_GRANT" + TaskTypeActionTypeTypeWorkflow TaskTypeActionType = "TYPE_WORKFLOW" + TaskTypeActionTypeTypeResourceAction TaskTypeActionType = "TYPE_RESOURCE_ACTION" + TaskTypeActionTypeTypeToolCall TaskTypeActionType = "TYPE_TOOL_CALL" + TaskTypeActionTypeTypeManual TaskTypeActionType = "TYPE_MANUAL" + TaskTypeActionTypeTypeCredentialIssue TaskTypeActionType = "TYPE_CREDENTIAL_ISSUE" ) func (e TaskTypeActionType) ToPointer() *TaskTypeActionType { @@ -55,7 +56,7 @@ func (e TaskTypeActionType) ToPointer() *TaskTypeActionType { func (e *TaskTypeActionType) IsExact() bool { if e != nil { switch *e { - case "TYPE_UNSPECIFIED", "TYPE_GRANT", "TYPE_WORKFLOW", "TYPE_RESOURCE_ACTION", "TYPE_TOOL_CALL", "TYPE_MANUAL": + case "TYPE_UNSPECIFIED", "TYPE_GRANT", "TYPE_WORKFLOW", "TYPE_RESOURCE_ACTION", "TYPE_TOOL_CALL", "TYPE_MANUAL", "TYPE_CREDENTIAL_ISSUE": return true } } @@ -68,6 +69,7 @@ func (e *TaskTypeActionType) IsExact() bool { // - scopeRole // - toolCall // - finding +// - credentialIssue type TaskTypeAction struct { // The ID of the admin-authored action to execute. Empty for synthesized // action tickets (e.g. scope-role grants) — those carry dispatch @@ -85,7 +87,8 @@ type TaskTypeAction struct { // AppResource materialized from the connector response. CreatedAppResourceID *string `json:"createdAppResourceId,omitempty"` // The resource type ID of the materialized AppResource. - CreatedAppResourceTypeID *string `json:"createdAppResourceTypeId,omitempty"` + CreatedAppResourceTypeID *string `json:"createdAppResourceTypeId,omitempty"` + CredentialIssue *CredentialIssueTarget `json:"credentialIssue,omitempty"` // Display label captured on the action snapshot at ticket-creation time. // Stable under admin renames to a referenced Action row and populated for // synthesized tickets that have no Action row at all. UI reads this to @@ -149,6 +152,13 @@ func (t *TaskTypeAction) GetCreatedAppResourceTypeID() *string { return t.CreatedAppResourceTypeID } +func (t *TaskTypeAction) GetCredentialIssue() *CredentialIssueTarget { + if t == nil { + return nil + } + return t.CredentialIssue +} + func (t *TaskTypeAction) GetDisplayName() *string { if t == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasktypeactioninput.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasktypeactioninput.go index 0640f48d..0a515d88 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasktypeactioninput.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tasktypeactioninput.go @@ -8,11 +8,13 @@ package shared // - scopeRole // - toolCall // - finding +// - credentialIssue type TaskTypeActionInput struct { - ActionInstance *TaskActionInstanceInput `json:"actionInstance,omitempty"` - Finding *FindingTargetInput `json:"finding,omitempty"` - ScopeRole *ScopeRoleInput `json:"scopeRole,omitempty"` - ToolCall *GatedToolCallTargetInput `json:"toolCall,omitempty"` + ActionInstance *TaskActionInstanceInput `json:"actionInstance,omitempty"` + CredentialIssue *CredentialIssueTargetInput `json:"credentialIssue,omitempty"` + Finding *FindingTargetInput `json:"finding,omitempty"` + ScopeRole *ScopeRoleInput `json:"scopeRole,omitempty"` + ToolCall *GatedToolCallTargetInput `json:"toolCall,omitempty"` } func (t *TaskTypeActionInput) GetActionInstance() *TaskActionInstanceInput { @@ -22,6 +24,13 @@ func (t *TaskTypeActionInput) GetActionInstance() *TaskActionInstanceInput { return t.ActionInstance } +func (t *TaskTypeActionInput) GetCredentialIssue() *CredentialIssueTargetInput { + if t == nil { + return nil + } + return t.CredentialIssue +} + func (t *TaskTypeActionInput) GetFinding() *FindingTargetInput { if t == nil { return nil diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicegetdiscoverysnapshotresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicegetdiscoverysnapshotresponse.go new file mode 100644 index 00000000..977f4532 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicegetdiscoverysnapshotresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The TBControlPlaneServiceGetDiscoverySnapshotResponse message. +type TBControlPlaneServiceGetDiscoverySnapshotResponse struct { + Snapshot *TBDiscoverySnapshot `json:"snapshot,omitempty"` +} + +func (t *TBControlPlaneServiceGetDiscoverySnapshotResponse) GetSnapshot() *TBDiscoverySnapshot { + if t == nil { + return nil + } + return t.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicegetegresspolicyresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicegetegresspolicyresponse.go new file mode 100644 index 00000000..b44a2bcf --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicegetegresspolicyresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The TBControlPlaneServiceGetEgressPolicyResponse message. +type TBControlPlaneServiceGetEgressPolicyResponse struct { + // The compiled TB policy YAML for the current generation, empty when + // `policy.rules` is empty. + CompiledPolicyYaml *string `json:"compiledPolicyYaml,omitempty"` + Policy *TBEgressPolicy `json:"policy,omitempty"` +} + +func (t *TBControlPlaneServiceGetEgressPolicyResponse) GetCompiledPolicyYaml() *string { + if t == nil { + return nil + } + return t.CompiledPolicyYaml +} + +func (t *TBControlPlaneServiceGetEgressPolicyResponse) GetPolicy() *TBEgressPolicy { + if t == nil { + return nil + } + return t.Policy +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicepushdiscoveryrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicepushdiscoveryrequest.go new file mode 100644 index 00000000..165473d6 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicepushdiscoveryrequest.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The TBControlPlaneServicePushDiscoveryRequest message. +type TBControlPlaneServicePushDiscoveryRequest struct { + // The credentials field. + Credentials []string `json:"credentials,omitempty"` + // The destinations field. + Destinations map[string]TBDiscoveryDestinationTargets `json:"destinations,omitempty"` + // The ingressScopes field. + IngressScopes []string `json:"ingressScopes,omitempty"` + // The postures field. + Postures []string `json:"postures,omitempty"` + // The principals field. + Principals []string `json:"principals,omitempty"` + // The routes field. + Routes []string `json:"routes,omitempty"` + // The tbInstanceId field. + TbInstanceID *string `json:"tbInstanceId,omitempty"` +} + +func (t *TBControlPlaneServicePushDiscoveryRequest) GetCredentials() []string { + if t == nil { + return nil + } + return t.Credentials +} + +func (t *TBControlPlaneServicePushDiscoveryRequest) GetDestinations() map[string]TBDiscoveryDestinationTargets { + if t == nil { + return nil + } + return t.Destinations +} + +func (t *TBControlPlaneServicePushDiscoveryRequest) GetIngressScopes() []string { + if t == nil { + return nil + } + return t.IngressScopes +} + +func (t *TBControlPlaneServicePushDiscoveryRequest) GetPostures() []string { + if t == nil { + return nil + } + return t.Postures +} + +func (t *TBControlPlaneServicePushDiscoveryRequest) GetPrincipals() []string { + if t == nil { + return nil + } + return t.Principals +} + +func (t *TBControlPlaneServicePushDiscoveryRequest) GetRoutes() []string { + if t == nil { + return nil + } + return t.Routes +} + +func (t *TBControlPlaneServicePushDiscoveryRequest) GetTbInstanceID() *string { + if t == nil { + return nil + } + return t.TbInstanceID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicepushdiscoveryresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicepushdiscoveryresponse.go new file mode 100644 index 00000000..b9aa0fd0 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicepushdiscoveryresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The TBControlPlaneServicePushDiscoveryResponse message. +type TBControlPlaneServicePushDiscoveryResponse struct { + Snapshot *TBDiscoverySnapshot `json:"snapshot,omitempty"` +} + +func (t *TBControlPlaneServicePushDiscoveryResponse) GetSnapshot() *TBDiscoverySnapshot { + if t == nil { + return nil + } + return t.Snapshot +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicesaveegresspolicyrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicesaveegresspolicyrequest.go new file mode 100644 index 00000000..73da9c60 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicesaveegresspolicyrequest.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// DefaultOutcome - The defaultOutcome field. +type DefaultOutcome string + +const ( + DefaultOutcomeTbEgressOutcomeUnspecified DefaultOutcome = "TB_EGRESS_OUTCOME_UNSPECIFIED" + DefaultOutcomeTbEgressOutcomeAllowed DefaultOutcome = "TB_EGRESS_OUTCOME_ALLOWED" + DefaultOutcomeTbEgressOutcomeDenied DefaultOutcome = "TB_EGRESS_OUTCOME_DENIED" +) + +func (e DefaultOutcome) ToPointer() *DefaultOutcome { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DefaultOutcome) IsExact() bool { + if e != nil { + switch *e { + case "TB_EGRESS_OUTCOME_UNSPECIFIED", "TB_EGRESS_OUTCOME_ALLOWED", "TB_EGRESS_OUTCOME_DENIED": + return true + } + } + return false +} + +// The TBControlPlaneServiceSaveEgressPolicyRequest message. +type TBControlPlaneServiceSaveEgressPolicyRequest struct { + // The defaultDenyReason field. + DefaultDenyReason *string `json:"defaultDenyReason,omitempty"` + // The defaultOutcome field. + DefaultOutcome *DefaultOutcome `json:"defaultOutcome,omitempty"` + // The rules field. + Rules []TBEgressRule `json:"rules,omitempty"` + // The tbInstanceId field. + TbInstanceID *string `json:"tbInstanceId,omitempty"` +} + +func (t *TBControlPlaneServiceSaveEgressPolicyRequest) GetDefaultDenyReason() *string { + if t == nil { + return nil + } + return t.DefaultDenyReason +} + +func (t *TBControlPlaneServiceSaveEgressPolicyRequest) GetDefaultOutcome() *DefaultOutcome { + if t == nil { + return nil + } + return t.DefaultOutcome +} + +func (t *TBControlPlaneServiceSaveEgressPolicyRequest) GetRules() []TBEgressRule { + if t == nil { + return nil + } + return t.Rules +} + +func (t *TBControlPlaneServiceSaveEgressPolicyRequest) GetTbInstanceID() *string { + if t == nil { + return nil + } + return t.TbInstanceID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicesaveegresspolicyresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicesaveegresspolicyresponse.go new file mode 100644 index 00000000..492dc581 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbcontrolplaneservicesaveegresspolicyresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The TBControlPlaneServiceSaveEgressPolicyResponse message. +type TBControlPlaneServiceSaveEgressPolicyResponse struct { + Policy *TBEgressPolicy `json:"policy,omitempty"` +} + +func (t *TBControlPlaneServiceSaveEgressPolicyResponse) GetPolicy() *TBEgressPolicy { + if t == nil { + return nil + } + return t.Policy +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbdiscoverydestinationtargets.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbdiscoverydestinationtargets.go new file mode 100644 index 00000000..1da38173 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbdiscoverydestinationtargets.go @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// TBDiscoveryDestinationTargets holds the destination-group values for one +// +// key of TBDiscoverySnapshot.destinations -- proto3 map values cannot be a +// bare `repeated string`. +type TBDiscoveryDestinationTargets struct { + // The values field. + Values []string `json:"values,omitempty"` +} + +func (t *TBDiscoveryDestinationTargets) GetValues() []string { + if t == nil { + return nil + } + return t.Values +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbdiscoverysnapshot.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbdiscoverysnapshot.go new file mode 100644 index 00000000..137140ea --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbdiscoverysnapshot.go @@ -0,0 +1,126 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// TBDiscoverySnapshot is one Time Bandit instance's self-reported +// +// vocabulary: the principals, ingress scopes, destinations, credential +// recipe names, posture names, and route names it knows about. Names +// only -- never token values or credential material. +// +// Dynamo-only: the control plane has no query pattern that needs +// Postgres (lookup is always a direct tenant_id+tb_instance_id get). +type TBDiscoverySnapshot struct { + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The credentials field. + Credentials []string `json:"credentials,omitempty"` + // The destinations field. + Destinations map[string]TBDiscoveryDestinationTargets `json:"destinations,omitempty"` + // The ingressScopes field. + IngressScopes []string `json:"ingressScopes,omitempty"` + // The postures field. + Postures []string `json:"postures,omitempty"` + // The principals field. + Principals []string `json:"principals,omitempty"` + ReportedAt *time.Time `json:"reportedAt,omitempty"` + // The routes field. + Routes []string `json:"routes,omitempty"` + // The tbInstanceId field. + TbInstanceID *string `json:"tbInstanceId,omitempty"` + // The tenantId field. + TenantID *string `json:"tenantId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (t TBDiscoverySnapshot) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TBDiscoverySnapshot) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TBDiscoverySnapshot) GetCreatedAt() *time.Time { + if t == nil { + return nil + } + return t.CreatedAt +} + +func (t *TBDiscoverySnapshot) GetCredentials() []string { + if t == nil { + return nil + } + return t.Credentials +} + +func (t *TBDiscoverySnapshot) GetDestinations() map[string]TBDiscoveryDestinationTargets { + if t == nil { + return nil + } + return t.Destinations +} + +func (t *TBDiscoverySnapshot) GetIngressScopes() []string { + if t == nil { + return nil + } + return t.IngressScopes +} + +func (t *TBDiscoverySnapshot) GetPostures() []string { + if t == nil { + return nil + } + return t.Postures +} + +func (t *TBDiscoverySnapshot) GetPrincipals() []string { + if t == nil { + return nil + } + return t.Principals +} + +func (t *TBDiscoverySnapshot) GetReportedAt() *time.Time { + if t == nil { + return nil + } + return t.ReportedAt +} + +func (t *TBDiscoverySnapshot) GetRoutes() []string { + if t == nil { + return nil + } + return t.Routes +} + +func (t *TBDiscoverySnapshot) GetTbInstanceID() *string { + if t == nil { + return nil + } + return t.TbInstanceID +} + +func (t *TBDiscoverySnapshot) GetTenantID() *string { + if t == nil { + return nil + } + return t.TenantID +} + +func (t *TBDiscoverySnapshot) GetUpdatedAt() *time.Time { + if t == nil { + return nil + } + return t.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbegresspolicy.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbegresspolicy.go new file mode 100644 index 00000000..75bbb84d --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbegresspolicy.go @@ -0,0 +1,121 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// TBEgressPolicyDefaultOutcome - The defaultOutcome field. +type TBEgressPolicyDefaultOutcome string + +const ( + TBEgressPolicyDefaultOutcomeTbEgressOutcomeUnspecified TBEgressPolicyDefaultOutcome = "TB_EGRESS_OUTCOME_UNSPECIFIED" + TBEgressPolicyDefaultOutcomeTbEgressOutcomeAllowed TBEgressPolicyDefaultOutcome = "TB_EGRESS_OUTCOME_ALLOWED" + TBEgressPolicyDefaultOutcomeTbEgressOutcomeDenied TBEgressPolicyDefaultOutcome = "TB_EGRESS_OUTCOME_DENIED" +) + +func (e TBEgressPolicyDefaultOutcome) ToPointer() *TBEgressPolicyDefaultOutcome { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *TBEgressPolicyDefaultOutcome) IsExact() bool { + if e != nil { + switch *e { + case "TB_EGRESS_OUTCOME_UNSPECIFIED", "TB_EGRESS_OUTCOME_ALLOWED", "TB_EGRESS_OUTCOME_DENIED": + return true + } + } + return false +} + +// TBEgressPolicy is the typed policy document for one TB instance. Binds +// +// per-instance, not per-tenant-across-instances, keyed by tb_instance_id +// exactly as discovery reports it. +type TBEgressPolicy struct { + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The defaultDenyReason field. + DefaultDenyReason *string `json:"defaultDenyReason,omitempty"` + // The defaultOutcome field. + DefaultOutcome *TBEgressPolicyDefaultOutcome `json:"defaultOutcome,omitempty"` + // Opaque, bumped on every successful save -- TB's change detector. + // Stamped as "c1-gen-". + Generation *string `json:"generation,omitempty"` + // The rules field. + Rules []TBEgressRule `json:"rules,omitempty"` + // The tbInstanceId field. + TbInstanceID *string `json:"tbInstanceId,omitempty"` + // The tenantId field. + TenantID *string `json:"tenantId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (t TBEgressPolicy) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TBEgressPolicy) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TBEgressPolicy) GetCreatedAt() *time.Time { + if t == nil { + return nil + } + return t.CreatedAt +} + +func (t *TBEgressPolicy) GetDefaultDenyReason() *string { + if t == nil { + return nil + } + return t.DefaultDenyReason +} + +func (t *TBEgressPolicy) GetDefaultOutcome() *TBEgressPolicyDefaultOutcome { + if t == nil { + return nil + } + return t.DefaultOutcome +} + +func (t *TBEgressPolicy) GetGeneration() *string { + if t == nil { + return nil + } + return t.Generation +} + +func (t *TBEgressPolicy) GetRules() []TBEgressRule { + if t == nil { + return nil + } + return t.Rules +} + +func (t *TBEgressPolicy) GetTbInstanceID() *string { + if t == nil { + return nil + } + return t.TbInstanceID +} + +func (t *TBEgressPolicy) GetTenantID() *string { + if t == nil { + return nil + } + return t.TenantID +} + +func (t *TBEgressPolicy) GetUpdatedAt() *time.Time { + if t == nil { + return nil + } + return t.UpdatedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbegressrule.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbegressrule.go new file mode 100644 index 00000000..d1f6a7f7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/tbegressrule.go @@ -0,0 +1,214 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// TBEgressRuleMode - The mode field. +type TBEgressRuleMode string + +const ( + TBEgressRuleModeTbEgressModeUnspecified TBEgressRuleMode = "TB_EGRESS_MODE_UNSPECIFIED" + TBEgressRuleModeTbEgressModeEnforce TBEgressRuleMode = "TB_EGRESS_MODE_ENFORCE" + TBEgressRuleModeTbEgressModeObserve TBEgressRuleMode = "TB_EGRESS_MODE_OBSERVE" + TBEgressRuleModeTbEgressModeDisabled TBEgressRuleMode = "TB_EGRESS_MODE_DISABLED" +) + +func (e TBEgressRuleMode) ToPointer() *TBEgressRuleMode { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *TBEgressRuleMode) IsExact() bool { + if e != nil { + switch *e { + case "TB_EGRESS_MODE_UNSPECIFIED", "TB_EGRESS_MODE_ENFORCE", "TB_EGRESS_MODE_OBSERVE", "TB_EGRESS_MODE_DISABLED": + return true + } + } + return false +} + +// TBEgressRuleOutcome - The outcome field. +type TBEgressRuleOutcome string + +const ( + TBEgressRuleOutcomeTbEgressOutcomeUnspecified TBEgressRuleOutcome = "TB_EGRESS_OUTCOME_UNSPECIFIED" + TBEgressRuleOutcomeTbEgressOutcomeAllowed TBEgressRuleOutcome = "TB_EGRESS_OUTCOME_ALLOWED" + TBEgressRuleOutcomeTbEgressOutcomeDenied TBEgressRuleOutcome = "TB_EGRESS_OUTCOME_DENIED" +) + +func (e TBEgressRuleOutcome) ToPointer() *TBEgressRuleOutcome { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *TBEgressRuleOutcome) IsExact() bool { + if e != nil { + switch *e { + case "TB_EGRESS_OUTCOME_UNSPECIFIED", "TB_EGRESS_OUTCOME_ALLOWED", "TB_EGRESS_OUTCOME_DENIED": + return true + } + } + return false +} + +// TBEgressRule is one typed rule. Deliberately smaller than +// +// AgentGuardrailRule: no celCondition (TB's matcher is typed, not an +// expression evaluator), no hook ids (TB has no hook model -- posture and +// review routes are the nearest analogues, unmapped here). +// +// `hard_allow` and inline `consider` are deliberately unrepresentable: no +// field here names either, and protojson's default unknown-field behavior +// already rejects a request naming either key -- DiscardUnknown is never +// set on the apigw decoder, so this is genuinely "rejected at decode" via +// the REST route, and structurally absent for any gRPC caller (no stub has +// an equivalent field to set). +type TBEgressRule struct { + // The credentialId field. + CredentialID *string `json:"credentialId,omitempty"` + // The denyReason field. + DenyReason *string `json:"denyReason,omitempty"` + // The description field. + Description *string `json:"description,omitempty"` + // The destinations field. + Destinations []string `json:"destinations,omitempty"` + // The displayName field. + DisplayName *string `json:"displayName,omitempty"` + // The id field. + ID *string `json:"id,omitempty"` + // The ingressScopes field. + IngressScopes []string `json:"ingressScopes,omitempty"` + // The methods field. + Methods []string `json:"methods,omitempty"` + // The mode field. + Mode *TBEgressRuleMode `json:"mode,omitempty"` + // The outcome field. + Outcome *TBEgressRuleOutcome `json:"outcome,omitempty"` + // The paths field. + Paths []string `json:"paths,omitempty"` + // The postureId field. + PostureID *string `json:"postureId,omitempty"` + // Selector, discovery-driven picker fields. Every non-empty value here + // must name something the latest TBDiscoverySnapshot for the target + // instance actually reported. + Principals []string `json:"principals,omitempty"` + // Explicit order; TB evaluates policy rows first-match, so rules compile + // in ascending priority order. + Priority *int `json:"priority,omitempty"` + // The sourceTemplateId field. + SourceTemplateID *string `json:"sourceTemplateId,omitempty"` + // The systemManaged field. + SystemManaged *bool `json:"systemManaged,omitempty"` +} + +func (t *TBEgressRule) GetCredentialID() *string { + if t == nil { + return nil + } + return t.CredentialID +} + +func (t *TBEgressRule) GetDenyReason() *string { + if t == nil { + return nil + } + return t.DenyReason +} + +func (t *TBEgressRule) GetDescription() *string { + if t == nil { + return nil + } + return t.Description +} + +func (t *TBEgressRule) GetDestinations() []string { + if t == nil { + return nil + } + return t.Destinations +} + +func (t *TBEgressRule) GetDisplayName() *string { + if t == nil { + return nil + } + return t.DisplayName +} + +func (t *TBEgressRule) GetID() *string { + if t == nil { + return nil + } + return t.ID +} + +func (t *TBEgressRule) GetIngressScopes() []string { + if t == nil { + return nil + } + return t.IngressScopes +} + +func (t *TBEgressRule) GetMethods() []string { + if t == nil { + return nil + } + return t.Methods +} + +func (t *TBEgressRule) GetMode() *TBEgressRuleMode { + if t == nil { + return nil + } + return t.Mode +} + +func (t *TBEgressRule) GetOutcome() *TBEgressRuleOutcome { + if t == nil { + return nil + } + return t.Outcome +} + +func (t *TBEgressRule) GetPaths() []string { + if t == nil { + return nil + } + return t.Paths +} + +func (t *TBEgressRule) GetPostureID() *string { + if t == nil { + return nil + } + return t.PostureID +} + +func (t *TBEgressRule) GetPrincipals() []string { + if t == nil { + return nil + } + return t.Principals +} + +func (t *TBEgressRule) GetPriority() *int { + if t == nil { + return nil + } + return t.Priority +} + +func (t *TBEgressRule) GetSourceTemplateID() *string { + if t == nil { + return nil + } + return t.SourceTemplateID +} + +func (t *TBEgressRule) GetSystemManaged() *bool { + if t == nil { + return nil + } + return t.SystemManaged +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/triggerautomationdispatcher.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/triggerautomationdispatcher.go new file mode 100644 index 00000000..c677ef07 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/triggerautomationdispatcher.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// TriggerAutomationDispatcher runs a C1 automation by id (the "Run now" path). +type TriggerAutomationDispatcher struct { + // ID of the C1 automation/workflow to run. + AutomationID *string `json:"automationId,omitempty"` + // Inputs passed to the automation, keyed by input name (v0: verbatim values; + // CEL evaluation is a later phase). + InputMapping map[string]string `json:"inputMapping,omitempty"` +} + +func (t *TriggerAutomationDispatcher) GetAutomationID() *string { + if t == nil { + return nil + } + return t.AutomationID +} + +func (t *TriggerAutomationDispatcher) GetInputMapping() map[string]string { + if t == nil { + return nil + } + return t.InputMapping +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/unusedsecretevidence.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/unusedsecretevidence.go new file mode 100644 index 00000000..7b766b4b --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/unusedsecretevidence.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +import ( + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "time" +) + +// The UnusedSecretEvidence message. +type UnusedSecretEvidence struct { + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` +} + +func (u UnusedSecretEvidence) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnusedSecretEvidence) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UnusedSecretEvidence) GetLastUsedAt() *time.Time { + if u == nil { + return nil + } + return u.LastUsedAt +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/unusedsecrettype.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/unusedsecrettype.go new file mode 100644 index 00000000..7bdef948 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/unusedsecrettype.go @@ -0,0 +1,9 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// UnusedSecretType - UnusedSecretType: a secret-trait AppResource has not been used in over the +// +// detector's staleness threshold. Target: AppResourceTarget. +type UnusedSecretType struct { +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingassigneerequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingassigneerequest.go new file mode 100644 index 00000000..06aaf669 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingassigneerequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The UpdateFindingAssigneeRequest message. +type UpdateFindingAssigneeRequest struct { + // The identity user to assign. Empty clears the assignment. + AssigneeIdentityUserID *string `json:"assigneeIdentityUserId,omitempty"` +} + +func (u *UpdateFindingAssigneeRequest) GetAssigneeIdentityUserID() *string { + if u == nil { + return nil + } + return u.AssigneeIdentityUserID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingassigneeresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingassigneeresponse.go new file mode 100644 index 00000000..2da1c14a --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingassigneeresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The UpdateFindingAssigneeResponse message. +type UpdateFindingAssigneeResponse struct { + Finding *Finding `json:"finding,omitempty"` +} + +func (u *UpdateFindingAssigneeResponse) GetFinding() *Finding { + if u == nil { + return nil + } + return u.Finding +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingsettingsrequest.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingsettingsrequest.go new file mode 100644 index 00000000..f70801e7 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingsettingsrequest.go @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The UpdateFindingSettingsRequest message. +type UpdateFindingSettingsRequest struct { + // Applied as one atomic write, so an admin changing several types either + // lands all of them or none. Empty is valid: a never-configured tenant's + // "accept the defaults" save has nothing to diff, and the empty write still + // creates the settings row. + Settings []FindingSettingsEntry `json:"settings,omitempty"` +} + +func (u *UpdateFindingSettingsRequest) GetSettings() []FindingSettingsEntry { + if u == nil { + return nil + } + return u.Settings +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingsettingsresponse.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingsettingsresponse.go new file mode 100644 index 00000000..3af3e5d9 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/updatefindingsettingsresponse.go @@ -0,0 +1,17 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// The UpdateFindingSettingsResponse message. +type UpdateFindingSettingsResponse struct { + // The full catalog after the write, in the same shape ListFindingSettings + // returns. + List []FindingTypeSetting `json:"list,omitempty"` +} + +func (u *UpdateFindingSettingsResponse) GetList() []FindingTypeSetting { + if u == nil { + return nil + } + return u.List +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/waitingfordeviceplacement.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/waitingfordeviceplacement.go new file mode 100644 index 00000000..03fc5105 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/waitingfordeviceplacement.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// WaitingForDevicePlacement - Describes a provision step that is paused until the recipient joins the vault's MLS group. +type WaitingForDevicePlacement struct { + // The ID of the user being placed. + RecipientUserID *string `json:"recipientUserId,omitempty"` + // The ID of the vault boundary the recipient is being placed in. + VaultBoundaryID *string `json:"vaultBoundaryId,omitempty"` +} + +func (w *WaitingForDevicePlacement) GetRecipientUserID() *string { + if w == nil { + return nil + } + return w.RecipientUserID +} + +func (w *WaitingForDevicePlacement) GetVaultBoundaryID() *string { + if w == nil { + return nil + } + return w.VaultBoundaryID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/waitingforentitlementmerge.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/waitingforentitlementmerge.go new file mode 100644 index 00000000..5edc9663 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/waitingforentitlementmerge.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// WaitingForEntitlementMerge - Describes a provision step that is paused until the target entitlement, created ahead of connector sync with a Baton match ID, is merged with its connector-synced counterpart. +type WaitingForEntitlementMerge struct { + // The ID of the entitlement being waited on. + AppEntitlementID *string `json:"appEntitlementId,omitempty"` + // The ID of the app the awaited entitlement belongs to. + AppID *string `json:"appId,omitempty"` +} + +func (w *WaitingForEntitlementMerge) GetAppEntitlementID() *string { + if w == nil { + return nil + } + return w.AppEntitlementID +} + +func (w *WaitingForEntitlementMerge) GetAppID() *string { + if w == nil { + return nil + } + return w.AppID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/webhookdispatcher.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/webhookdispatcher.go new file mode 100644 index 00000000..3b4ad047 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/webhookdispatcher.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package shared + +// WebhookDispatcher POSTs to a registered webhook (webhooks v3). +type WebhookDispatcher struct { + // Optional payload template; empty uses the default finding payload. + PayloadTemplate *string `json:"payloadTemplate,omitempty"` + // ID of a registered webhook to POST to. + WebhookID *string `json:"webhookId,omitempty"` +} + +func (w *WebhookDispatcher) GetPayloadTemplate() *string { + if w == nil { + return nil + } + return w.PayloadTemplate +} + +func (w *WebhookDispatcher) GetWebhookID() *string { + if w == nil { + return nil + } + return w.WebhookID +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/xaaclientaudiencemapping.go b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/xaaclientaudiencemapping.go index 553f3463..ea81143d 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/xaaclientaudiencemapping.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/pkg/models/shared/xaaclientaudiencemapping.go @@ -14,8 +14,8 @@ type XAAClientAudienceMapping struct { // The client's identifier at the resource authorization server. Stamped // verbatim into the grant's client_id claim. AudienceClientID *string `json:"audienceClientId,omitempty"` - // Stable client registration key. One of: a DCR software_id form - // (dcr://), a CIMD client_id URL, a native C1 form + // Stable client registration key. One of: a DCR client_id form + // (dcr://), a CIMD client_id URL, a native C1 form // (c1://), or a raw client_id. ClientKey *string `json:"clientKey,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/providercredential.go b/vendor/github.com/conductorone/conductorone-sdk-go/providercredential.go new file mode 100644 index 00000000..ce20f362 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/providercredential.go @@ -0,0 +1,667 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" +) + +type ProviderCredential struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newProviderCredential(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *ProviderCredential { + return &ProviderCredential{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Clear +// Clear deletes the provider credential stored in the given slot. +func (s *ProviderCredential) Clear(ctx context.Context, request operations.C1APILlmGatewayV1ProviderCredentialServiceClearRequest, opts ...operations.Option) (*operations.C1APILlmGatewayV1ProviderCredentialServiceClearResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/llm-gateway/provider-credentials/{slot_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.llm_gateway.v1.ProviderCredentialService.Clear", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "ClearProviderCredentialRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APILlmGatewayV1ProviderCredentialServiceClearResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ClearProviderCredentialResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ClearProviderCredentialResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Get +// Get returns metadata for the provider credential in the given slot. The +// +// stored API key is never returned. Returns an empty response if no +// credential has ever been set for the slot; a cleared slot returns +// FAILED_PRECONDITION. +func (s *ProviderCredential) Get(ctx context.Context, request operations.C1APILlmGatewayV1ProviderCredentialServiceGetRequest, opts ...operations.Option) (*operations.C1APILlmGatewayV1ProviderCredentialServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/llm-gateway/provider-credentials/{slot_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.llm_gateway.v1.ProviderCredentialService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APILlmGatewayV1ProviderCredentialServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.GetProviderCredentialResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.GetProviderCredentialResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Set +// Set stores or replaces the provider API key used by the LLM gateway for +// +// the given slot. The API key is stored encrypted and is never returned by +// the API. +func (s *ProviderCredential) Set(ctx context.Context, request operations.C1APILlmGatewayV1ProviderCredentialServiceSetRequest, opts ...operations.Option) (*operations.C1APILlmGatewayV1ProviderCredentialServiceSetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/llm-gateway/provider-credentials/{slot_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.llm_gateway.v1.ProviderCredentialService.Set", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SetProviderCredentialRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APILlmGatewayV1ProviderCredentialServiceSetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SetProviderCredentialResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SetProviderCredentialResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/reporting.go b/vendor/github.com/conductorone/conductorone-sdk-go/reporting.go new file mode 100644 index 00000000..a0032c8c --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/reporting.go @@ -0,0 +1,1728 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type Reporting struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newReporting(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Reporting { + return &Reporting{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Delete +// Delete removes a report by ID. The report's saved program is removed with +// +// it, so the report can no longer be re-run. Only the report's creator can +// delete it. +func (s *Reporting) Delete(ctx context.Context, request operations.C1APIReportingV1ReportingServiceDeleteRequest, opts ...operations.Option) (*operations.C1APIReportingV1ReportingServiceDeleteResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/reporting/reports/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.reporting.v1.ReportingService.Delete", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "ReportingServiceDeleteRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIReportingV1ReportingServiceDeleteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ReportingServiceDeleteResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReportingServiceDeleteResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Get +// Get returns a report by ID, including its latest run and latest successful +// +// run. Reports are visible only to the user who created them. +func (s *Reporting) Get(ctx context.Context, request operations.C1APIReportingV1ReportingServiceGetRequest, opts ...operations.Option) (*operations.C1APIReportingV1ReportingServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/reporting/reports/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.reporting.v1.ReportingService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIReportingV1ReportingServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ReportingServiceGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReportingServiceGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetProgram - Get Program +// GetProgram returns the report's current durable source without attaching it +// +// to the notification-driven report response. Reports are creator-scoped. +func (s *Reporting) GetProgram(ctx context.Context, request operations.C1APIReportingV1ReportingServiceGetProgramRequest, opts ...operations.Option) (*operations.C1APIReportingV1ReportingServiceGetProgramResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/reporting/reports/{id}/program", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.reporting.v1.ReportingService.GetProgram", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIReportingV1ReportingServiceGetProgramResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ReportingServiceGetProgramResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReportingServiceGetProgramResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetRunProvenance - Get Run Provenance +// GetRunProvenance explains a run: what it read, what its program looked at, +// +// and the program itself. A2UIService.GetSurfaceProvenance answers the same +// question for a surface, but needs a live one — and a rerun is headless, so +// a report would become less explainable every time it refreshed. +func (s *Reporting) GetRunProvenance(ctx context.Context, request operations.C1APIReportingV1ReportingServiceGetRunProvenanceRequest, opts ...operations.Option) (*operations.C1APIReportingV1ReportingServiceGetRunProvenanceResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/reporting/reports/{id}/runs/{run_id}/provenance", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.reporting.v1.ReportingService.GetRunProvenance", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIReportingV1ReportingServiceGetRunProvenanceResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ReportingServiceGetRunProvenanceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReportingServiceGetRunProvenanceResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// List +// List returns reports created by the caller, newest first. +func (s *Reporting) List(ctx context.Context, request operations.C1APIReportingV1ReportingServiceListRequest, opts ...operations.Option) (*operations.C1APIReportingV1ReportingServiceListResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/reporting/reports") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.reporting.v1.ReportingService.List", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIReportingV1ReportingServiceListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ReportingServiceListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReportingServiceListResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Run +// Run re-executes the report's pinned program against today's data. It never +// +// re-plans: the commit is fixed, so a rerun can only change the numbers, not +// the question. Returns as soon as the invocation starts — see the response. +func (s *Reporting) Run(ctx context.Context, request operations.C1APIReportingV1ReportingServiceRunRequest, opts ...operations.Option) (*operations.C1APIReportingV1ReportingServiceRunResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/reporting/reports/{id}/run", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.reporting.v1.ReportingService.Run", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "ReportingServiceRunRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIReportingV1ReportingServiceRunResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ReportingServiceRunResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReportingServiceRunResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Save +// Save copies the program behind an already-rendered reporting surface into +// +// a report. The caller identifies the surface; the server resolves which +// program produced it. There is no create-from-prompt: the prompt has already +// been answered by the time a report is worth keeping. +func (s *Reporting) Save(ctx context.Context, request *shared.ReportingServiceSaveRequest, opts ...operations.Option) (*operations.C1APIReportingV1ReportingServiceSaveResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/reporting/reports") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.reporting.v1.ReportingService.Save", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIReportingV1ReportingServiceSaveResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ReportingServiceSaveResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReportingServiceSaveResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Update +// Update modifies a report's display name, prompt, or parameter values. +// +// Only the report's creator can update it. +func (s *Reporting) Update(ctx context.Context, request operations.C1APIReportingV1ReportingServiceUpdateRequest, opts ...operations.Option) (*operations.C1APIReportingV1ReportingServiceUpdateResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/reporting/reports/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.reporting.v1.ReportingService.Update", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "ReportingServiceUpdateRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIReportingV1ReportingServiceUpdateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.ReportingServiceUpdateResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReportingServiceUpdateResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/requestcatalogmanagement.go b/vendor/github.com/conductorone/conductorone-sdk-go/requestcatalogmanagement.go index b10da8f4..31a119bc 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/requestcatalogmanagement.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/requestcatalogmanagement.go @@ -3386,6 +3386,221 @@ func (s *RequestCatalogManagement) ListEntitlementsPerCatalog(ctx context.Contex } +// PlanTypeChange - Plan Type Change +// PlanTypeChange reports settings that must be turned off before Update can +// +// change an access profile to the requested type. It does not modify the +// profile or any associated state. +func (s *RequestCatalogManagement) PlanTypeChange(ctx context.Context, request operations.C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeRequest, opts ...operations.Option) (*operations.C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/catalogs/{request_catalog_id}/type-change/plan", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.requestcatalog.v1.RequestCatalogManagementService.PlanTypeChange", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestCatalogManagementServicePlanTypeChangeRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIRequestcatalogV1RequestCatalogManagementServicePlanTypeChangeResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.RequestCatalogManagementServicePlanTypeChangeResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.RequestCatalogManagementServicePlanTypeChangeResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // RemoveAccessEntitlements - Remove Access Entitlements // Remove visibility bindings (access entitlements) from a catalog. func (s *RequestCatalogManagement) RemoveAccessEntitlements(ctx context.Context, request operations.C1APIRequestcatalogV1RequestCatalogManagementServiceRemoveAccessEntitlementsRequest, opts ...operations.Option) (*operations.C1APIRequestcatalogV1RequestCatalogManagementServiceRemoveAccessEntitlementsResponse, error) { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/roleminingmanagement.go b/vendor/github.com/conductorone/conductorone-sdk-go/roleminingmanagement.go index 64612f84..d8a71b9b 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/roleminingmanagement.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/roleminingmanagement.go @@ -246,8 +246,226 @@ func (s *RoleMiningManagement) CreateAccessProfileFromCohort(ctx context.Context } +// EvaluateEntitlementSelection - Evaluate Entitlement Selection +// Evaluate the exact cohort impact of an entitlement cutoff and manual overrides. +// +// The analysis determines the eligible entitlements and cohort definition. +func (s *RoleMiningManagement) EvaluateEntitlementSelection(ctx context.Context, request operations.C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionRequest, opts ...operations.Option) (*operations.C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/role-mining/custom-analysis/{analysis_id}/evaluate-entitlement-selection", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.role_mining_management.v1.RoleMiningManagementService.EvaluateEntitlementSelection", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "EvaluateEntitlementSelectionRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIRoleMiningManagementV1RoleMiningManagementServiceEvaluateEntitlementSelectionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.EvaluateEntitlementSelectionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.EvaluateEntitlementSelectionResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // GetCustomAnalysisResult - Get Custom Analysis Result -// Invokes the c1.api.role_mining_management.v1.RoleMiningManagementService.GetCustomAnalysisResult method. +// GetCustomAnalysisResult returns the status and results of a custom cohort +// +// analysis started with TriggerCustomAnalysis, including entitlement +// coverage, entitlement clusters, attribute facets, and cutoff impact +// points. Requires the agentic role mining feature. func (s *RoleMiningManagement) GetCustomAnalysisResult(ctx context.Context, request operations.C1APIRoleMiningManagementV1RoleMiningManagementServiceGetCustomAnalysisResultRequest, opts ...operations.Option) (*operations.C1APIRoleMiningManagementV1RoleMiningManagementServiceGetCustomAnalysisResultResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -2106,7 +2324,11 @@ func (s *RoleMiningManagement) TriggerAnalysis(ctx context.Context, request *sha } // TriggerCustomAnalysis - Trigger Custom Analysis -// Invokes the c1.api.role_mining_management.v1.RoleMiningManagementService.TriggerCustomAnalysis method. +// TriggerCustomAnalysis starts an asynchronous custom cohort analysis defined +// +// by the given profile filters and returns the ID of the analysis result. +// Requires the agentic role mining feature. Poll GetCustomAnalysisResult +// until the analysis completes. func (s *RoleMiningManagement) TriggerCustomAnalysis(ctx context.Context, request *shared.TriggerCustomAnalysisRequest, opts ...operations.Option) (*operations.C1APIRoleMiningManagementV1RoleMiningManagementServiceTriggerCustomAnalysisResponse, error) { o := operations.Options{} supportedOptions := []string{ diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/sessionpolicy.go b/vendor/github.com/conductorone/conductorone-sdk-go/sessionpolicy.go index 09ce0de6..5eee039b 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/sessionpolicy.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/sessionpolicy.go @@ -13,8 +13,11 @@ import ( "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" "github.com/conductorone/conductorone-sdk-go/pkg/retry" "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "github.com/spyzhov/ajson" "net/http" "net/url" + "strconv" + "strings" ) type SessionPolicy struct { @@ -1088,6 +1091,215 @@ func (s *SessionPolicy) Get(ctx context.Context, request operations.C1APISession } +// GetEffectiveSessionPolicy - Get Effective Session Policy +// Returns the single effective session policy for a user and why it applies: +// +// the assigned policy with the highest priority, else the tenant default, +// else none. Read-only and diagnostic: it reflects current assignment state +// rather than the resolver's cached resolution. +func (s *SessionPolicy) GetEffectiveSessionPolicy(ctx context.Context, request operations.C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyRequest, opts ...operations.Option) (*operations.C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/users/{user_id}/effective-session-policy", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.session_policy.v1.SessionPolicyService.GetEffectiveSessionPolicy", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISessionPolicyV1SessionPolicyServiceGetEffectiveSessionPolicyResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SessionPolicyServiceGetEffectiveSessionPolicyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SessionPolicyServiceGetEffectiveSessionPolicyResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // List // List all session policies in your tenant, one page at a time. func (s *SessionPolicy) List(ctx context.Context, request operations.C1APISessionPolicyV1SessionPolicyServiceListRequest, opts ...operations.Option) (*operations.C1APISessionPolicyV1SessionPolicyServiceListResponse, error) { @@ -1508,11 +1720,13 @@ func (s *SessionPolicy) ListAssignments(ctx context.Context, request operations. } -// Search -// Search session policies by name, or fetch a specific set by ID. Returns +// ListUserPolicies - List User Policies +// Lists every session policy that applies to a user — direct, // -// one page of matching policies at a time. -func (s *SessionPolicy) Search(ctx context.Context, request *shared.SessionPolicyServiceSearchRequest, opts ...operations.Option) (*operations.C1APISessionPolicyV1SessionPolicyServiceSearchResponse, error) { +// group-conferred, and the tenant default when set — each with its source. +// Candidates are returned in assignment order; the resolver's priority +// tie-break happens at evaluation, not here. +func (s *SessionPolicy) ListUserPolicies(ctx context.Context, request operations.C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesRequest, opts ...operations.Option) (*operations.C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1531,7 +1745,7 @@ func (s *SessionPolicy) Search(ctx context.Context, request *shared.SessionPolic } else { baseURL = *o.ServerURL } - opURL, err := url.JoinPath(baseURL, "/api/v1/search/session-policies") + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/users/{user_id}/session-policies", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1541,14 +1755,10 @@ func (s *SessionPolicy) Search(ctx context.Context, request *shared.SessionPolic SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "c1.api.session_policy.v1.SessionPolicyService.Search", + OperationID: "c1.api.session_policy.v1.SessionPolicyService.ListUserPolicies", OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) - if err != nil { - return nil, err - } timeout := o.Timeout if timeout == nil { @@ -1561,15 +1771,12 @@ func (s *SessionPolicy) Search(ctx context.Context, request *shared.SessionPolic defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if reqContentType != "" { - req.Header.Set("Content-Type", reqContentType) - } if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -1670,7 +1877,7 @@ func (s *SessionPolicy) Search(ctx context.Context, request *shared.SessionPolic } } - res := &operations.C1APISessionPolicyV1SessionPolicyServiceSearchResponse{ + res := &operations.C1APISessionPolicyV1SessionPolicyServiceListUserPoliciesResponse{ StatusCode: httpRes.StatusCode, ContentType: httpRes.Header.Get("Content-Type"), RawResponse: httpRes, @@ -1685,12 +1892,490 @@ func (s *SessionPolicy) Search(ctx context.Context, request *shared.SessionPolic return nil, err } - var out shared.SessionPolicyServiceSearchResponse + var out shared.SessionPolicyServiceListUserPoliciesResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.SessionPolicyServiceSearchResponse = &out + res.SessionPolicyServiceListUserPoliciesResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Search +// Search session policies by name, or fetch a specific set by ID. Returns +// +// one page of matching policies at a time. +func (s *SessionPolicy) Search(ctx context.Context, request *shared.SessionPolicyServiceSearchRequest, opts ...operations.Option) (*operations.C1APISessionPolicyV1SessionPolicyServiceSearchResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/search/session-policies") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.session_policy.v1.SessionPolicyService.Search", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISessionPolicyV1SessionPolicyServiceSearchResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SessionPolicyServiceSearchResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SessionPolicyServiceSearchResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SearchPolicyUsers - Search Policy Users +// Searches the users a policy applies to, expanded: direct assignments plus +// +// per-user expansion of conferred groups, one page at a time. Served from +// the asynchronously-replicated Postgres mirror of the binding store, so a +// just-made assignment may not appear immediately; the user-scoped reads +// (GetEffectiveSessionPolicy, ListUserPolicies) reflect current state. +// Search, not List: the results are a filtered, server-paginated discovery +// over the binding store (query and source facets), not a bounded +// collection of a named object. +func (s *SessionPolicy) SearchPolicyUsers(ctx context.Context, request operations.C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersRequest, opts ...operations.Option) (*operations.C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/session-policies/{id}/users/search", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.session_policy.v1.SessionPolicyService.SearchPolicyUsers", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SessionPolicyServiceSearchPolicyUsersRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + res.Next = func() (*operations.C1APISessionPolicyV1SessionPolicyServiceSearchPolicyUsersResponse, error) { + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + b, err := ajson.Unmarshal(rawBody) + if err != nil { + return nil, err + } + nC, err := ajson.Eval(b, "$.nextPageToken") + if err != nil { + return nil, err + } + var nCVal string + + if nC.IsNumeric() { + numVal, err := nC.GetNumeric() + if err != nil { + return nil, err + } + // GetNumeric returns as float64 so convert to the appropriate type. + nCVal = strconv.FormatFloat(numVal, 'f', 0, 64) + } else { + val, err := nC.Value() + if err != nil { + return nil, err + } + if val == nil { + return nil, nil + } + nCVal = val.(string) + if strings.TrimSpace(nCVal) == "" { + return nil, nil + } + } + request.SessionPolicyServiceSearchPolicyUsersRequest.PageToken = &nCVal + + return s.SearchPolicyUsers( + ctx, + request, + opts..., + ) + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SessionPolicyServiceSearchPolicyUsersResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SessionPolicyServiceSearchPolicyUsersResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/ssoapplication.go b/vendor/github.com/conductorone/conductorone-sdk-go/ssoapplication.go new file mode 100644 index 00000000..7e3f5027 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/ssoapplication.go @@ -0,0 +1,3240 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type SSOApplication struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newSSOApplication(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *SSOApplication { + return &SSOApplication{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// BatchDeleteSubjectCompatibility - Batch Delete Subject Compatibility +// Deletes one bounded batch of compatibility bindings. Imported and +// +// user-attribute-derived bindings are recoverable so corrected source data +// can be applied on the next import or sign-in. Correct attribute source data +// before deleting its binding so a concurrent sign-in cannot recreate the +// stale value. +func (s *SSOApplication) BatchDeleteSubjectCompatibility(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}/subjects/delete", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.BatchDeleteSubjectCompatibility", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SSOApplicationServiceBatchDeleteSubjectCompatibilityRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceBatchDeleteSubjectCompatibilityResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// BatchImportSubjectCompatibility - Batch Import Subject Compatibility +// Validates or imports one bounded batch of compatibility-subject bindings. +// +// Clients parse source files and submit at most 50 rows per request so they +// can expose progress and retry from a known boundary. +func (s *SSOApplication) BatchImportSubjectCompatibility(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}/subjects/import", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.BatchImportSubjectCompatibility", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SSOApplicationServiceBatchImportSubjectCompatibilityRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceBatchImportSubjectCompatibilityResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceBatchImportSubjectCompatibilityResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceBatchImportSubjectCompatibilityResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Create +// Create an SSO application for an application in your catalog. The +// +// entitlement that governs sign-in is created alongside it. OIDC creation +// also server-mints the required initial client and returns its secret once +// when the client is confidential. SAML creation has no OAuth-client step. +func (s *SSOApplication) Create(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceCreateRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceCreateResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.Create", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SSOApplicationServiceCreateRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceCreateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceCreateResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceCreateResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CreateClient - Create Client +// CreateClient mints an additional App-owned OAuth client for an OIDC +// +// application. C1 generates the client ID and any confidential-client secret. +func (s *SSOApplication) CreateClient(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceCreateClientRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceCreateClientResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}/clients", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.CreateClient", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SSOApplicationServiceCreateClientRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceCreateClientResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceCreateClientResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceCreateClientResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Delete +// Delete retires an SSO application and its sign-in entitlement, stopping +// +// OIDC and SAML sign-in through it. OAuth clients and locator bindings remain +// so administrators can list and delete retained clients; the bindings are +// inert while their parent application is deleted. +func (s *SSOApplication) Delete(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceDeleteRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceDeleteResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.Delete", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SSOApplicationServiceDeleteRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceDeleteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceDeleteResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceDeleteResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteClient - Delete Client +// DeleteClient deletes one App-owned OAuth client and its sign-in binding. +func (s *SSOApplication) DeleteClient(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceDeleteClientRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceDeleteClientResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}/clients/delete", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.DeleteClient", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SSOApplicationServiceDeleteClientRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceDeleteClientResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceDeleteClientResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceDeleteClientResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Get +// Get returns a single SSO application by app_id + id. +func (s *SSOApplication) Get(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceGetRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// List +// List returns the SSO applications configured for an application, one page +// +// at a time. +func (s *SSOApplication) List(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceListRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceListResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.List", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceListResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListClients - List Clients +// ListClients returns the App-owned OAuth clients minted for an OIDC +// +// application, one page at a time. Results hydrate from the PostgreSQL +// projection, so a newly created client may appear after a brief delay. +func (s *SSOApplication) ListClients(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceListClientsRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceListClientsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}/clients", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.ListClients", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceListClientsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceListClientsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceListClientsResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHistory - List History +// ListHistory returns the change history (newest first) for a single SSO +// +// application — each entry is a snapshot plus who/when metadata. +func (s *SSOApplication) ListHistory(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceListHistoryRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceListHistoryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}/history", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.ListHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceListHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceListHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceListHistoryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ParseSAMLServiceProviderMetadata - Parse Saml Service Provider Metadata +// ParseSAMLServiceProviderMetadata parses one uploaded SAML service-provider +// +// metadata document and returns the SAML configuration it implies, without +// creating or changing anything. The document is not stored. Use it to +// preview an SP's capabilities before creating a SAML application; edit the +// returned configuration before passing it to Create. Only upload or paste a +// customer-supplied document -- C1 does not fetch metadata URLs. +func (s *SSOApplication) ParseSAMLServiceProviderMetadata(ctx context.Context, request *shared.SSOApplicationServiceParseSAMLServiceProviderMetadataRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceParseSAMLServiceProviderMetadataResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/sso/applications/saml/parse-sp-metadata") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.ParseSAMLServiceProviderMetadata", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceParseSAMLServiceProviderMetadataResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceParseSAMLServiceProviderMetadataResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceParseSAMLServiceProviderMetadataResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RotateClientSecret - Rotate Client Secret +// RotateClientSecret replaces a confidential App-owned client's secret and +// +// returns the new value once. The old secret stops working immediately; for +// an overlap window, create a second client, migrate, then delete the first. +// Public clients have no secret to rotate. +func (s *SSOApplication) RotateClientSecret(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceRotateClientSecretRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceRotateClientSecretResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}/clients/rotate-secret", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.RotateClientSecret", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SSOApplicationServiceRotateClientSecretRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceRotateClientSecretResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceRotateClientSecretResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceRotateClientSecretResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Search +// Search SSO applications across the tenant. Supports filtering by the +// +// applications in your catalog and by display-name or description text. +func (s *SSOApplication) Search(ctx context.Context, request *shared.SSOApplicationServiceSearchRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceSearchResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/search/sso/applications") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.Search", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceSearchResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceSearchResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceSearchResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Update +// Update changes an SSO application's mutable display, lifetime, enablement, +// +// OIDC claim/signing settings, or SAML endpoint/signing/encryption settings. +// Protocol, subject type, sector, SAML entity ID, and NameID format remain +// immutable; requests that would change them are rejected. +func (s *SSOApplication) Update(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceUpdateRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceUpdateResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.Update", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SSOApplicationServiceUpdateRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceUpdateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceUpdateResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceUpdateResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UpdateClient - Update Client +// UpdateClient replaces mutable client configuration. The authentication +// +// method and generated ID are immutable; private-key JWKS may rotate and a +// legacy PKCE policy may tighten to required. +func (s *SSOApplication) UpdateClient(ctx context.Context, request operations.C1APISSOV1SSOApplicationServiceUpdateClientRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOApplicationServiceUpdateClientResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/apps/{app_id}/sso/applications/{id}/clients/update", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOApplicationService.UpdateClient", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SSOApplicationServiceUpdateClientRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOApplicationServiceUpdateClientResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOApplicationServiceUpdateClientResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOApplicationServiceUpdateClientResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/ssosettings.go b/vendor/github.com/conductorone/conductorone-sdk-go/ssosettings.go new file mode 100644 index 00000000..fe40f3c3 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/ssosettings.go @@ -0,0 +1,662 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type SSOSettings struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newSSOSettings(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *SSOSettings { + return &SSOSettings{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Get +// Get returns the tenant's SSO provider settings. +func (s *SSOSettings) Get(ctx context.Context, opts ...operations.Option) (*operations.C1APISSOV1SSOSettingsServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/settings/sso") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOSettingsService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOSettingsServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOSettingsServiceGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOSettingsServiceGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHistory - List History +// ListHistory returns the SSO settings change history, newest first. +func (s *SSOSettings) ListHistory(ctx context.Context, request operations.C1APISSOV1SSOSettingsServiceListHistoryRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOSettingsServiceListHistoryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/settings/sso/history") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOSettingsService.ListHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOSettingsServiceListHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOSettingsServiceListHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOSettingsServiceListHistoryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Update +// Update changes the tenant's SSO provider settings. Supply the settings +// +// object and an update mask listing the fields to change; only masked fields +// are applied. Editable paths: enabled, default_subject_type, +// default_assertion_lifetime, default_id_token_signed_response_alg. +func (s *SSOSettings) Update(ctx context.Context, request *shared.SSOSettingsServiceUpdateRequest, opts ...operations.Option) (*operations.C1APISSOV1SSOSettingsServiceUpdateResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/settings/sso") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.sso.v1.SSOSettingsService.Update", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APISSOV1SSOSettingsServiceUpdateResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SSOSettingsServiceUpdateResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SSOSettingsServiceUpdateResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/subjectapplimit.go b/vendor/github.com/conductorone/conductorone-sdk-go/subjectapplimit.go new file mode 100644 index 00000000..53878019 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/subjectapplimit.go @@ -0,0 +1,1534 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type SubjectAppLimit struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newSubjectAppLimit(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *SubjectAppLimit { + return &SubjectAppLimit{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Delete +// Remove the subject's limit on this app entirely. The app is then bounded +// +// only by the fund, by any tenant-wide cap, and by whatever the subject +// sets again themselves. +func (s *SubjectAppLimit) Delete(ctx context.Context, request operations.C1APIFundsV1SubjectAppLimitServiceDeleteRequest, opts ...operations.Option) (*operations.C1APIFundsV1SubjectAppLimitServiceDeleteResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/subject-app-limits/{user_id}/{app_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.SubjectAppLimitService.Delete", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SubjectAppLimitServiceDeleteRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1SubjectAppLimitServiceDeleteResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SubjectAppLimitServiceDeleteResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SubjectAppLimitServiceDeleteResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Get +// Get returns one subject's limit row for one app, together with any +// +// suspension acting as their pause. A subject with no row for this app is +// not found, meaning nothing bounds the app beyond the layers above. +func (s *SubjectAppLimit) Get(ctx context.Context, request operations.C1APIFundsV1SubjectAppLimitServiceGetRequest, opts ...operations.Option) (*operations.C1APIFundsV1SubjectAppLimitServiceGetResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/subject-app-limits/{user_id}/{app_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.SubjectAppLimitService.Get", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1SubjectAppLimitServiceGetResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SubjectAppLimitServiceGetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SubjectAppLimitServiceGetResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListHistory - List History +// List the change history for one subject's limit on one app, newest +// +// first. Admin-tier per the object-history convention, and the same +// ObjectHistory stream the subject reads through MyFundLimitsService: +// admin-originated mutations are attributable here and self-service +// history shows them to the subject. +func (s *SubjectAppLimit) ListHistory(ctx context.Context, request operations.C1APIFundsV1SubjectAppLimitServiceListHistoryRequest, opts ...operations.Option) (*operations.C1APIFundsV1SubjectAppLimitServiceListHistoryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/subject-app-limits/{user_id}/{app_id}/history", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.SubjectAppLimitService.ListHistory", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1SubjectAppLimitServiceListHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SubjectAppLimitServiceListHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SubjectAppLimitServiceListHistoryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Search +// Search the tenant's subject-app limit rows. Reads the Postgres mirror: +// +// the runtime row is keyed on (tenant, subject), so a tenant-wide listing +// has no runtime query at all. Filters narrow by subject, by app, and by +// state; empty filters return every live row in the tenant. +// +// POST rather than GET: the filters are repeated fields, which the gateway +// cannot carry as query parameters. Pagination is keyset-based over +// (pksk), the storage primary key, so a concurrent write to a filtered +// field cannot duplicate or omit a row across pages the way an offset page +// can. +func (s *SubjectAppLimit) Search(ctx context.Context, request *shared.SubjectAppLimitServiceSearchRequest, opts ...operations.Option) (*operations.C1APIFundsV1SubjectAppLimitServiceSearchResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/funds/subject-app-limits/search") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.SubjectAppLimitService.Search", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1SubjectAppLimitServiceSearchResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SubjectAppLimitServiceSearchResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SubjectAppLimitServiceSearchResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SetLimit - Set Limit +// Cap what one app may take from this subject's fund, creating the row if +// +// absent. Amount arm only; leaves any pause in place. +func (s *SubjectAppLimit) SetLimit(ctx context.Context, request operations.C1APIFundsV1SubjectAppLimitServiceSetLimitRequest, opts ...operations.Option) (*operations.C1APIFundsV1SubjectAppLimitServiceSetLimitResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/subject-app-limits/{user_id}/{app_id}/limit", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.SubjectAppLimitService.SetLimit", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SubjectAppLimitServiceSetLimitRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1SubjectAppLimitServiceSetLimitResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SubjectAppLimitServiceSetLimitResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SubjectAppLimitServiceSetLimitResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Suspend +// Pause one app on this subject's fund. The limit underneath is preserved +// +// and restored by Unsuspend. +func (s *SubjectAppLimit) Suspend(ctx context.Context, request operations.C1APIFundsV1SubjectAppLimitServiceSuspendRequest, opts ...operations.Option) (*operations.C1APIFundsV1SubjectAppLimitServiceSuspendResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/subject-app-limits/{user_id}/{app_id}/suspension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.SubjectAppLimitService.Suspend", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SubjectAppLimitServiceSuspendRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1SubjectAppLimitServiceSuspendResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SubjectAppLimitServiceSuspendResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SubjectAppLimitServiceSuspendResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Unsuspend +// Lift the pause, restoring the limit it froze. Clearing the last control +// +// removes the row, so a vacuous result is returned as an absent limit, the +// same way the self-service plane reports it. +func (s *SubjectAppLimit) Unsuspend(ctx context.Context, request operations.C1APIFundsV1SubjectAppLimitServiceUnsuspendRequest, opts ...operations.Option) (*operations.C1APIFundsV1SubjectAppLimitServiceUnsuspendResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/funds/subject-app-limits/{user_id}/{app_id}/suspension", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.funds.v1.SubjectAppLimitService.Unsuspend", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "SubjectAppLimitServiceUnsuspendRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIFundsV1SubjectAppLimitServiceUnsuspendResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.SubjectAppLimitServiceUnsuspendResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.SubjectAppLimitServiceUnsuspendResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/taskactions.go b/vendor/github.com/conductorone/conductorone-sdk-go/taskactions.go index d7678b10..dd1870e6 100644 --- a/vendor/github.com/conductorone/conductorone-sdk-go/taskactions.go +++ b/vendor/github.com/conductorone/conductorone-sdk-go/taskactions.go @@ -2156,6 +2156,221 @@ func (s *TaskActions) Restart(ctx context.Context, request operations.C1APITaskV } +// RetryProvisioning - Retry Provisioning +// Retry the provisioning of a task whose connector provisioning failed. Resets the +// +// failed connector actions and re-drives the connector, preserving the already-collected +// approvals. Only valid when the task's current provision step ended in an error. +func (s *TaskActions) RetryProvisioning(ctx context.Context, request operations.C1APITaskV1TaskActionsServiceRetryProvisioningRequest, opts ...operations.Option) (*operations.C1APITaskV1TaskActionsServiceRetryProvisioningResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/tasks/{task_id}/action/retry-provisioning", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.task.v1.TaskActionsService.RetryProvisioning", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "TaskActionsServiceRetryProvisioningRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APITaskV1TaskActionsServiceRetryProvisioningResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.TaskServiceActionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.TaskServiceActionResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // SkipStep - Skip Step // Skip a specific policy step in a task, advancing the task to the next step in the workflow. func (s *TaskActions) SkipStep(ctx context.Context, request operations.C1APITaskV1TaskActionsServiceSkipStepRequest, opts ...operations.Option) (*operations.C1APITaskV1TaskActionsServiceSkipStepResponse, error) { diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/tbcontrolplane.go b/vendor/github.com/conductorone/conductorone-sdk-go/tbcontrolplane.go new file mode 100644 index 00000000..da0a7331 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/tbcontrolplane.go @@ -0,0 +1,884 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type TBControlPlane struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newTBControlPlane(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *TBControlPlane { + return &TBControlPlane{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetDiscoverySnapshot - Get Discovery Snapshot +// GetDiscoverySnapshot returns the instance's latest self-reported +// +// vocabulary -- used by the authoring UI to build discovery-driven +// pickers (principals/scopes/destinations/postures/credentials/routes) +// independent of any policy read or write. +func (s *TBControlPlane) GetDiscoverySnapshot(ctx context.Context, request operations.C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotRequest, opts ...operations.Option) (*operations.C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/tb-control-plane/discovery/{tb_instance_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.tbcontrolplane.v1.TBControlPlaneService.GetDiscoverySnapshot", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APITbcontrolplaneV1TBControlPlaneServiceGetDiscoverySnapshotResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.TBControlPlaneServiceGetDiscoverySnapshotResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.TBControlPlaneServiceGetDiscoverySnapshotResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetEgressPolicy - Get Egress Policy +// GetEgressPolicy returns both the typed rules (for the authoring UI) and +// +// the compiled TB policy YAML + generation (for timebanditd's poller) in +// one call -- one instance's policy is small enough that splitting the +// two reads into separate RPCs would be pure surface area, not a real +// cost saving for either caller. +func (s *TBControlPlane) GetEgressPolicy(ctx context.Context, request operations.C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyRequest, opts ...operations.Option) (*operations.C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/v1/tb-control-plane/egress-policy/{tb_instance_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.tbcontrolplane.v1.TBControlPlaneService.GetEgressPolicy", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APITbcontrolplaneV1TBControlPlaneServiceGetEgressPolicyResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.TBControlPlaneServiceGetEgressPolicyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.TBControlPlaneServiceGetEgressPolicyResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// PushDiscovery - Push Discovery +// PushDiscovery records the vocabulary a Time Bandit instance reports for +// +// itself -- principal, scope, destination, credential recipe, posture and +// route names -- replacing any prior snapshot. Called by timebanditd when +// its local configuration changes. +func (s *TBControlPlane) PushDiscovery(ctx context.Context, request *shared.TBControlPlaneServicePushDiscoveryRequest, opts ...operations.Option) (*operations.C1APITbcontrolplaneV1TBControlPlaneServicePushDiscoveryResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/tb-control-plane/discovery") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.tbcontrolplane.v1.TBControlPlaneService.PushDiscovery", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APITbcontrolplaneV1TBControlPlaneServicePushDiscoveryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.TBControlPlaneServicePushDiscoveryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.TBControlPlaneServicePushDiscoveryResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// SaveEgressPolicy - Save Egress Policy +// SaveEgressPolicy validates every rule against the instance's latest +// +// discovery snapshot (principal/scope/destination/posture/credential +// must all be names discovery actually reported), bumps generation, and +// stores the result. Used by both the authoring UI (stage 3) and any +// direct API caller. +func (s *TBControlPlane) SaveEgressPolicy(ctx context.Context, request *shared.TBControlPlaneServiceSaveEgressPolicyRequest, opts ...operations.Option) (*operations.C1APITbcontrolplaneV1TBControlPlaneServiceSaveEgressPolicyResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/tb-control-plane/egress-policy") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.tbcontrolplane.v1.TBControlPlaneService.SaveEgressPolicy", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APITbcontrolplaneV1TBControlPlaneServiceSaveEgressPolicyResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.TBControlPlaneServiceSaveEgressPolicyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.TBControlPlaneServiceSaveEgressPolicyResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/github.com/conductorone/conductorone-sdk-go/uiconversations.go b/vendor/github.com/conductorone/conductorone-sdk-go/uiconversations.go new file mode 100644 index 00000000..f5b77e58 --- /dev/null +++ b/vendor/github.com/conductorone/conductorone-sdk-go/uiconversations.go @@ -0,0 +1,246 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package conductoronesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/conductorone/conductorone-sdk-go/internal/config" + "github.com/conductorone/conductorone-sdk-go/internal/hooks" + "github.com/conductorone/conductorone-sdk-go/pkg/models/operations" + "github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors" + "github.com/conductorone/conductorone-sdk-go/pkg/models/shared" + "github.com/conductorone/conductorone-sdk-go/pkg/retry" + "github.com/conductorone/conductorone-sdk-go/pkg/utils" + "net/http" + "net/url" +) + +type UIConversations struct { + rootSDK *ConductoroneAPI + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newUIConversations(rootSDK *ConductoroneAPI, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *UIConversations { + return &UIConversations{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// EnsureOnboardingSession - Ensure Onboarding Session +// EnsureOnboardingSession returns the tenant's active onboarding conversation, +// +// or creates and starts it once. Retries converge on the stored conversation. +func (s *UIConversations) EnsureOnboardingSession(ctx context.Context, request *shared.EnsureOnboardingSessionRequest, opts ...operations.Option) (*operations.C1APIConversationsV1UIConversationsServiceEnsureOnboardingSessionResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/api/v1/conversations/onboarding:ensure") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "c1.api.conversations.v1.UIConversationsService.EnsureOnboardingSession", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.C1APIConversationsV1UIConversationsServiceEnsureOnboardingSessionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.EnsureOnboardingSessionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.EnsureOnboardingSessionResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 14a858fc..3b6597e2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -32,7 +32,7 @@ github.com/conductorone/baton-sdk/pb/c1/config/v1 github.com/conductorone/baton-sdk/pb/c1/connector/v2 github.com/conductorone/baton-sdk/pkg/crypto/providers github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk -# github.com/conductorone/conductorone-sdk-go v1.29.0 +# github.com/conductorone/conductorone-sdk-go v1.29.1-0.20260905002051-ef0d92d9c5f2 ## explicit; go 1.25.0 github.com/conductorone/conductorone-sdk-go github.com/conductorone/conductorone-sdk-go/internal/config From 1a8526080bd76cdc9572007ff082fab379cbac0a Mon Sep 17 00:00:00 2001 From: Squire as Brandon High <759848+highb@users.noreply.github.com> Date: Sat, 5 Sep 2026 01:02:45 +0000 Subject: [PATCH 3/3] fix(secret): count query limit in Unicode code points; test production routing Address review feedback on PR #153: - The shared-with-me query limit now counts Unicode code points (utf8.RuneCountInString) matching the server's protoc-gen-validate max_len:256 semantics, not UTF-8 bytes. A 256-character multibyte query (512 bytes) passes; 257 characters fails. Regression tests cover the multibyte boundary both sides. - Routing tests now drive the production runSecretList core (extracted from secretListRun so the branch selection, include-own-without- shared-with-me rejection, and creator-path contract are the exact code the CLI executes) instead of a duplicated dispatch. New tests pin the include-own guard and the creator path's page-size-1000 / created-desc sort / sharing-mode-allowed contract. Co-authored-by: c1-squire-dev[bot] --- cmd/cone/secret.go | 18 ++++++- cmd/cone/secret_test.go | 106 ++++++++++++++++++++++++++++++---------- 2 files changed, 98 insertions(+), 26 deletions(-) diff --git a/cmd/cone/secret.go b/cmd/cone/secret.go index a5f67730..94e1f2b4 100644 --- a/cmd/cone/secret.go +++ b/cmd/cone/secret.go @@ -15,6 +15,7 @@ import ( "strconv" "strings" "time" + "unicode/utf8" "filippo.io/age" "github.com/spf13/cobra" @@ -640,6 +641,21 @@ func secretListRun(cmd *cobra.Command, args []string) error { return err } + return runSecretList(ctx, c, v, cmd) +} + +// secretLister is the subset of client.C1Client that secret listing needs, +// narrowed so the production routing logic can be exercised with a +// lightweight fake in tests (same pattern as secretCreator/secretSharer). +type secretLister interface { + secretSharer + SearchMySecrets(ctx context.Context, req *shared.PaperSecretServiceSearchMySecretsRequest) ([]shared.PaperSecret, error) +} + +// runSecretList is the production flag-routing core shared by the CLI and tests: +// it selects the shared-with-me or creator endpoint, enforces the cross-mode +// flag constraints, builds the request, and renders the result. +func runSecretList(ctx context.Context, c secretLister, v *viper.Viper, cmd *cobra.Command) error { if v.GetBool(sharedWithMeFlag) { return secretListSharedWithMeRun(ctx, c, v, cmd) } @@ -733,7 +749,7 @@ func buildSearchSecretsSharedWithMeRequest(v *viper.Viper, cmd *cobra.Command) ( PageSize: &pageSize, } if query := strings.TrimSpace(v.GetString(queryFlag)); query != "" { - if len(query) > 256 { + if utf8.RuneCountInString(query) > 256 { return nil, fmt.Errorf("--%s must be at most 256 characters with --%s", queryFlag, sharedWithMeFlag) } req.Query = &query diff --git a/cmd/cone/secret_test.go b/cmd/cone/secret_test.go index 57995630..8bec5850 100644 --- a/cmd/cone/secret_test.go +++ b/cmd/cone/secret_test.go @@ -603,9 +603,9 @@ func TestEncryptFileToTemp(t *testing.T) { } } -// sharedListHarness drives the shared-with-me list flag handling against a fake -// cobra/viper environment, without a live API: it verifies which request shape -// the flag logic builds and which client method it selects. +// sharedListHarness stands in for the authenticated C1Client in routing tests: +// it records which search method the production routing selected and with +// which request, without a live API. type sharedListHarness struct { mySecretsCalled bool sharedWithMeCalled bool @@ -625,6 +625,10 @@ func (h *sharedListHarness) SearchSecretsSharedWithMe(_ context.Context, req *sh return nil, nil } +// newSecretListCmdHarness builds the real secret list command but swaps the +// authenticated cmdContext step for the production runSecretList routing core +// driven by the harness, so the tests exercise the actual branch selection and +// cross-mode flag constraints the CLI uses. func newSecretListCmdHarness(t *testing.T, flags map[string]string, boolFlags ...string) (*sharedListHarness, *cobra.Command) { t.Helper() h := &sharedListHarness{} @@ -633,37 +637,28 @@ func newSecretListCmdHarness(t *testing.T, flags map[string]string, boolFlags .. ctx := cmd.Context() v := viper.New() for _, f := range boolFlags { - _ = cmd.Flags().Set(f, "true") - _ = v.BindPFlag(f, cmd.Flags().Lookup(f)) + if err := cmd.Flags().Set(f, "true"); err != nil { + t.Fatalf("Set(%s) unexpected error: %v", f, err) + } } for name, value := range flags { - _ = cmd.Flags().Set(name, value) - _ = v.BindPFlag(name, cmd.Flags().Lookup(name)) + if err := cmd.Flags().Set(name, value); err != nil { + t.Fatalf("Set(%s) unexpected error: %v", name, err) + } } - for _, name := range []string{queryFlag, secretStatusFlag, secretTypeFlag, secretSharingFlag, pageSizeFlag, sharedWithMeFlag, includeOwnFlag} { - if cmd.Flags().Lookup(name) != nil && v.Get(name) == nil { - _ = v.BindPFlag(name, cmd.Flags().Lookup(name)) + for _, name := range []string{queryFlag, secretStatusFlag, secretTypeFlag, secretSharingFlag, pageSizeFlag, sharedWithMeFlag, includeOwnFlag, "output"} { + if f := cmd.Flags().Lookup(name); f != nil { + if err := v.BindPFlag(name, f); err != nil { + t.Fatalf("BindPFlag(%s) unexpected error: %v", name, err) + } } } - return secretListRunForTest(ctx, h, v, cmd) + v.Set("output", "json") + return runSecretList(ctx, h, v, cmd) } return h, cmd } -// secretListRunForTest executes the same flag-routing core secretListRun uses, -// against the harness, without the authenticated cmdContext. -func secretListRunForTest(ctx context.Context, h *sharedListHarness, v *viper.Viper, cmd *cobra.Command) error { - if v.GetBool(sharedWithMeFlag) { - return secretListSharedWithMeRun(ctx, h, v, cmd) - } - req, err := buildSearchMySecretsRequest(v) - if err != nil { - return err - } - _, err = h.SearchMySecrets(ctx, req) - return err -} - func TestSecretListDefaultUsesCreatorEndpoint(t *testing.T) { h, cmd := newSecretListCmdHarness(t, map[string]string{queryFlag: "reports"}) if err := cmd.Execute(); err != nil { @@ -774,3 +769,64 @@ func TestSecretListSharedWithMeInvalidStatus(t *testing.T) { t.Fatal("invalid status must fail") } } + +func TestSecretListSharedWithMeQueryMultibyteBoundary(t *testing.T) { + // The server enforces max_len:256 on Unicode code points (protoc-gen-validate + // string max_len), not bytes. 256 é characters are 512 UTF-8 bytes and must + // pass; 257 must fail. + atLimit := strings.Repeat("é", 256) + h, cmd := newSecretListCmdHarness(t, map[string]string{queryFlag: atLimit}, sharedWithMeFlag) + if err := cmd.Execute(); err != nil { + t.Fatalf("256-codepoint multibyte query must pass (bytes=%d): %v", len(atLimit), err) + } + if h.lastSharedWithMeReq == nil || h.lastSharedWithMeReq.Query == nil || *h.lastSharedWithMeReq.Query != atLimit { + t.Fatal("at-limit multibyte query must reach the shared request unchanged") + } + + overLimit := strings.Repeat("é", 257) + _, cmd2 := newSecretListCmdHarness(t, map[string]string{queryFlag: overLimit}, sharedWithMeFlag) + if err := cmd2.Execute(); err == nil { + t.Fatal("257-codepoint multibyte query must fail") + } +} + +func TestSecretListIncludeOwnWithoutSharedWithMeRejected(t *testing.T) { + // Exercises the production routing constraint: --include-own is only + // meaningful with --shared-with-me and must be rejected otherwise. + h, cmd := newSecretListCmdHarness(t, nil, includeOwnFlag) + err := cmd.Execute() + if err == nil { + t.Fatal("--include-own without --shared-with-me must fail") + } + if !strings.Contains(err.Error(), "requires") { + t.Fatalf("error = %v, want include-own requires shared-with-me message", err) + } + if h.sharedWithMeCalled || h.mySecretsCalled { + t.Fatal("rejected flag combination must not reach either endpoint") + } +} + +func TestSecretListCreatorPathPreserved(t *testing.T) { + // The default creator path must keep its distinct contract: page size up to + // 1000, created-desc sort, sharing-mode filter allowed. + h, cmd := newSecretListCmdHarness(t, map[string]string{pageSizeFlag: "500", secretSharingFlag: "internal", secretStatusFlag: "all"}) + if err := cmd.Execute(); err != nil { + t.Fatalf("Execute() unexpected error: %v", err) + } + req := h.lastMySecretsReq + if req == nil { + t.Fatal("creator request was nil") + } + if req.PageSize == nil || *req.PageSize != 500 { + t.Fatalf("page size = %v, want 500 (creator path allows up to 1000)", req.PageSize) + } + if req.SortBy == nil || *req.SortBy != shared.PaperSecretServiceSearchMySecretsRequestSortBySearchSortByCreatedDesc { + t.Fatalf("sort by = %v, want created-desc preserved", req.SortBy) + } + if req.SharingMode == nil || *req.SharingMode != shared.PaperSecretServiceSearchMySecretsRequestSharingModePaperVaultSharingModeInternal { + t.Fatalf("sharing mode = %v, want internal (allowed on creator path)", req.SharingMode) + } + if req.Statuses != nil { + t.Fatalf("statuses = %v, want no filter for all", req.Statuses) + } +}