From e976adeebcba913cd3a6bf9efe61b9df41c34cf3 Mon Sep 17 00:00:00 2001 From: Adrian Tam Date: Tue, 27 Jun 2023 11:08:28 -0400 Subject: [PATCH 1/3] chore: adding unit test Part of https://github.com/openfga/cli/issues/7 --- .github/workflows/main.yaml | 3 + .golangci.yaml | 11 + Makefile | 11 + cmd/models/get.go | 66 +- cmd/models/get_test.go | 115 ++ cmd/models/list.go | 82 +- cmd/models/list_test.go | 240 +++ cmd/models/write.go | 54 +- cmd/models/write_test.go | 98 ++ go.mod | 3 +- go.sum | 3 + mocks/client.go | 2734 +++++++++++++++++++++++++++++++++++ 12 files changed, 3347 insertions(+), 73 deletions(-) create mode 100644 cmd/models/get_test.go create mode 100644 cmd/models/list_test.go create mode 100644 cmd/models/write_test.go create mode 100644 mocks/client.go diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e1faad2..e647b3b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -57,6 +57,9 @@ jobs: - name: Build run: make build + - name: Run unit test + run: make test + release: runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') diff --git a/.golangci.yaml b/.golangci.yaml index a8490f2..e3931e9 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -22,6 +22,7 @@ linters: - ifshort - golint - nosnakecase + - testpackage linters-settings: depguard: rules: @@ -40,10 +41,20 @@ linters-settings: - "$test" allow: - $gostd + - github.com/golang/mock/gomock - github.com/stretchr + - github.com/openfga/cli + - github.com/openfga/go-sdk tagliatelle: case: use-field-name: true rules: json: snake + + funlen: + lines: 120 + statements: 80 + + skip-dirs: + - mocks \ No newline at end of file diff --git a/Makefile b/Makefile index c347a31..a6401b4 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,17 @@ clean: go clean rm -f ${BINARY_NAME} +test: + go test -race \ + -coverpkg=./... \ + -coverprofile=coverageunit.tmp.out \ + -covermode=atomic \ + -count=1 \ + -timeout=5m \ + ./... + @cat coverageunit.tmp.out | grep -v "mocks" > coverageunit.out + @rm coverageunit.tmp.out + lint: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && golangci-lint run diff --git a/cmd/models/get.go b/cmd/models/get.go index 3eeb916..ca6da57 100644 --- a/cmd/models/get.go +++ b/cmd/models/get.go @@ -19,48 +19,68 @@ import ( "context" "encoding/json" "fmt" - "os" "github.com/openfga/cli/lib/cmd-utils" + "github.com/openfga/cli/lib/fga" openfga "github.com/openfga/go-sdk" "github.com/openfga/go-sdk/client" "github.com/spf13/cobra" ) +func getModel(clientConfig fga.ClientConfig, fgaClient client.SdkClient) (string, error) { + authorizationModelID := clientConfig.AuthorizationModelID + + var err error + + var model *openfga.ReadAuthorizationModelResponse + + if authorizationModelID != "" { + options := client.ClientReadAuthorizationModelOptions{ + AuthorizationModelId: openfga.PtrString(authorizationModelID), + } + model, err = fgaClient.ReadAuthorizationModel(context.Background()).Options(options).Execute() + } else { + options := client.ClientReadLatestAuthorizationModelOptions{} + model, err = fgaClient.ReadLatestAuthorizationModel(context.Background()).Options(options).Execute() + } + + if err != nil { + fmt.Printf("Failed to get model %v due to %v", clientConfig.AuthorizationModelID, err) + + return "", fmt.Errorf("failed to get model %v due to %w", clientConfig.AuthorizationModelID, err) + } + + modelJSON, err := json.Marshal(model) + if err != nil { + fmt.Printf("Failed to get model due to %v", err) + + return "", fmt.Errorf("failed to get model due to %w", err) + } + + return string(modelJSON), nil +} + // getCmd represents the get command. var getCmd = &cobra.Command{ Use: "get", Short: "Read a Single Authorization Model", - Run: func(cmd *cobra.Command, args []string) { + RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) + fgaClient, err := clientConfig.GetFgaClient() if err != nil { fmt.Printf("Failed to initialize FGA Client due to %v", err) - os.Exit(1) - } - authorizationModelID := clientConfig.AuthorizationModelID - - var model *openfga.ReadAuthorizationModelResponse - if authorizationModelID != "" { - options := client.ClientReadAuthorizationModelOptions{ - AuthorizationModelId: openfga.PtrString(authorizationModelID), - } - model, err = fgaClient.ReadAuthorizationModel(context.Background()).Options(options).Execute() - } else { - options := client.ClientReadLatestAuthorizationModelOptions{} - model, err = fgaClient.ReadLatestAuthorizationModel(context.Background()).Options(options).Execute() + + return fmt.Errorf("failed to initialize FGA Client due to %w", err) } + output, err := getModel(clientConfig, fgaClient) if err != nil { - fmt.Printf("Failed to get model %v due to %v", clientConfig.AuthorizationModelID, err) - os.Exit(1) + return err } - modelJSON, err := json.Marshal(model) - if err != nil { - fmt.Printf("Failed to get model due to %v", err) - os.Exit(1) - } - fmt.Print(string(modelJSON)) + fmt.Print(output) + + return nil }, } diff --git a/cmd/models/get_test.go b/cmd/models/get_test.go new file mode 100644 index 0000000..c4cf6b2 --- /dev/null +++ b/cmd/models/get_test.go @@ -0,0 +1,115 @@ +package models + +import ( + "context" + "encoding/json" + "errors" + "testing" + + "github.com/golang/mock/gomock" + "github.com/openfga/cli/lib/fga" + mock_client "github.com/openfga/cli/mocks" + openfga "github.com/openfga/go-sdk" + "github.com/openfga/go-sdk/client" +) + +var errMockGet = errors.New("mock error") + +// Test the case where get model is called without auth model ID is not specified. +func TestGetModelNoAuthModelID(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientReadLatestAuthorizationModelRequestInterface(mockCtrl) + + var expectedResponse client.ClientReadAuthorizationModelResponse + + modelJSON := `{"authorization_model":{"id":"01GXSA8YR785C4FYS3C0RTG7B1","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]}}` //nolint:all + if err := json.Unmarshal([]byte(modelJSON), &expectedResponse); err != nil { + t.Fatalf("%v", err) + } + + mockExecute.EXPECT().Execute().Return(&expectedResponse, nil) + + mockRequest := mock_client.NewMockSdkClientReadLatestAuthorizationModelRequestInterface(mockCtrl) + options := client.ClientReadLatestAuthorizationModelOptions{} + mockRequest.EXPECT().Options(options).Return(mockExecute) + mockFgaClient.EXPECT().ReadLatestAuthorizationModel(context.Background()).Return(mockRequest) + + var clientConfig fga.ClientConfig + + output, err := getModel(clientConfig, mockFgaClient) + if err != nil { + t.Fatalf("%v", err) + } else if output != modelJSON { + t.Fatalf("Expect output %v actual %v", modelJSON, output) + } +} + +// Test the case where get model is called without auth model ID is specified. +func TestGetModelAuthModelID(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientReadAuthorizationModelRequestInterface(mockCtrl) + + var expectedResponse client.ClientReadAuthorizationModelResponse + + modelJSON := `{"authorization_model":{"id":"01GXSA8YR785C4FYS3C0RTG7B1","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]}}` //nolint:all + if err := json.Unmarshal([]byte(modelJSON), &expectedResponse); err != nil { + t.Fatalf("%v", err) + } + + mockExecute.EXPECT().Execute().Return(&expectedResponse, nil) + + mockRequest := mock_client.NewMockSdkClientReadAuthorizationModelRequestInterface(mockCtrl) + options := client.ClientReadAuthorizationModelOptions{ + AuthorizationModelId: openfga.PtrString("01GXSA8YR785C4FYS3C0RTG7B1"), + } + mockRequest.EXPECT().Options(options).Return(mockExecute) + mockFgaClient.EXPECT().ReadAuthorizationModel(context.Background()).Return(mockRequest) + + clientConfig := fga.ClientConfig{ + AuthorizationModelID: "01GXSA8YR785C4FYS3C0RTG7B1", + } + + output, err := getModel(clientConfig, mockFgaClient) + if err != nil { + t.Fatalf("%v", err) + } else if output != modelJSON { + t.Fatalf("Expect output %v actual %v", modelJSON, output) + } +} + +// Test the case where get model is called, but it returns error. +func TestGetModelNoAuthModelIDError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientReadLatestAuthorizationModelRequestInterface(mockCtrl) + + var expectedResponse client.ClientReadAuthorizationModelResponse + + mockExecute.EXPECT().Execute().Return(&expectedResponse, errMockGet) + + mockRequest := mock_client.NewMockSdkClientReadLatestAuthorizationModelRequestInterface(mockCtrl) + options := client.ClientReadLatestAuthorizationModelOptions{} + mockRequest.EXPECT().Options(options).Return(mockExecute) + mockFgaClient.EXPECT().ReadLatestAuthorizationModel(context.Background()).Return(mockRequest) + + var clientConfig fga.ClientConfig + + _, err := getModel(clientConfig, mockFgaClient) + if err == nil { + t.Fatalf("Expect error but there is none") + } +} diff --git a/cmd/models/list.go b/cmd/models/list.go index 68fc59c..6274645 100644 --- a/cmd/models/list.go +++ b/cmd/models/list.go @@ -19,7 +19,6 @@ import ( "context" "encoding/json" "fmt" - "os" "github.com/openfga/cli/lib/cmd-utils" openfga "github.com/openfga/go-sdk" @@ -30,51 +29,72 @@ import ( // MaxModelsPagesLength Limit the models so that we are not paginating indefinitely. var MaxModelsPagesLength = 20 +func listModels(fgaClient client.SdkClient, maxPages int) (string, error) { + // This is needed to ensure empty array is marshaled as [] instead of nil + models := make([]openfga.AuthorizationModel, 0) + + var continuationToken *string + + pageIndex := 0 + + for { + options := client.ClientReadAuthorizationModelsOptions{ + ContinuationToken: continuationToken, + } + + response, err := fgaClient.ReadAuthorizationModels(context.Background()).Options(options).Execute() + if err != nil { + fmt.Printf("XXX Failed to list models due to %v", err) + + return "", fmt.Errorf("xxx failed to list models due to %w", err) + } + + models = append(models, *response.AuthorizationModels...) + + pageIndex++ + + continuationToken = response.ContinuationToken + + if continuationToken == nil || pageIndex > maxPages { + break + } + } + + modelsJSON, err := json.Marshal(openfga.ReadAuthorizationModelsResponse{AuthorizationModels: &models}) + if err != nil { + fmt.Printf("Failed to marshal listed models due to %v", err) + + return "", fmt.Errorf("failed to marshal listed models due to %w", err) + } + + return string(modelsJSON), nil +} + // listCmd represents the list command. var listCmd = &cobra.Command{ Use: "list", Short: "Read Authorization Models", - Run: func(cmd *cobra.Command, args []string) { + RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) fgaClient, err := clientConfig.GetFgaClient() if err != nil { fmt.Printf("Failed to initialize FGA Client due to %v", err) - os.Exit(1) + + return fmt.Errorf("failed to intialized FGA client due to %w", err) } maxPages, err := cmd.Flags().GetInt("max-pages") if err != nil { fmt.Printf("Failed to list models due to %v", err) - os.Exit(1) - } - models := []openfga.AuthorizationModel{} - var continuationToken *string - pageIndex := 0 - for { - options := client.ClientReadAuthorizationModelsOptions{ - ContinuationToken: continuationToken, - } - response, err := fgaClient.ReadAuthorizationModels(context.Background()).Options(options).Execute() - if err != nil { - fmt.Printf("Failed to list models due to %v", err) - os.Exit(1) - } - - models = append(models, *response.AuthorizationModels...) - - pageIndex++ - if continuationToken == nil || pageIndex > maxPages { - break - } - - continuationToken = response.ContinuationToken - } - modelsJSON, err := json.Marshal(openfga.ReadAuthorizationModelsResponse{AuthorizationModels: &models}) + return fmt.Errorf("failed to list models due to %w", err) + } + output, err := listModels(fgaClient, maxPages) if err != nil { - fmt.Printf("Failed to list models due to %v", err) - os.Exit(1) + return err } - fmt.Print(string(modelsJSON)) + fmt.Print(output) + + return nil }, } diff --git a/cmd/models/list_test.go b/cmd/models/list_test.go new file mode 100644 index 0000000..02af6d6 --- /dev/null +++ b/cmd/models/list_test.go @@ -0,0 +1,240 @@ +package models + +import ( + "context" + "encoding/json" + "errors" + "testing" + + "github.com/golang/mock/gomock" + mockclient "github.com/openfga/cli/mocks" + openfga "github.com/openfga/go-sdk" + "github.com/openfga/go-sdk/client" +) + +var errMockList = errors.New("mock error") + +const model1JSON = `{"id":"01GXSA8YR785C4FYS3C0RTG7B1","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]}` //nolint:all + +func TestListModelsEmpty(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mockclient.NewMockSdkClient(mockCtrl) + + mockExecute := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + + var models []openfga.AuthorizationModel + + response := openfga.ReadAuthorizationModelsResponse{ + AuthorizationModels: &models, + ContinuationToken: nil, + } + mockExecute.EXPECT().Execute().Return(&response, nil) + + mockRequest := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + options := client.ClientReadAuthorizationModelsOptions{ + ContinuationToken: nil, + } + mockRequest.EXPECT().Options(options).Return(mockExecute) + mockFgaClient.EXPECT().ReadAuthorizationModels(context.Background()).Return(mockRequest) + + output, err := listModels(mockFgaClient, 5) + if err != nil { + t.Error(err) + } + + expectedOutput := "{\"authorization_models\":[]}" + if output != expectedOutput { + t.Errorf("Expected output %v actual %v", expectedOutput, output) + } +} + +func TestListModelsFail(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mockclient.NewMockSdkClient(mockCtrl) + + mockExecute := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + + mockExecute.EXPECT().Execute().Return(nil, errMockList) + + mockRequest := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + options := client.ClientReadAuthorizationModelsOptions{ + ContinuationToken: nil, + } + mockRequest.EXPECT().Options(options).Return(mockExecute) + mockFgaClient.EXPECT().ReadAuthorizationModels(context.Background()).Return(mockRequest) + + _, err := listModels(mockFgaClient, 5) + if err == nil { + t.Error("Expect error but there is none") + } +} + +func TestListModelsSinglePage(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mockclient.NewMockSdkClient(mockCtrl) + + mockExecute := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + + var model1 openfga.AuthorizationModel + + if err := json.Unmarshal([]byte(model1JSON), &model1); err != nil { + t.Fatalf("%v", err) + } + + models := []openfga.AuthorizationModel{ + model1, + } + + response := openfga.ReadAuthorizationModelsResponse{ + AuthorizationModels: &models, + ContinuationToken: nil, + } + mockExecute.EXPECT().Execute().Return(&response, nil) + + mockRequest := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + options := client.ClientReadAuthorizationModelsOptions{ + ContinuationToken: nil, + } + mockRequest.EXPECT().Options(options).Return(mockExecute) + mockFgaClient.EXPECT().ReadAuthorizationModels(context.Background()).Return(mockRequest) + + output, err := listModels(mockFgaClient, 5) + if err != nil { + t.Error(err) + } + expectedOutput := `{"authorization_models":[{"id":"01GXSA8YR785C4FYS3C0RTG7B1","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]}]}` //nolint:all + + if output != expectedOutput { + t.Errorf("Expected output %v actual %v", expectedOutput, output) + } +} + +func TestListModelsMultiPage(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mockclient.NewMockSdkClient(mockCtrl) + + mockExecute1 := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + + var model1 openfga.AuthorizationModel + + if err := json.Unmarshal([]byte(model1JSON), &model1); err != nil { + t.Fatalf("%v", err) + } + + models1 := []openfga.AuthorizationModel{ + model1, + } + continuationToken1 := openfga.PtrString("abcdef") + response1 := openfga.ReadAuthorizationModelsResponse{ + AuthorizationModels: &models1, + ContinuationToken: continuationToken1, + } + + mockRequest1 := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + options1 := client.ClientReadAuthorizationModelsOptions{ + ContinuationToken: nil, + } + + mockExecute2 := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + + var model2 openfga.AuthorizationModel + + model2JSON := `{"id":"01GXSA8YR785C4FYS3C0RTG7B2","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]}` //nolint:all + if err := json.Unmarshal([]byte(model2JSON), &model2); err != nil { + t.Fatalf("%v", err) + } + + models2 := []openfga.AuthorizationModel{ + model2, + } + response2 := openfga.ReadAuthorizationModelsResponse{ + AuthorizationModels: &models2, + ContinuationToken: nil, + } + + gomock.InOrder( + mockExecute1.EXPECT().Execute().Return(&response1, nil), + mockExecute2.EXPECT().Execute().Return(&response2, nil), + ) + + mockRequest2 := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + options2 := client.ClientReadAuthorizationModelsOptions{ + ContinuationToken: continuationToken1, + } + gomock.InOrder( + mockRequest1.EXPECT().Options(options1).Return(mockExecute1), + mockRequest2.EXPECT().Options(options2).Return(mockExecute2), + ) + gomock.InOrder( + mockFgaClient.EXPECT().ReadAuthorizationModels(context.Background()).Return(mockRequest1), + mockFgaClient.EXPECT().ReadAuthorizationModels(context.Background()).Return(mockRequest2), + ) + + output, err := listModels(mockFgaClient, 2) + if err != nil { + t.Error(err) + } + expectedOutput := `{"authorization_models":[{"id":"01GXSA8YR785C4FYS3C0RTG7B1","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]},{"id":"01GXSA8YR785C4FYS3C0RTG7B2","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]}]}` //nolint:all + + if output != expectedOutput { + t.Errorf("Expected output %v actual %v", expectedOutput, output) + } +} + +// Data has multi page but we are exceeding the maximum allowable page. +func TestListModelsMultiPageMaxPage(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mockclient.NewMockSdkClient(mockCtrl) + + mockExecute1 := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + + var model1 openfga.AuthorizationModel + + if err := json.Unmarshal([]byte(model1JSON), &model1); err != nil { + t.Fatalf("%v", err) + } + + models1 := []openfga.AuthorizationModel{ + model1, + } + continuationToken1 := openfga.PtrString("abcdef") + response1 := openfga.ReadAuthorizationModelsResponse{ + AuthorizationModels: &models1, + ContinuationToken: continuationToken1, + } + + mockRequest1 := mockclient.NewMockSdkClientReadAuthorizationModelsRequestInterface(mockCtrl) + options1 := client.ClientReadAuthorizationModelsOptions{ + ContinuationToken: nil, + } + + mockExecute1.EXPECT().Execute().Return(&response1, nil) + + mockRequest1.EXPECT().Options(options1).Return(mockExecute1) + mockFgaClient.EXPECT().ReadAuthorizationModels(context.Background()).Return(mockRequest1) + + output, err := listModels(mockFgaClient, 0) + if err != nil { + t.Error(err) + } + expectedOutput := `{"authorization_models":[{"id":"01GXSA8YR785C4FYS3C0RTG7B1","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]}]}` //nolint:all + + if output != expectedOutput { + t.Errorf("Expected output %v actual %v", expectedOutput, output) + } +} diff --git a/cmd/models/write.go b/cmd/models/write.go index 5a2069a..0c74b30 100644 --- a/cmd/models/write.go +++ b/cmd/models/write.go @@ -19,43 +19,61 @@ import ( "context" "encoding/json" "fmt" - "os" "github.com/openfga/cli/lib/cmd-utils" "github.com/openfga/go-sdk/client" "github.com/spf13/cobra" ) +func write(fgaClient client.SdkClient, text string) (string, error) { + body := &client.ClientWriteAuthorizationModelRequest{} + + err := json.Unmarshal([]byte(text), &body) + if err != nil { + fmt.Printf("Failed to parse model due to %v", err) + + return "", fmt.Errorf("failed to parse model due to %w", err) + } + + model, err := fgaClient.WriteAuthorizationModel(context.Background()).Body(*body).Execute() + if err != nil { + fmt.Printf("Failed to write model due to %v", err) + + return "", fmt.Errorf("failed to write model due to %w", err) + } + + modelJSON, err := json.Marshal(model) + if err != nil { + fmt.Printf("Failed to write model due to %v", err) + + return "", fmt.Errorf("failed to write model due to %w", err) + } + + return string(modelJSON), nil +} + // writeCmd represents the write command. var writeCmd = &cobra.Command{ Use: "write", Short: "Write Authorization Model", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) + fgaClient, err := clientConfig.GetFgaClient() if err != nil { fmt.Printf("Failed to initialize FGA Client due to %v", err) - os.Exit(1) - } - body := &client.ClientWriteAuthorizationModelRequest{} - err = json.Unmarshal([]byte(args[0]), &body) - if err != nil { - fmt.Printf("Failed to parse model due to %v", err) - os.Exit(1) - } - model, err := fgaClient.WriteAuthorizationModel(context.Background()).Body(*body).Execute() - if err != nil { - fmt.Printf("Failed to write model due to %v", err) - os.Exit(1) + + return fmt.Errorf("failed to initialize FGA Client due to %w", err) } - modelJSON, err := json.Marshal(model) + output, err := write(fgaClient, args[0]) if err != nil { - fmt.Printf("Failed to write model due to %v", err) - os.Exit(1) + return err } - fmt.Print(string(modelJSON)) + fmt.Print(output) + + return nil }, } diff --git a/cmd/models/write_test.go b/cmd/models/write_test.go new file mode 100644 index 0000000..a6f366e --- /dev/null +++ b/cmd/models/write_test.go @@ -0,0 +1,98 @@ +package models + +import ( + "context" + "encoding/json" + "errors" + "testing" + + "github.com/golang/mock/gomock" + mockclient "github.com/openfga/cli/mocks" + openfga "github.com/openfga/go-sdk" + "github.com/openfga/go-sdk/client" +) + +var errMockWrite = errors.New("mock error") + +func TestWriteInvalidModel(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mockclient.NewMockSdkClient(mockCtrl) + modelString := "{bad_json" + + _, err := write(mockFgaClient, modelString) + if err == nil { + t.Fatalf("Expect error but there is none") + } +} + +func TestWriteModelFail(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mockclient.NewMockSdkClient(mockCtrl) + + modelJSONTxt := `{"schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]}` //nolint:lll + body := &client.ClientWriteAuthorizationModelRequest{} + + err := json.Unmarshal([]byte(modelJSONTxt), &body) + if err != nil { + t.Fatal(err) + } + + mockExecute := mockclient.NewMockSdkClientWriteAuthorizationModelRequestInterface(mockCtrl) + mockExecute.EXPECT().Execute().Return(nil, errMockWrite) + + mockRequest := mockclient.NewMockSdkClientWriteAuthorizationModelRequestInterface(mockCtrl) + mockRequest.EXPECT().Body(*body).Return(mockExecute) + + mockFgaClient.EXPECT().WriteAuthorizationModel(context.Background()).Return(mockRequest) + + _, err = write(mockFgaClient, modelJSONTxt) + if err == nil { + t.Fatalf("Expect error but there is none") + } +} + +func TestWriteModel(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mockclient.NewMockSdkClient(mockCtrl) + + modelJSONTxt := `{"schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"github-repo"}]}` //nolint:lll + + body := &client.ClientWriteAuthorizationModelRequest{} + + err := json.Unmarshal([]byte(modelJSONTxt), &body) + if err != nil { + t.Fatal(err) + } + + mockExecute := mockclient.NewMockSdkClientWriteAuthorizationModelRequestInterface(mockCtrl) + + const modelID = "01GXSB8YR785C4FYS3C0RTG7C2" + response := client.ClientWriteAuthorizationModelResponse{ + AuthorizationModelId: openfga.PtrString(modelID), + } + mockExecute.EXPECT().Execute().Return(&response, nil) + + mockRequest := mockclient.NewMockSdkClientWriteAuthorizationModelRequestInterface(mockCtrl) + mockRequest.EXPECT().Body(*body).Return(mockExecute) + + mockFgaClient.EXPECT().WriteAuthorizationModel(context.Background()).Return(mockRequest) + + output, err := write(mockFgaClient, modelJSONTxt) + if err != nil { + t.Fatal(err) + } + + expectedOutput := "{\"authorization_model_id\":\"" + modelID + "\"}" + if output != expectedOutput { + t.Fatalf("Expected output %v actual %v", expectedOutput, output) + } +} diff --git a/go.mod b/go.mod index 88d0204..a9ae0f8 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,8 @@ module github.com/openfga/cli go 1.20 require ( - github.com/openfga/go-sdk v0.2.3-0.20230613190254-a6fb3f6bbb9f + github.com/golang/mock v1.4.4 + github.com/openfga/go-sdk v0.2.3-0.20230628172854-99f80f68e981 github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.16.0 ) diff --git a/go.sum b/go.sum index b1ffabd..57b0696 100644 --- a/go.sum +++ b/go.sum @@ -72,6 +72,7 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -141,6 +142,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/openfga/go-sdk v0.2.3-0.20230613190254-a6fb3f6bbb9f h1:6sjnL+LlKyvx8h/6/MsCz3M+d5sQZZMp6BIWsTe1JAo= github.com/openfga/go-sdk v0.2.3-0.20230613190254-a6fb3f6bbb9f/go.mod h1:ZB13O8GilPc0ITWssOszgxmz6CnIe8PQLZqbqAnx2IY= +github.com/openfga/go-sdk v0.2.3-0.20230628172854-99f80f68e981 h1:O4pso4WIqOlk7Onngw69mbu0smerYFVsW6hkyShNDmk= +github.com/openfga/go-sdk v0.2.3-0.20230628172854-99f80f68e981/go.mod h1:ZB13O8GilPc0ITWssOszgxmz6CnIe8PQLZqbqAnx2IY= github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/mocks/client.go b/mocks/client.go new file mode 100644 index 0000000..208ab9a --- /dev/null +++ b/mocks/client.go @@ -0,0 +1,2734 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: client/client.go + +// Package mock_client is a generated GoMock package. +package mock_client + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + client "github.com/openfga/go-sdk/client" +) + +// MockSdkClient is a mock of SdkClient interface. +type MockSdkClient struct { + ctrl *gomock.Controller + recorder *MockSdkClientMockRecorder +} + +// MockSdkClientMockRecorder is the mock recorder for MockSdkClient. +type MockSdkClientMockRecorder struct { + mock *MockSdkClient +} + +// NewMockSdkClient creates a new mock instance. +func NewMockSdkClient(ctrl *gomock.Controller) *MockSdkClient { + mock := &MockSdkClient{ctrl: ctrl} + mock.recorder = &MockSdkClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClient) EXPECT() *MockSdkClientMockRecorder { + return m.recorder +} + +// BatchCheck mocks base method. +func (m *MockSdkClient) BatchCheck(ctx context.Context) client.SdkClientBatchCheckRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BatchCheck", ctx) + ret0, _ := ret[0].(client.SdkClientBatchCheckRequestInterface) + return ret0 +} + +// BatchCheck indicates an expected call of BatchCheck. +func (mr *MockSdkClientMockRecorder) BatchCheck(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchCheck", reflect.TypeOf((*MockSdkClient)(nil).BatchCheck), ctx) +} + +// BatchCheckExecute mocks base method. +func (m *MockSdkClient) BatchCheckExecute(request client.SdkClientBatchCheckRequestInterface) (*client.ClientBatchCheckResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BatchCheckExecute", request) + ret0, _ := ret[0].(*client.ClientBatchCheckResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BatchCheckExecute indicates an expected call of BatchCheckExecute. +func (mr *MockSdkClientMockRecorder) BatchCheckExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchCheckExecute", reflect.TypeOf((*MockSdkClient)(nil).BatchCheckExecute), request) +} + +// Check mocks base method. +func (m *MockSdkClient) Check(ctx context.Context) client.SdkClientCheckRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Check", ctx) + ret0, _ := ret[0].(client.SdkClientCheckRequestInterface) + return ret0 +} + +// Check indicates an expected call of Check. +func (mr *MockSdkClientMockRecorder) Check(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Check", reflect.TypeOf((*MockSdkClient)(nil).Check), ctx) +} + +// CheckExecute mocks base method. +func (m *MockSdkClient) CheckExecute(request client.SdkClientCheckRequestInterface) (*client.ClientCheckResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CheckExecute", request) + ret0, _ := ret[0].(*client.ClientCheckResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CheckExecute indicates an expected call of CheckExecute. +func (mr *MockSdkClientMockRecorder) CheckExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckExecute", reflect.TypeOf((*MockSdkClient)(nil).CheckExecute), request) +} + +// CreateStore mocks base method. +func (m *MockSdkClient) CreateStore(ctx context.Context) client.SdkClientCreateStoreRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateStore", ctx) + ret0, _ := ret[0].(client.SdkClientCreateStoreRequestInterface) + return ret0 +} + +// CreateStore indicates an expected call of CreateStore. +func (mr *MockSdkClientMockRecorder) CreateStore(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateStore", reflect.TypeOf((*MockSdkClient)(nil).CreateStore), ctx) +} + +// CreateStoreExecute mocks base method. +func (m *MockSdkClient) CreateStoreExecute(request client.SdkClientCreateStoreRequestInterface) (*client.ClientCreateStoreResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateStoreExecute", request) + ret0, _ := ret[0].(*client.ClientCreateStoreResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateStoreExecute indicates an expected call of CreateStoreExecute. +func (mr *MockSdkClientMockRecorder) CreateStoreExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateStoreExecute", reflect.TypeOf((*MockSdkClient)(nil).CreateStoreExecute), request) +} + +// DeleteStore mocks base method. +func (m *MockSdkClient) DeleteStore(ctx context.Context) client.SdkClientDeleteStoreRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteStore", ctx) + ret0, _ := ret[0].(client.SdkClientDeleteStoreRequestInterface) + return ret0 +} + +// DeleteStore indicates an expected call of DeleteStore. +func (mr *MockSdkClientMockRecorder) DeleteStore(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteStore", reflect.TypeOf((*MockSdkClient)(nil).DeleteStore), ctx) +} + +// DeleteStoreExecute mocks base method. +func (m *MockSdkClient) DeleteStoreExecute(request client.SdkClientDeleteStoreRequestInterface) (*client.ClientDeleteStoreResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteStoreExecute", request) + ret0, _ := ret[0].(*client.ClientDeleteStoreResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteStoreExecute indicates an expected call of DeleteStoreExecute. +func (mr *MockSdkClientMockRecorder) DeleteStoreExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteStoreExecute", reflect.TypeOf((*MockSdkClient)(nil).DeleteStoreExecute), request) +} + +// DeleteTuples mocks base method. +func (m *MockSdkClient) DeleteTuples(ctx context.Context) client.SdkClientDeleteTuplesRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteTuples", ctx) + ret0, _ := ret[0].(client.SdkClientDeleteTuplesRequestInterface) + return ret0 +} + +// DeleteTuples indicates an expected call of DeleteTuples. +func (mr *MockSdkClientMockRecorder) DeleteTuples(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTuples", reflect.TypeOf((*MockSdkClient)(nil).DeleteTuples), ctx) +} + +// DeleteTuplesExecute mocks base method. +func (m *MockSdkClient) DeleteTuplesExecute(request client.SdkClientDeleteTuplesRequestInterface) (*client.ClientWriteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteTuplesExecute", request) + ret0, _ := ret[0].(*client.ClientWriteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteTuplesExecute indicates an expected call of DeleteTuplesExecute. +func (mr *MockSdkClientMockRecorder) DeleteTuplesExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTuplesExecute", reflect.TypeOf((*MockSdkClient)(nil).DeleteTuplesExecute), request) +} + +// Expand mocks base method. +func (m *MockSdkClient) Expand(ctx context.Context) client.SdkClientExpandRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Expand", ctx) + ret0, _ := ret[0].(client.SdkClientExpandRequestInterface) + return ret0 +} + +// Expand indicates an expected call of Expand. +func (mr *MockSdkClientMockRecorder) Expand(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Expand", reflect.TypeOf((*MockSdkClient)(nil).Expand), ctx) +} + +// ExpandExecute mocks base method. +func (m *MockSdkClient) ExpandExecute(request client.SdkClientExpandRequestInterface) (*client.ClientExpandResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExpandExecute", request) + ret0, _ := ret[0].(*client.ClientExpandResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExpandExecute indicates an expected call of ExpandExecute. +func (mr *MockSdkClientMockRecorder) ExpandExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExpandExecute", reflect.TypeOf((*MockSdkClient)(nil).ExpandExecute), request) +} + +// GetStore mocks base method. +func (m *MockSdkClient) GetStore(ctx context.Context) client.SdkClientGetStoreRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetStore", ctx) + ret0, _ := ret[0].(client.SdkClientGetStoreRequestInterface) + return ret0 +} + +// GetStore indicates an expected call of GetStore. +func (mr *MockSdkClientMockRecorder) GetStore(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStore", reflect.TypeOf((*MockSdkClient)(nil).GetStore), ctx) +} + +// GetStoreExecute mocks base method. +func (m *MockSdkClient) GetStoreExecute(request client.SdkClientGetStoreRequestInterface) (*client.ClientGetStoreResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetStoreExecute", request) + ret0, _ := ret[0].(*client.ClientGetStoreResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetStoreExecute indicates an expected call of GetStoreExecute. +func (mr *MockSdkClientMockRecorder) GetStoreExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStoreExecute", reflect.TypeOf((*MockSdkClient)(nil).GetStoreExecute), request) +} + +// ListObjects mocks base method. +func (m *MockSdkClient) ListObjects(ctx context.Context) client.SdkClientListObjectsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListObjects", ctx) + ret0, _ := ret[0].(client.SdkClientListObjectsRequestInterface) + return ret0 +} + +// ListObjects indicates an expected call of ListObjects. +func (mr *MockSdkClientMockRecorder) ListObjects(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListObjects", reflect.TypeOf((*MockSdkClient)(nil).ListObjects), ctx) +} + +// ListObjectsExecute mocks base method. +func (m *MockSdkClient) ListObjectsExecute(request client.SdkClientListObjectsRequestInterface) (*client.ClientListObjectsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListObjectsExecute", request) + ret0, _ := ret[0].(*client.ClientListObjectsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListObjectsExecute indicates an expected call of ListObjectsExecute. +func (mr *MockSdkClientMockRecorder) ListObjectsExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListObjectsExecute", reflect.TypeOf((*MockSdkClient)(nil).ListObjectsExecute), request) +} + +// ListRelations mocks base method. +func (m *MockSdkClient) ListRelations(ctx context.Context) client.SdkClientListRelationsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListRelations", ctx) + ret0, _ := ret[0].(client.SdkClientListRelationsRequestInterface) + return ret0 +} + +// ListRelations indicates an expected call of ListRelations. +func (mr *MockSdkClientMockRecorder) ListRelations(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRelations", reflect.TypeOf((*MockSdkClient)(nil).ListRelations), ctx) +} + +// ListRelationsExecute mocks base method. +func (m *MockSdkClient) ListRelationsExecute(request client.SdkClientListRelationsRequestInterface) (*client.ClientListRelationsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListRelationsExecute", request) + ret0, _ := ret[0].(*client.ClientListRelationsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListRelationsExecute indicates an expected call of ListRelationsExecute. +func (mr *MockSdkClientMockRecorder) ListRelationsExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRelationsExecute", reflect.TypeOf((*MockSdkClient)(nil).ListRelationsExecute), request) +} + +// ListStores mocks base method. +func (m *MockSdkClient) ListStores(ctx context.Context) client.SdkClientListStoresRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListStores", ctx) + ret0, _ := ret[0].(client.SdkClientListStoresRequestInterface) + return ret0 +} + +// ListStores indicates an expected call of ListStores. +func (mr *MockSdkClientMockRecorder) ListStores(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListStores", reflect.TypeOf((*MockSdkClient)(nil).ListStores), ctx) +} + +// ListStoresExecute mocks base method. +func (m *MockSdkClient) ListStoresExecute(request client.SdkClientListStoresRequestInterface) (*client.ClientListStoresResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListStoresExecute", request) + ret0, _ := ret[0].(*client.ClientListStoresResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListStoresExecute indicates an expected call of ListStoresExecute. +func (mr *MockSdkClientMockRecorder) ListStoresExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListStoresExecute", reflect.TypeOf((*MockSdkClient)(nil).ListStoresExecute), request) +} + +// Read mocks base method. +func (m *MockSdkClient) Read(ctx context.Context) client.SdkClientReadRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Read", ctx) + ret0, _ := ret[0].(client.SdkClientReadRequestInterface) + return ret0 +} + +// Read indicates an expected call of Read. +func (mr *MockSdkClientMockRecorder) Read(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockSdkClient)(nil).Read), ctx) +} + +// ReadAssertions mocks base method. +func (m *MockSdkClient) ReadAssertions(ctx context.Context) client.SdkClientReadAssertionsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadAssertions", ctx) + ret0, _ := ret[0].(client.SdkClientReadAssertionsRequestInterface) + return ret0 +} + +// ReadAssertions indicates an expected call of ReadAssertions. +func (mr *MockSdkClientMockRecorder) ReadAssertions(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadAssertions", reflect.TypeOf((*MockSdkClient)(nil).ReadAssertions), ctx) +} + +// ReadAssertionsExecute mocks base method. +func (m *MockSdkClient) ReadAssertionsExecute(request client.SdkClientReadAssertionsRequestInterface) (*client.ClientReadAssertionsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadAssertionsExecute", request) + ret0, _ := ret[0].(*client.ClientReadAssertionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReadAssertionsExecute indicates an expected call of ReadAssertionsExecute. +func (mr *MockSdkClientMockRecorder) ReadAssertionsExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadAssertionsExecute", reflect.TypeOf((*MockSdkClient)(nil).ReadAssertionsExecute), request) +} + +// ReadAuthorizationModel mocks base method. +func (m *MockSdkClient) ReadAuthorizationModel(ctx context.Context) client.SdkClientReadAuthorizationModelRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadAuthorizationModel", ctx) + ret0, _ := ret[0].(client.SdkClientReadAuthorizationModelRequestInterface) + return ret0 +} + +// ReadAuthorizationModel indicates an expected call of ReadAuthorizationModel. +func (mr *MockSdkClientMockRecorder) ReadAuthorizationModel(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadAuthorizationModel", reflect.TypeOf((*MockSdkClient)(nil).ReadAuthorizationModel), ctx) +} + +// ReadAuthorizationModelExecute mocks base method. +func (m *MockSdkClient) ReadAuthorizationModelExecute(request client.SdkClientReadAuthorizationModelRequestInterface) (*client.ClientReadAuthorizationModelResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadAuthorizationModelExecute", request) + ret0, _ := ret[0].(*client.ClientReadAuthorizationModelResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReadAuthorizationModelExecute indicates an expected call of ReadAuthorizationModelExecute. +func (mr *MockSdkClientMockRecorder) ReadAuthorizationModelExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadAuthorizationModelExecute", reflect.TypeOf((*MockSdkClient)(nil).ReadAuthorizationModelExecute), request) +} + +// ReadAuthorizationModels mocks base method. +func (m *MockSdkClient) ReadAuthorizationModels(ctx context.Context) client.SdkClientReadAuthorizationModelsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadAuthorizationModels", ctx) + ret0, _ := ret[0].(client.SdkClientReadAuthorizationModelsRequestInterface) + return ret0 +} + +// ReadAuthorizationModels indicates an expected call of ReadAuthorizationModels. +func (mr *MockSdkClientMockRecorder) ReadAuthorizationModels(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadAuthorizationModels", reflect.TypeOf((*MockSdkClient)(nil).ReadAuthorizationModels), ctx) +} + +// ReadAuthorizationModelsExecute mocks base method. +func (m *MockSdkClient) ReadAuthorizationModelsExecute(request client.SdkClientReadAuthorizationModelsRequestInterface) (*client.ClientReadAuthorizationModelsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadAuthorizationModelsExecute", request) + ret0, _ := ret[0].(*client.ClientReadAuthorizationModelsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReadAuthorizationModelsExecute indicates an expected call of ReadAuthorizationModelsExecute. +func (mr *MockSdkClientMockRecorder) ReadAuthorizationModelsExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadAuthorizationModelsExecute", reflect.TypeOf((*MockSdkClient)(nil).ReadAuthorizationModelsExecute), request) +} + +// ReadChanges mocks base method. +func (m *MockSdkClient) ReadChanges(ctx context.Context) client.SdkClientReadChangesRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadChanges", ctx) + ret0, _ := ret[0].(client.SdkClientReadChangesRequestInterface) + return ret0 +} + +// ReadChanges indicates an expected call of ReadChanges. +func (mr *MockSdkClientMockRecorder) ReadChanges(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadChanges", reflect.TypeOf((*MockSdkClient)(nil).ReadChanges), ctx) +} + +// ReadChangesExecute mocks base method. +func (m *MockSdkClient) ReadChangesExecute(request client.SdkClientReadChangesRequestInterface) (*client.ClientReadChangesResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadChangesExecute", request) + ret0, _ := ret[0].(*client.ClientReadChangesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReadChangesExecute indicates an expected call of ReadChangesExecute. +func (mr *MockSdkClientMockRecorder) ReadChangesExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadChangesExecute", reflect.TypeOf((*MockSdkClient)(nil).ReadChangesExecute), request) +} + +// ReadExecute mocks base method. +func (m *MockSdkClient) ReadExecute(request client.SdkClientReadRequestInterface) (*client.ClientReadResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadExecute", request) + ret0, _ := ret[0].(*client.ClientReadResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReadExecute indicates an expected call of ReadExecute. +func (mr *MockSdkClientMockRecorder) ReadExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadExecute", reflect.TypeOf((*MockSdkClient)(nil).ReadExecute), request) +} + +// ReadLatestAuthorizationModel mocks base method. +func (m *MockSdkClient) ReadLatestAuthorizationModel(ctx context.Context) client.SdkClientReadLatestAuthorizationModelRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadLatestAuthorizationModel", ctx) + ret0, _ := ret[0].(client.SdkClientReadLatestAuthorizationModelRequestInterface) + return ret0 +} + +// ReadLatestAuthorizationModel indicates an expected call of ReadLatestAuthorizationModel. +func (mr *MockSdkClientMockRecorder) ReadLatestAuthorizationModel(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadLatestAuthorizationModel", reflect.TypeOf((*MockSdkClient)(nil).ReadLatestAuthorizationModel), ctx) +} + +// ReadLatestAuthorizationModelExecute mocks base method. +func (m *MockSdkClient) ReadLatestAuthorizationModelExecute(request client.SdkClientReadLatestAuthorizationModelRequestInterface) (*client.ClientReadAuthorizationModelResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadLatestAuthorizationModelExecute", request) + ret0, _ := ret[0].(*client.ClientReadAuthorizationModelResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReadLatestAuthorizationModelExecute indicates an expected call of ReadLatestAuthorizationModelExecute. +func (mr *MockSdkClientMockRecorder) ReadLatestAuthorizationModelExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadLatestAuthorizationModelExecute", reflect.TypeOf((*MockSdkClient)(nil).ReadLatestAuthorizationModelExecute), request) +} + +// Write mocks base method. +func (m *MockSdkClient) Write(ctx context.Context) client.SdkClientWriteRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Write", ctx) + ret0, _ := ret[0].(client.SdkClientWriteRequestInterface) + return ret0 +} + +// Write indicates an expected call of Write. +func (mr *MockSdkClientMockRecorder) Write(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockSdkClient)(nil).Write), ctx) +} + +// WriteAssertions mocks base method. +func (m *MockSdkClient) WriteAssertions(ctx context.Context) client.SdkClientWriteAssertionsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteAssertions", ctx) + ret0, _ := ret[0].(client.SdkClientWriteAssertionsRequestInterface) + return ret0 +} + +// WriteAssertions indicates an expected call of WriteAssertions. +func (mr *MockSdkClientMockRecorder) WriteAssertions(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteAssertions", reflect.TypeOf((*MockSdkClient)(nil).WriteAssertions), ctx) +} + +// WriteAssertionsExecute mocks base method. +func (m *MockSdkClient) WriteAssertionsExecute(request client.SdkClientWriteAssertionsRequestInterface) (*client.ClientWriteAssertionsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteAssertionsExecute", request) + ret0, _ := ret[0].(*client.ClientWriteAssertionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// WriteAssertionsExecute indicates an expected call of WriteAssertionsExecute. +func (mr *MockSdkClientMockRecorder) WriteAssertionsExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteAssertionsExecute", reflect.TypeOf((*MockSdkClient)(nil).WriteAssertionsExecute), request) +} + +// WriteAuthorizationModel mocks base method. +func (m *MockSdkClient) WriteAuthorizationModel(ctx context.Context) client.SdkClientWriteAuthorizationModelRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteAuthorizationModel", ctx) + ret0, _ := ret[0].(client.SdkClientWriteAuthorizationModelRequestInterface) + return ret0 +} + +// WriteAuthorizationModel indicates an expected call of WriteAuthorizationModel. +func (mr *MockSdkClientMockRecorder) WriteAuthorizationModel(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteAuthorizationModel", reflect.TypeOf((*MockSdkClient)(nil).WriteAuthorizationModel), ctx) +} + +// WriteAuthorizationModelExecute mocks base method. +func (m *MockSdkClient) WriteAuthorizationModelExecute(request client.SdkClientWriteAuthorizationModelRequestInterface) (*client.ClientWriteAuthorizationModelResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteAuthorizationModelExecute", request) + ret0, _ := ret[0].(*client.ClientWriteAuthorizationModelResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// WriteAuthorizationModelExecute indicates an expected call of WriteAuthorizationModelExecute. +func (mr *MockSdkClientMockRecorder) WriteAuthorizationModelExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteAuthorizationModelExecute", reflect.TypeOf((*MockSdkClient)(nil).WriteAuthorizationModelExecute), request) +} + +// WriteExecute mocks base method. +func (m *MockSdkClient) WriteExecute(request client.SdkClientWriteRequestInterface) (*client.ClientWriteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteExecute", request) + ret0, _ := ret[0].(*client.ClientWriteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// WriteExecute indicates an expected call of WriteExecute. +func (mr *MockSdkClientMockRecorder) WriteExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteExecute", reflect.TypeOf((*MockSdkClient)(nil).WriteExecute), request) +} + +// WriteTuples mocks base method. +func (m *MockSdkClient) WriteTuples(ctx context.Context) client.SdkClientWriteTuplesRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteTuples", ctx) + ret0, _ := ret[0].(client.SdkClientWriteTuplesRequestInterface) + return ret0 +} + +// WriteTuples indicates an expected call of WriteTuples. +func (mr *MockSdkClientMockRecorder) WriteTuples(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteTuples", reflect.TypeOf((*MockSdkClient)(nil).WriteTuples), ctx) +} + +// WriteTuplesExecute mocks base method. +func (m *MockSdkClient) WriteTuplesExecute(request client.SdkClientWriteTuplesRequestInterface) (*client.ClientWriteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteTuplesExecute", request) + ret0, _ := ret[0].(*client.ClientWriteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// WriteTuplesExecute indicates an expected call of WriteTuplesExecute. +func (mr *MockSdkClientMockRecorder) WriteTuplesExecute(request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteTuplesExecute", reflect.TypeOf((*MockSdkClient)(nil).WriteTuplesExecute), request) +} + +// MockSdkClientListStoresRequestInterface is a mock of SdkClientListStoresRequestInterface interface. +type MockSdkClientListStoresRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientListStoresRequestInterfaceMockRecorder +} + +// MockSdkClientListStoresRequestInterfaceMockRecorder is the mock recorder for MockSdkClientListStoresRequestInterface. +type MockSdkClientListStoresRequestInterfaceMockRecorder struct { + mock *MockSdkClientListStoresRequestInterface +} + +// NewMockSdkClientListStoresRequestInterface creates a new mock instance. +func NewMockSdkClientListStoresRequestInterface(ctrl *gomock.Controller) *MockSdkClientListStoresRequestInterface { + mock := &MockSdkClientListStoresRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientListStoresRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientListStoresRequestInterface) EXPECT() *MockSdkClientListStoresRequestInterfaceMockRecorder { + return m.recorder +} + +// Execute mocks base method. +func (m *MockSdkClientListStoresRequestInterface) Execute() (*client.ClientListStoresResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientListStoresResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientListStoresRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientListStoresRequestInterface)(nil).Execute)) +} + +// GetContext mocks base method. +func (m *MockSdkClientListStoresRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientListStoresRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientListStoresRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientListStoresRequestInterface) GetOptions() *client.ClientListStoresOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientListStoresOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientListStoresRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientListStoresRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientListStoresRequestInterface) Options(options client.ClientListStoresOptions) client.SdkClientListStoresRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientListStoresRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientListStoresRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientListStoresRequestInterface)(nil).Options), options) +} + +// MockSdkClientCreateStoreRequestInterface is a mock of SdkClientCreateStoreRequestInterface interface. +type MockSdkClientCreateStoreRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientCreateStoreRequestInterfaceMockRecorder +} + +// MockSdkClientCreateStoreRequestInterfaceMockRecorder is the mock recorder for MockSdkClientCreateStoreRequestInterface. +type MockSdkClientCreateStoreRequestInterfaceMockRecorder struct { + mock *MockSdkClientCreateStoreRequestInterface +} + +// NewMockSdkClientCreateStoreRequestInterface creates a new mock instance. +func NewMockSdkClientCreateStoreRequestInterface(ctrl *gomock.Controller) *MockSdkClientCreateStoreRequestInterface { + mock := &MockSdkClientCreateStoreRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientCreateStoreRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientCreateStoreRequestInterface) EXPECT() *MockSdkClientCreateStoreRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientCreateStoreRequestInterface) Body(body client.ClientCreateStoreRequest) client.SdkClientCreateStoreRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientCreateStoreRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientCreateStoreRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientCreateStoreRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientCreateStoreRequestInterface) Execute() (*client.ClientCreateStoreResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientCreateStoreResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientCreateStoreRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientCreateStoreRequestInterface)(nil).Execute)) +} + +// GetBody mocks base method. +func (m *MockSdkClientCreateStoreRequestInterface) GetBody() *client.ClientCreateStoreRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientCreateStoreRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientCreateStoreRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientCreateStoreRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientCreateStoreRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientCreateStoreRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientCreateStoreRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientCreateStoreRequestInterface) GetOptions() *client.ClientCreateStoreOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientCreateStoreOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientCreateStoreRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientCreateStoreRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientCreateStoreRequestInterface) Options(options client.ClientCreateStoreOptions) client.SdkClientCreateStoreRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientCreateStoreRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientCreateStoreRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientCreateStoreRequestInterface)(nil).Options), options) +} + +// MockSdkClientGetStoreRequestInterface is a mock of SdkClientGetStoreRequestInterface interface. +type MockSdkClientGetStoreRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientGetStoreRequestInterfaceMockRecorder +} + +// MockSdkClientGetStoreRequestInterfaceMockRecorder is the mock recorder for MockSdkClientGetStoreRequestInterface. +type MockSdkClientGetStoreRequestInterfaceMockRecorder struct { + mock *MockSdkClientGetStoreRequestInterface +} + +// NewMockSdkClientGetStoreRequestInterface creates a new mock instance. +func NewMockSdkClientGetStoreRequestInterface(ctrl *gomock.Controller) *MockSdkClientGetStoreRequestInterface { + mock := &MockSdkClientGetStoreRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientGetStoreRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientGetStoreRequestInterface) EXPECT() *MockSdkClientGetStoreRequestInterfaceMockRecorder { + return m.recorder +} + +// Execute mocks base method. +func (m *MockSdkClientGetStoreRequestInterface) Execute() (*client.ClientGetStoreResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientGetStoreResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientGetStoreRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientGetStoreRequestInterface)(nil).Execute)) +} + +// GetContext mocks base method. +func (m *MockSdkClientGetStoreRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientGetStoreRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientGetStoreRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientGetStoreRequestInterface) GetOptions() *client.ClientGetStoreOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientGetStoreOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientGetStoreRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientGetStoreRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientGetStoreRequestInterface) Options(options client.ClientGetStoreOptions) client.SdkClientGetStoreRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientGetStoreRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientGetStoreRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientGetStoreRequestInterface)(nil).Options), options) +} + +// MockSdkClientDeleteStoreRequestInterface is a mock of SdkClientDeleteStoreRequestInterface interface. +type MockSdkClientDeleteStoreRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientDeleteStoreRequestInterfaceMockRecorder +} + +// MockSdkClientDeleteStoreRequestInterfaceMockRecorder is the mock recorder for MockSdkClientDeleteStoreRequestInterface. +type MockSdkClientDeleteStoreRequestInterfaceMockRecorder struct { + mock *MockSdkClientDeleteStoreRequestInterface +} + +// NewMockSdkClientDeleteStoreRequestInterface creates a new mock instance. +func NewMockSdkClientDeleteStoreRequestInterface(ctrl *gomock.Controller) *MockSdkClientDeleteStoreRequestInterface { + mock := &MockSdkClientDeleteStoreRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientDeleteStoreRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientDeleteStoreRequestInterface) EXPECT() *MockSdkClientDeleteStoreRequestInterfaceMockRecorder { + return m.recorder +} + +// Execute mocks base method. +func (m *MockSdkClientDeleteStoreRequestInterface) Execute() (*client.ClientDeleteStoreResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientDeleteStoreResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientDeleteStoreRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientDeleteStoreRequestInterface)(nil).Execute)) +} + +// GetContext mocks base method. +func (m *MockSdkClientDeleteStoreRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientDeleteStoreRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientDeleteStoreRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientDeleteStoreRequestInterface) GetOptions() *client.ClientDeleteStoreOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientDeleteStoreOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientDeleteStoreRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientDeleteStoreRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientDeleteStoreRequestInterface) Options(options client.ClientDeleteStoreOptions) client.SdkClientDeleteStoreRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientDeleteStoreRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientDeleteStoreRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientDeleteStoreRequestInterface)(nil).Options), options) +} + +// MockSdkClientReadAuthorizationModelsRequestInterface is a mock of SdkClientReadAuthorizationModelsRequestInterface interface. +type MockSdkClientReadAuthorizationModelsRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientReadAuthorizationModelsRequestInterfaceMockRecorder +} + +// MockSdkClientReadAuthorizationModelsRequestInterfaceMockRecorder is the mock recorder for MockSdkClientReadAuthorizationModelsRequestInterface. +type MockSdkClientReadAuthorizationModelsRequestInterfaceMockRecorder struct { + mock *MockSdkClientReadAuthorizationModelsRequestInterface +} + +// NewMockSdkClientReadAuthorizationModelsRequestInterface creates a new mock instance. +func NewMockSdkClientReadAuthorizationModelsRequestInterface(ctrl *gomock.Controller) *MockSdkClientReadAuthorizationModelsRequestInterface { + mock := &MockSdkClientReadAuthorizationModelsRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientReadAuthorizationModelsRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientReadAuthorizationModelsRequestInterface) EXPECT() *MockSdkClientReadAuthorizationModelsRequestInterfaceMockRecorder { + return m.recorder +} + +// Execute mocks base method. +func (m *MockSdkClientReadAuthorizationModelsRequestInterface) Execute() (*client.ClientReadAuthorizationModelsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientReadAuthorizationModelsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientReadAuthorizationModelsRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientReadAuthorizationModelsRequestInterface)(nil).Execute)) +} + +// GetContext mocks base method. +func (m *MockSdkClientReadAuthorizationModelsRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientReadAuthorizationModelsRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientReadAuthorizationModelsRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientReadAuthorizationModelsRequestInterface) GetOptions() *client.ClientReadAuthorizationModelsOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientReadAuthorizationModelsOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientReadAuthorizationModelsRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientReadAuthorizationModelsRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientReadAuthorizationModelsRequestInterface) Options(options client.ClientReadAuthorizationModelsOptions) client.SdkClientReadAuthorizationModelsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientReadAuthorizationModelsRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientReadAuthorizationModelsRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientReadAuthorizationModelsRequestInterface)(nil).Options), options) +} + +// MockSdkClientWriteAuthorizationModelRequestInterface is a mock of SdkClientWriteAuthorizationModelRequestInterface interface. +type MockSdkClientWriteAuthorizationModelRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder +} + +// MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder is the mock recorder for MockSdkClientWriteAuthorizationModelRequestInterface. +type MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder struct { + mock *MockSdkClientWriteAuthorizationModelRequestInterface +} + +// NewMockSdkClientWriteAuthorizationModelRequestInterface creates a new mock instance. +func NewMockSdkClientWriteAuthorizationModelRequestInterface(ctrl *gomock.Controller) *MockSdkClientWriteAuthorizationModelRequestInterface { + mock := &MockSdkClientWriteAuthorizationModelRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientWriteAuthorizationModelRequestInterface) EXPECT() *MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientWriteAuthorizationModelRequestInterface) Body(body client.ClientWriteAuthorizationModelRequest) client.SdkClientWriteAuthorizationModelRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientWriteAuthorizationModelRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientWriteAuthorizationModelRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientWriteAuthorizationModelRequestInterface) Execute() (*client.ClientWriteAuthorizationModelResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientWriteAuthorizationModelResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientWriteAuthorizationModelRequestInterface)(nil).Execute)) +} + +// GetBody mocks base method. +func (m *MockSdkClientWriteAuthorizationModelRequestInterface) GetBody() *client.ClientWriteAuthorizationModelRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientWriteAuthorizationModelRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientWriteAuthorizationModelRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientWriteAuthorizationModelRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientWriteAuthorizationModelRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientWriteAuthorizationModelRequestInterface) GetOptions() *client.ClientWriteAuthorizationModelOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientWriteAuthorizationModelOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientWriteAuthorizationModelRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientWriteAuthorizationModelRequestInterface) Options(options client.ClientWriteAuthorizationModelOptions) client.SdkClientWriteAuthorizationModelRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientWriteAuthorizationModelRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientWriteAuthorizationModelRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientWriteAuthorizationModelRequestInterface)(nil).Options), options) +} + +// MockSdkClientReadAuthorizationModelRequestInterface is a mock of SdkClientReadAuthorizationModelRequestInterface interface. +type MockSdkClientReadAuthorizationModelRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder +} + +// MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder is the mock recorder for MockSdkClientReadAuthorizationModelRequestInterface. +type MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder struct { + mock *MockSdkClientReadAuthorizationModelRequestInterface +} + +// NewMockSdkClientReadAuthorizationModelRequestInterface creates a new mock instance. +func NewMockSdkClientReadAuthorizationModelRequestInterface(ctrl *gomock.Controller) *MockSdkClientReadAuthorizationModelRequestInterface { + mock := &MockSdkClientReadAuthorizationModelRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientReadAuthorizationModelRequestInterface) EXPECT() *MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientReadAuthorizationModelRequestInterface) Body(body client.ClientReadAuthorizationModelRequest) client.SdkClientReadAuthorizationModelRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientReadAuthorizationModelRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientReadAuthorizationModelRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientReadAuthorizationModelRequestInterface) Execute() (*client.ClientReadAuthorizationModelResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientReadAuthorizationModelResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientReadAuthorizationModelRequestInterface)(nil).Execute)) +} + +// GetAuthorizationModelIdOverride mocks base method. +func (m *MockSdkClientReadAuthorizationModelRequestInterface) GetAuthorizationModelIdOverride() *string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationModelIdOverride") + ret0, _ := ret[0].(*string) + return ret0 +} + +// GetAuthorizationModelIdOverride indicates an expected call of GetAuthorizationModelIdOverride. +func (mr *MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder) GetAuthorizationModelIdOverride() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationModelIdOverride", reflect.TypeOf((*MockSdkClientReadAuthorizationModelRequestInterface)(nil).GetAuthorizationModelIdOverride)) +} + +// GetBody mocks base method. +func (m *MockSdkClientReadAuthorizationModelRequestInterface) GetBody() *client.ClientReadAuthorizationModelRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientReadAuthorizationModelRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientReadAuthorizationModelRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientReadAuthorizationModelRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientReadAuthorizationModelRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientReadAuthorizationModelRequestInterface) GetOptions() *client.ClientReadAuthorizationModelOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientReadAuthorizationModelOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientReadAuthorizationModelRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientReadAuthorizationModelRequestInterface) Options(options client.ClientReadAuthorizationModelOptions) client.SdkClientReadAuthorizationModelRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientReadAuthorizationModelRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientReadAuthorizationModelRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientReadAuthorizationModelRequestInterface)(nil).Options), options) +} + +// MockSdkClientReadLatestAuthorizationModelRequestInterface is a mock of SdkClientReadLatestAuthorizationModelRequestInterface interface. +type MockSdkClientReadLatestAuthorizationModelRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientReadLatestAuthorizationModelRequestInterfaceMockRecorder +} + +// MockSdkClientReadLatestAuthorizationModelRequestInterfaceMockRecorder is the mock recorder for MockSdkClientReadLatestAuthorizationModelRequestInterface. +type MockSdkClientReadLatestAuthorizationModelRequestInterfaceMockRecorder struct { + mock *MockSdkClientReadLatestAuthorizationModelRequestInterface +} + +// NewMockSdkClientReadLatestAuthorizationModelRequestInterface creates a new mock instance. +func NewMockSdkClientReadLatestAuthorizationModelRequestInterface(ctrl *gomock.Controller) *MockSdkClientReadLatestAuthorizationModelRequestInterface { + mock := &MockSdkClientReadLatestAuthorizationModelRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientReadLatestAuthorizationModelRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientReadLatestAuthorizationModelRequestInterface) EXPECT() *MockSdkClientReadLatestAuthorizationModelRequestInterfaceMockRecorder { + return m.recorder +} + +// Execute mocks base method. +func (m *MockSdkClientReadLatestAuthorizationModelRequestInterface) Execute() (*client.ClientReadAuthorizationModelResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientReadAuthorizationModelResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientReadLatestAuthorizationModelRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientReadLatestAuthorizationModelRequestInterface)(nil).Execute)) +} + +// GetContext mocks base method. +func (m *MockSdkClientReadLatestAuthorizationModelRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientReadLatestAuthorizationModelRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientReadLatestAuthorizationModelRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientReadLatestAuthorizationModelRequestInterface) GetOptions() *client.ClientReadLatestAuthorizationModelOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientReadLatestAuthorizationModelOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientReadLatestAuthorizationModelRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientReadLatestAuthorizationModelRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientReadLatestAuthorizationModelRequestInterface) Options(options client.ClientReadLatestAuthorizationModelOptions) client.SdkClientReadLatestAuthorizationModelRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientReadLatestAuthorizationModelRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientReadLatestAuthorizationModelRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientReadLatestAuthorizationModelRequestInterface)(nil).Options), options) +} + +// MockSdkClientReadChangesRequestInterface is a mock of SdkClientReadChangesRequestInterface interface. +type MockSdkClientReadChangesRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientReadChangesRequestInterfaceMockRecorder +} + +// MockSdkClientReadChangesRequestInterfaceMockRecorder is the mock recorder for MockSdkClientReadChangesRequestInterface. +type MockSdkClientReadChangesRequestInterfaceMockRecorder struct { + mock *MockSdkClientReadChangesRequestInterface +} + +// NewMockSdkClientReadChangesRequestInterface creates a new mock instance. +func NewMockSdkClientReadChangesRequestInterface(ctrl *gomock.Controller) *MockSdkClientReadChangesRequestInterface { + mock := &MockSdkClientReadChangesRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientReadChangesRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientReadChangesRequestInterface) EXPECT() *MockSdkClientReadChangesRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientReadChangesRequestInterface) Body(body client.ClientReadChangesRequest) client.SdkClientReadChangesRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientReadChangesRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientReadChangesRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientReadChangesRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientReadChangesRequestInterface) Execute() (*client.ClientReadChangesResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientReadChangesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientReadChangesRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientReadChangesRequestInterface)(nil).Execute)) +} + +// GetBody mocks base method. +func (m *MockSdkClientReadChangesRequestInterface) GetBody() *client.ClientReadChangesRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientReadChangesRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientReadChangesRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientReadChangesRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientReadChangesRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientReadChangesRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientReadChangesRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientReadChangesRequestInterface) GetOptions() *client.ClientReadChangesOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientReadChangesOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientReadChangesRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientReadChangesRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientReadChangesRequestInterface) Options(options client.ClientReadChangesOptions) client.SdkClientReadChangesRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientReadChangesRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientReadChangesRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientReadChangesRequestInterface)(nil).Options), options) +} + +// MockSdkClientReadRequestInterface is a mock of SdkClientReadRequestInterface interface. +type MockSdkClientReadRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientReadRequestInterfaceMockRecorder +} + +// MockSdkClientReadRequestInterfaceMockRecorder is the mock recorder for MockSdkClientReadRequestInterface. +type MockSdkClientReadRequestInterfaceMockRecorder struct { + mock *MockSdkClientReadRequestInterface +} + +// NewMockSdkClientReadRequestInterface creates a new mock instance. +func NewMockSdkClientReadRequestInterface(ctrl *gomock.Controller) *MockSdkClientReadRequestInterface { + mock := &MockSdkClientReadRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientReadRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientReadRequestInterface) EXPECT() *MockSdkClientReadRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientReadRequestInterface) Body(body client.ClientReadRequest) client.SdkClientReadRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientReadRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientReadRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientReadRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientReadRequestInterface) Execute() (*client.ClientReadResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientReadResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientReadRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientReadRequestInterface)(nil).Execute)) +} + +// GetBody mocks base method. +func (m *MockSdkClientReadRequestInterface) GetBody() *client.ClientReadRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientReadRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientReadRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientReadRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientReadRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientReadRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientReadRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientReadRequestInterface) GetOptions() *client.ClientReadOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientReadOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientReadRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientReadRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientReadRequestInterface) Options(options client.ClientReadOptions) client.SdkClientReadRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientReadRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientReadRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientReadRequestInterface)(nil).Options), options) +} + +// MockSdkClientWriteRequestInterface is a mock of SdkClientWriteRequestInterface interface. +type MockSdkClientWriteRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientWriteRequestInterfaceMockRecorder +} + +// MockSdkClientWriteRequestInterfaceMockRecorder is the mock recorder for MockSdkClientWriteRequestInterface. +type MockSdkClientWriteRequestInterfaceMockRecorder struct { + mock *MockSdkClientWriteRequestInterface +} + +// NewMockSdkClientWriteRequestInterface creates a new mock instance. +func NewMockSdkClientWriteRequestInterface(ctrl *gomock.Controller) *MockSdkClientWriteRequestInterface { + mock := &MockSdkClientWriteRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientWriteRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientWriteRequestInterface) EXPECT() *MockSdkClientWriteRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientWriteRequestInterface) Body(body client.ClientWriteRequest) client.SdkClientWriteRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientWriteRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientWriteRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientWriteRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientWriteRequestInterface) Execute() (*client.ClientWriteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientWriteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientWriteRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientWriteRequestInterface)(nil).Execute)) +} + +// GetAuthorizationModelIdOverride mocks base method. +func (m *MockSdkClientWriteRequestInterface) GetAuthorizationModelIdOverride() *string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationModelIdOverride") + ret0, _ := ret[0].(*string) + return ret0 +} + +// GetAuthorizationModelIdOverride indicates an expected call of GetAuthorizationModelIdOverride. +func (mr *MockSdkClientWriteRequestInterfaceMockRecorder) GetAuthorizationModelIdOverride() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationModelIdOverride", reflect.TypeOf((*MockSdkClientWriteRequestInterface)(nil).GetAuthorizationModelIdOverride)) +} + +// GetBody mocks base method. +func (m *MockSdkClientWriteRequestInterface) GetBody() *client.ClientWriteRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientWriteRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientWriteRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientWriteRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientWriteRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientWriteRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientWriteRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientWriteRequestInterface) GetOptions() *client.ClientWriteOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientWriteOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientWriteRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientWriteRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientWriteRequestInterface) Options(options client.ClientWriteOptions) client.SdkClientWriteRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientWriteRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientWriteRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientWriteRequestInterface)(nil).Options), options) +} + +// MockSdkClientWriteTuplesRequestInterface is a mock of SdkClientWriteTuplesRequestInterface interface. +type MockSdkClientWriteTuplesRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientWriteTuplesRequestInterfaceMockRecorder +} + +// MockSdkClientWriteTuplesRequestInterfaceMockRecorder is the mock recorder for MockSdkClientWriteTuplesRequestInterface. +type MockSdkClientWriteTuplesRequestInterfaceMockRecorder struct { + mock *MockSdkClientWriteTuplesRequestInterface +} + +// NewMockSdkClientWriteTuplesRequestInterface creates a new mock instance. +func NewMockSdkClientWriteTuplesRequestInterface(ctrl *gomock.Controller) *MockSdkClientWriteTuplesRequestInterface { + mock := &MockSdkClientWriteTuplesRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientWriteTuplesRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientWriteTuplesRequestInterface) EXPECT() *MockSdkClientWriteTuplesRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientWriteTuplesRequestInterface) Body(body client.ClientWriteTuplesBody) client.SdkClientWriteTuplesRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientWriteTuplesRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientWriteTuplesRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientWriteTuplesRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientWriteTuplesRequestInterface) Execute() (*client.ClientWriteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientWriteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientWriteTuplesRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientWriteTuplesRequestInterface)(nil).Execute)) +} + +// GetBody mocks base method. +func (m *MockSdkClientWriteTuplesRequestInterface) GetBody() *client.ClientWriteTuplesBody { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientWriteTuplesBody) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientWriteTuplesRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientWriteTuplesRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientWriteTuplesRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientWriteTuplesRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientWriteTuplesRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientWriteTuplesRequestInterface) GetOptions() *client.ClientWriteOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientWriteOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientWriteTuplesRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientWriteTuplesRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientWriteTuplesRequestInterface) Options(options client.ClientWriteOptions) client.SdkClientWriteTuplesRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientWriteTuplesRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientWriteTuplesRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientWriteTuplesRequestInterface)(nil).Options), options) +} + +// MockSdkClientDeleteTuplesRequestInterface is a mock of SdkClientDeleteTuplesRequestInterface interface. +type MockSdkClientDeleteTuplesRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientDeleteTuplesRequestInterfaceMockRecorder +} + +// MockSdkClientDeleteTuplesRequestInterfaceMockRecorder is the mock recorder for MockSdkClientDeleteTuplesRequestInterface. +type MockSdkClientDeleteTuplesRequestInterfaceMockRecorder struct { + mock *MockSdkClientDeleteTuplesRequestInterface +} + +// NewMockSdkClientDeleteTuplesRequestInterface creates a new mock instance. +func NewMockSdkClientDeleteTuplesRequestInterface(ctrl *gomock.Controller) *MockSdkClientDeleteTuplesRequestInterface { + mock := &MockSdkClientDeleteTuplesRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientDeleteTuplesRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientDeleteTuplesRequestInterface) EXPECT() *MockSdkClientDeleteTuplesRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientDeleteTuplesRequestInterface) Body(body client.ClientDeleteTuplesBody) client.SdkClientDeleteTuplesRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientDeleteTuplesRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientDeleteTuplesRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientDeleteTuplesRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientDeleteTuplesRequestInterface) Execute() (*client.ClientWriteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientWriteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientDeleteTuplesRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientDeleteTuplesRequestInterface)(nil).Execute)) +} + +// GetBody mocks base method. +func (m *MockSdkClientDeleteTuplesRequestInterface) GetBody() *client.ClientDeleteTuplesBody { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientDeleteTuplesBody) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientDeleteTuplesRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientDeleteTuplesRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientDeleteTuplesRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientDeleteTuplesRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientDeleteTuplesRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientDeleteTuplesRequestInterface) GetOptions() *client.ClientWriteOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientWriteOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientDeleteTuplesRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientDeleteTuplesRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientDeleteTuplesRequestInterface) Options(options client.ClientWriteOptions) client.SdkClientDeleteTuplesRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientDeleteTuplesRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientDeleteTuplesRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientDeleteTuplesRequestInterface)(nil).Options), options) +} + +// MockSdkClientCheckRequestInterface is a mock of SdkClientCheckRequestInterface interface. +type MockSdkClientCheckRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientCheckRequestInterfaceMockRecorder +} + +// MockSdkClientCheckRequestInterfaceMockRecorder is the mock recorder for MockSdkClientCheckRequestInterface. +type MockSdkClientCheckRequestInterfaceMockRecorder struct { + mock *MockSdkClientCheckRequestInterface +} + +// NewMockSdkClientCheckRequestInterface creates a new mock instance. +func NewMockSdkClientCheckRequestInterface(ctrl *gomock.Controller) *MockSdkClientCheckRequestInterface { + mock := &MockSdkClientCheckRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientCheckRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientCheckRequestInterface) EXPECT() *MockSdkClientCheckRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientCheckRequestInterface) Body(body client.ClientCheckRequest) client.SdkClientCheckRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientCheckRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientCheckRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientCheckRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientCheckRequestInterface) Execute() (*client.ClientCheckResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientCheckResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientCheckRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientCheckRequestInterface)(nil).Execute)) +} + +// GetAuthorizationModelIdOverride mocks base method. +func (m *MockSdkClientCheckRequestInterface) GetAuthorizationModelIdOverride() *string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationModelIdOverride") + ret0, _ := ret[0].(*string) + return ret0 +} + +// GetAuthorizationModelIdOverride indicates an expected call of GetAuthorizationModelIdOverride. +func (mr *MockSdkClientCheckRequestInterfaceMockRecorder) GetAuthorizationModelIdOverride() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationModelIdOverride", reflect.TypeOf((*MockSdkClientCheckRequestInterface)(nil).GetAuthorizationModelIdOverride)) +} + +// GetBody mocks base method. +func (m *MockSdkClientCheckRequestInterface) GetBody() *client.ClientCheckRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientCheckRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientCheckRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientCheckRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientCheckRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientCheckRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientCheckRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientCheckRequestInterface) GetOptions() *client.ClientCheckOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientCheckOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientCheckRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientCheckRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientCheckRequestInterface) Options(options client.ClientCheckOptions) client.SdkClientCheckRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientCheckRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientCheckRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientCheckRequestInterface)(nil).Options), options) +} + +// MockSdkClientBatchCheckRequestInterface is a mock of SdkClientBatchCheckRequestInterface interface. +type MockSdkClientBatchCheckRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientBatchCheckRequestInterfaceMockRecorder +} + +// MockSdkClientBatchCheckRequestInterfaceMockRecorder is the mock recorder for MockSdkClientBatchCheckRequestInterface. +type MockSdkClientBatchCheckRequestInterfaceMockRecorder struct { + mock *MockSdkClientBatchCheckRequestInterface +} + +// NewMockSdkClientBatchCheckRequestInterface creates a new mock instance. +func NewMockSdkClientBatchCheckRequestInterface(ctrl *gomock.Controller) *MockSdkClientBatchCheckRequestInterface { + mock := &MockSdkClientBatchCheckRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientBatchCheckRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientBatchCheckRequestInterface) EXPECT() *MockSdkClientBatchCheckRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientBatchCheckRequestInterface) Body(body client.ClientBatchCheckBody) client.SdkClientBatchCheckRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientBatchCheckRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientBatchCheckRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientBatchCheckRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientBatchCheckRequestInterface) Execute() (*client.ClientBatchCheckResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientBatchCheckResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientBatchCheckRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientBatchCheckRequestInterface)(nil).Execute)) +} + +// GetAuthorizationModelIdOverride mocks base method. +func (m *MockSdkClientBatchCheckRequestInterface) GetAuthorizationModelIdOverride() *string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationModelIdOverride") + ret0, _ := ret[0].(*string) + return ret0 +} + +// GetAuthorizationModelIdOverride indicates an expected call of GetAuthorizationModelIdOverride. +func (mr *MockSdkClientBatchCheckRequestInterfaceMockRecorder) GetAuthorizationModelIdOverride() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationModelIdOverride", reflect.TypeOf((*MockSdkClientBatchCheckRequestInterface)(nil).GetAuthorizationModelIdOverride)) +} + +// GetBody mocks base method. +func (m *MockSdkClientBatchCheckRequestInterface) GetBody() *client.ClientBatchCheckBody { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientBatchCheckBody) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientBatchCheckRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientBatchCheckRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientBatchCheckRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientBatchCheckRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientBatchCheckRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientBatchCheckRequestInterface) GetOptions() *client.ClientBatchCheckOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientBatchCheckOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientBatchCheckRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientBatchCheckRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientBatchCheckRequestInterface) Options(options client.ClientBatchCheckOptions) client.SdkClientBatchCheckRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientBatchCheckRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientBatchCheckRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientBatchCheckRequestInterface)(nil).Options), options) +} + +// MockSdkClientExpandRequestInterface is a mock of SdkClientExpandRequestInterface interface. +type MockSdkClientExpandRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientExpandRequestInterfaceMockRecorder +} + +// MockSdkClientExpandRequestInterfaceMockRecorder is the mock recorder for MockSdkClientExpandRequestInterface. +type MockSdkClientExpandRequestInterfaceMockRecorder struct { + mock *MockSdkClientExpandRequestInterface +} + +// NewMockSdkClientExpandRequestInterface creates a new mock instance. +func NewMockSdkClientExpandRequestInterface(ctrl *gomock.Controller) *MockSdkClientExpandRequestInterface { + mock := &MockSdkClientExpandRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientExpandRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientExpandRequestInterface) EXPECT() *MockSdkClientExpandRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientExpandRequestInterface) Body(body client.ClientExpandRequest) client.SdkClientExpandRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientExpandRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientExpandRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientExpandRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientExpandRequestInterface) Execute() (*client.ClientExpandResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientExpandResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientExpandRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientExpandRequestInterface)(nil).Execute)) +} + +// GetAuthorizationModelIdOverride mocks base method. +func (m *MockSdkClientExpandRequestInterface) GetAuthorizationModelIdOverride() *string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationModelIdOverride") + ret0, _ := ret[0].(*string) + return ret0 +} + +// GetAuthorizationModelIdOverride indicates an expected call of GetAuthorizationModelIdOverride. +func (mr *MockSdkClientExpandRequestInterfaceMockRecorder) GetAuthorizationModelIdOverride() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationModelIdOverride", reflect.TypeOf((*MockSdkClientExpandRequestInterface)(nil).GetAuthorizationModelIdOverride)) +} + +// GetBody mocks base method. +func (m *MockSdkClientExpandRequestInterface) GetBody() *client.ClientExpandRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientExpandRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientExpandRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientExpandRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientExpandRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientExpandRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientExpandRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientExpandRequestInterface) GetOptions() *client.ClientExpandOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientExpandOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientExpandRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientExpandRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientExpandRequestInterface) Options(options client.ClientExpandOptions) client.SdkClientExpandRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientExpandRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientExpandRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientExpandRequestInterface)(nil).Options), options) +} + +// MockSdkClientListObjectsRequestInterface is a mock of SdkClientListObjectsRequestInterface interface. +type MockSdkClientListObjectsRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientListObjectsRequestInterfaceMockRecorder +} + +// MockSdkClientListObjectsRequestInterfaceMockRecorder is the mock recorder for MockSdkClientListObjectsRequestInterface. +type MockSdkClientListObjectsRequestInterfaceMockRecorder struct { + mock *MockSdkClientListObjectsRequestInterface +} + +// NewMockSdkClientListObjectsRequestInterface creates a new mock instance. +func NewMockSdkClientListObjectsRequestInterface(ctrl *gomock.Controller) *MockSdkClientListObjectsRequestInterface { + mock := &MockSdkClientListObjectsRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientListObjectsRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientListObjectsRequestInterface) EXPECT() *MockSdkClientListObjectsRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientListObjectsRequestInterface) Body(body client.ClientListObjectsRequest) client.SdkClientListObjectsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientListObjectsRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientListObjectsRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientListObjectsRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientListObjectsRequestInterface) Execute() (*client.ClientListObjectsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientListObjectsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientListObjectsRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientListObjectsRequestInterface)(nil).Execute)) +} + +// GetAuthorizationModelIdOverride mocks base method. +func (m *MockSdkClientListObjectsRequestInterface) GetAuthorizationModelIdOverride() *string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationModelIdOverride") + ret0, _ := ret[0].(*string) + return ret0 +} + +// GetAuthorizationModelIdOverride indicates an expected call of GetAuthorizationModelIdOverride. +func (mr *MockSdkClientListObjectsRequestInterfaceMockRecorder) GetAuthorizationModelIdOverride() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationModelIdOverride", reflect.TypeOf((*MockSdkClientListObjectsRequestInterface)(nil).GetAuthorizationModelIdOverride)) +} + +// GetBody mocks base method. +func (m *MockSdkClientListObjectsRequestInterface) GetBody() *client.ClientListObjectsRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientListObjectsRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientListObjectsRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientListObjectsRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientListObjectsRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientListObjectsRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientListObjectsRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientListObjectsRequestInterface) GetOptions() *client.ClientListObjectsOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientListObjectsOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientListObjectsRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientListObjectsRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientListObjectsRequestInterface) Options(options client.ClientListObjectsOptions) client.SdkClientListObjectsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientListObjectsRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientListObjectsRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientListObjectsRequestInterface)(nil).Options), options) +} + +// MockSdkClientListRelationsRequestInterface is a mock of SdkClientListRelationsRequestInterface interface. +type MockSdkClientListRelationsRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientListRelationsRequestInterfaceMockRecorder +} + +// MockSdkClientListRelationsRequestInterfaceMockRecorder is the mock recorder for MockSdkClientListRelationsRequestInterface. +type MockSdkClientListRelationsRequestInterfaceMockRecorder struct { + mock *MockSdkClientListRelationsRequestInterface +} + +// NewMockSdkClientListRelationsRequestInterface creates a new mock instance. +func NewMockSdkClientListRelationsRequestInterface(ctrl *gomock.Controller) *MockSdkClientListRelationsRequestInterface { + mock := &MockSdkClientListRelationsRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientListRelationsRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientListRelationsRequestInterface) EXPECT() *MockSdkClientListRelationsRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientListRelationsRequestInterface) Body(body client.ClientListRelationsRequest) client.SdkClientListRelationsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientListRelationsRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientListRelationsRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientListRelationsRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientListRelationsRequestInterface) Execute() (*client.ClientListRelationsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientListRelationsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientListRelationsRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientListRelationsRequestInterface)(nil).Execute)) +} + +// GetAuthorizationModelIdOverride mocks base method. +func (m *MockSdkClientListRelationsRequestInterface) GetAuthorizationModelIdOverride() *string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationModelIdOverride") + ret0, _ := ret[0].(*string) + return ret0 +} + +// GetAuthorizationModelIdOverride indicates an expected call of GetAuthorizationModelIdOverride. +func (mr *MockSdkClientListRelationsRequestInterfaceMockRecorder) GetAuthorizationModelIdOverride() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationModelIdOverride", reflect.TypeOf((*MockSdkClientListRelationsRequestInterface)(nil).GetAuthorizationModelIdOverride)) +} + +// GetBody mocks base method. +func (m *MockSdkClientListRelationsRequestInterface) GetBody() *client.ClientListRelationsRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientListRelationsRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientListRelationsRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientListRelationsRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientListRelationsRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientListRelationsRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientListRelationsRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientListRelationsRequestInterface) GetOptions() *client.ClientListRelationsOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientListRelationsOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientListRelationsRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientListRelationsRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientListRelationsRequestInterface) Options(options client.ClientListRelationsOptions) client.SdkClientListRelationsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientListRelationsRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientListRelationsRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientListRelationsRequestInterface)(nil).Options), options) +} + +// MockSdkClientReadAssertionsRequestInterface is a mock of SdkClientReadAssertionsRequestInterface interface. +type MockSdkClientReadAssertionsRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientReadAssertionsRequestInterfaceMockRecorder +} + +// MockSdkClientReadAssertionsRequestInterfaceMockRecorder is the mock recorder for MockSdkClientReadAssertionsRequestInterface. +type MockSdkClientReadAssertionsRequestInterfaceMockRecorder struct { + mock *MockSdkClientReadAssertionsRequestInterface +} + +// NewMockSdkClientReadAssertionsRequestInterface creates a new mock instance. +func NewMockSdkClientReadAssertionsRequestInterface(ctrl *gomock.Controller) *MockSdkClientReadAssertionsRequestInterface { + mock := &MockSdkClientReadAssertionsRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientReadAssertionsRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientReadAssertionsRequestInterface) EXPECT() *MockSdkClientReadAssertionsRequestInterfaceMockRecorder { + return m.recorder +} + +// Execute mocks base method. +func (m *MockSdkClientReadAssertionsRequestInterface) Execute() (*client.ClientReadAssertionsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientReadAssertionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientReadAssertionsRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientReadAssertionsRequestInterface)(nil).Execute)) +} + +// GetAuthorizationModelIdOverride mocks base method. +func (m *MockSdkClientReadAssertionsRequestInterface) GetAuthorizationModelIdOverride() *string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationModelIdOverride") + ret0, _ := ret[0].(*string) + return ret0 +} + +// GetAuthorizationModelIdOverride indicates an expected call of GetAuthorizationModelIdOverride. +func (mr *MockSdkClientReadAssertionsRequestInterfaceMockRecorder) GetAuthorizationModelIdOverride() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationModelIdOverride", reflect.TypeOf((*MockSdkClientReadAssertionsRequestInterface)(nil).GetAuthorizationModelIdOverride)) +} + +// GetContext mocks base method. +func (m *MockSdkClientReadAssertionsRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientReadAssertionsRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientReadAssertionsRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientReadAssertionsRequestInterface) GetOptions() *client.ClientReadAssertionsOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientReadAssertionsOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientReadAssertionsRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientReadAssertionsRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientReadAssertionsRequestInterface) Options(options client.ClientReadAssertionsOptions) client.SdkClientReadAssertionsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientReadAssertionsRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientReadAssertionsRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientReadAssertionsRequestInterface)(nil).Options), options) +} + +// MockSdkClientWriteAssertionsRequestInterface is a mock of SdkClientWriteAssertionsRequestInterface interface. +type MockSdkClientWriteAssertionsRequestInterface struct { + ctrl *gomock.Controller + recorder *MockSdkClientWriteAssertionsRequestInterfaceMockRecorder +} + +// MockSdkClientWriteAssertionsRequestInterfaceMockRecorder is the mock recorder for MockSdkClientWriteAssertionsRequestInterface. +type MockSdkClientWriteAssertionsRequestInterfaceMockRecorder struct { + mock *MockSdkClientWriteAssertionsRequestInterface +} + +// NewMockSdkClientWriteAssertionsRequestInterface creates a new mock instance. +func NewMockSdkClientWriteAssertionsRequestInterface(ctrl *gomock.Controller) *MockSdkClientWriteAssertionsRequestInterface { + mock := &MockSdkClientWriteAssertionsRequestInterface{ctrl: ctrl} + mock.recorder = &MockSdkClientWriteAssertionsRequestInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSdkClientWriteAssertionsRequestInterface) EXPECT() *MockSdkClientWriteAssertionsRequestInterfaceMockRecorder { + return m.recorder +} + +// Body mocks base method. +func (m *MockSdkClientWriteAssertionsRequestInterface) Body(body client.ClientWriteAssertionsRequest) client.SdkClientWriteAssertionsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Body", body) + ret0, _ := ret[0].(client.SdkClientWriteAssertionsRequestInterface) + return ret0 +} + +// Body indicates an expected call of Body. +func (mr *MockSdkClientWriteAssertionsRequestInterfaceMockRecorder) Body(body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockSdkClientWriteAssertionsRequestInterface)(nil).Body), body) +} + +// Execute mocks base method. +func (m *MockSdkClientWriteAssertionsRequestInterface) Execute() (*client.ClientWriteAssertionsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute") + ret0, _ := ret[0].(*client.ClientWriteAssertionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Execute indicates an expected call of Execute. +func (mr *MockSdkClientWriteAssertionsRequestInterfaceMockRecorder) Execute() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSdkClientWriteAssertionsRequestInterface)(nil).Execute)) +} + +// GetAuthorizationModelIdOverride mocks base method. +func (m *MockSdkClientWriteAssertionsRequestInterface) GetAuthorizationModelIdOverride() *string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationModelIdOverride") + ret0, _ := ret[0].(*string) + return ret0 +} + +// GetAuthorizationModelIdOverride indicates an expected call of GetAuthorizationModelIdOverride. +func (mr *MockSdkClientWriteAssertionsRequestInterfaceMockRecorder) GetAuthorizationModelIdOverride() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationModelIdOverride", reflect.TypeOf((*MockSdkClientWriteAssertionsRequestInterface)(nil).GetAuthorizationModelIdOverride)) +} + +// GetBody mocks base method. +func (m *MockSdkClientWriteAssertionsRequestInterface) GetBody() *client.ClientWriteAssertionsRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBody") + ret0, _ := ret[0].(*client.ClientWriteAssertionsRequest) + return ret0 +} + +// GetBody indicates an expected call of GetBody. +func (mr *MockSdkClientWriteAssertionsRequestInterfaceMockRecorder) GetBody() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBody", reflect.TypeOf((*MockSdkClientWriteAssertionsRequestInterface)(nil).GetBody)) +} + +// GetContext mocks base method. +func (m *MockSdkClientWriteAssertionsRequestInterface) GetContext() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetContext") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// GetContext indicates an expected call of GetContext. +func (mr *MockSdkClientWriteAssertionsRequestInterfaceMockRecorder) GetContext() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContext", reflect.TypeOf((*MockSdkClientWriteAssertionsRequestInterface)(nil).GetContext)) +} + +// GetOptions mocks base method. +func (m *MockSdkClientWriteAssertionsRequestInterface) GetOptions() *client.ClientWriteAssertionsOptions { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOptions") + ret0, _ := ret[0].(*client.ClientWriteAssertionsOptions) + return ret0 +} + +// GetOptions indicates an expected call of GetOptions. +func (mr *MockSdkClientWriteAssertionsRequestInterfaceMockRecorder) GetOptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOptions", reflect.TypeOf((*MockSdkClientWriteAssertionsRequestInterface)(nil).GetOptions)) +} + +// Options mocks base method. +func (m *MockSdkClientWriteAssertionsRequestInterface) Options(options client.ClientWriteAssertionsOptions) client.SdkClientWriteAssertionsRequestInterface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Options", options) + ret0, _ := ret[0].(client.SdkClientWriteAssertionsRequestInterface) + return ret0 +} + +// Options indicates an expected call of Options. +func (mr *MockSdkClientWriteAssertionsRequestInterfaceMockRecorder) Options(options interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Options", reflect.TypeOf((*MockSdkClientWriteAssertionsRequestInterface)(nil).Options), options) +} From 5cb0dad1d30b8772fe5fe6ddae39b91dd9078579 Mon Sep 17 00:00:00 2001 From: Adrian Tam Date: Thu, 29 Jun 2023 10:26:01 -0400 Subject: [PATCH 2/3] test: adding additional unit tests for query --- cmd/query/check.go | 49 +++++---- cmd/query/check_test.go | 92 +++++++++++++++++ cmd/query/expand.go | 49 ++++++--- cmd/query/expand_test.go | 87 ++++++++++++++++ cmd/query/list-objects.go | 53 ++++++---- cmd/query/list-objects_test.go | 88 ++++++++++++++++ cmd/query/list-relations.go | 124 +++++++++++++--------- cmd/query/list-relations_test.go | 172 +++++++++++++++++++++++++++++++ 8 files changed, 614 insertions(+), 100 deletions(-) create mode 100644 cmd/query/check_test.go create mode 100644 cmd/query/expand_test.go create mode 100644 cmd/query/list-objects_test.go create mode 100644 cmd/query/list-relations_test.go diff --git a/cmd/query/check.go b/cmd/query/check.go index 5f184e1..e021862 100644 --- a/cmd/query/check.go +++ b/cmd/query/check.go @@ -19,46 +19,59 @@ import ( "context" "encoding/json" "fmt" - "os" "github.com/openfga/cli/lib/cmd-utils" "github.com/openfga/go-sdk/client" "github.com/spf13/cobra" ) +func check(fgaClient client.SdkClient, user string, relation string, object string) (string, error) { + body := &client.ClientCheckRequest{ + User: user, + Relation: relation, + Object: object, + } + options := &client.ClientCheckOptions{} + + response, err := fgaClient.Check(context.Background()).Body(*body).Options(*options).Execute() + if err != nil { + fmt.Printf("Failed to check due to %v", err) + + return "", fmt.Errorf("failed to check due to %w", err) + } + + responseJSON, err := json.Marshal(response) + if err != nil { + fmt.Printf("Failed to check due to %v", err) + + return "", fmt.Errorf("failed to check due to %w", err) + } + + return string(responseJSON), nil +} + // checkCmd represents the check command. var checkCmd = &cobra.Command{ Use: "check", Short: "Check", Long: "Check if a user has a particular relation with an object.", Args: cobra.ExactArgs(3), //nolint:gomnd - Run: func(cmd *cobra.Command, args []string) { + RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) fgaClient, err := clientConfig.GetFgaClient() if err != nil { fmt.Printf("Failed to initialize FGA Client due to %v", err) - os.Exit(1) - } - body := &client.ClientCheckRequest{ - User: args[0], - Relation: args[1], - Object: args[2], + return fmt.Errorf("failed to initialize FGA Client due to %w", err) } - options := &client.ClientCheckOptions{} - response, err := fgaClient.Check(context.Background()).Body(*body).Options(*options).Execute() + output, err := check(fgaClient, args[0], args[1], args[2]) if err != nil { - fmt.Printf("Failed to check due to %v", err) - os.Exit(1) + return err } + fmt.Print(output) - responseJSON, err := json.Marshal(response) - if err != nil { - fmt.Printf("Failed to check due to %v", err) - os.Exit(1) - } - fmt.Print(string(responseJSON)) + return nil }, } diff --git a/cmd/query/check_test.go b/cmd/query/check_test.go new file mode 100644 index 0000000..389e9ef --- /dev/null +++ b/cmd/query/check_test.go @@ -0,0 +1,92 @@ +package query + +import ( + "context" + "errors" + "testing" + + "github.com/golang/mock/gomock" + mock_client "github.com/openfga/cli/mocks" + openfga "github.com/openfga/go-sdk" + "github.com/openfga/go-sdk/client" +) + +var errMockCheck = errors.New("mock error") + +func TestCheckWithError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientCheckRequestInterface(mockCtrl) + + var expectedResponse client.ClientCheckResponse + + mockExecute.EXPECT().Execute().Return(&expectedResponse, errMockCheck) + + mockRequest := mock_client.NewMockSdkClientCheckRequestInterface(mockCtrl) + options := client.ClientCheckOptions{} + mockRequest.EXPECT().Options(options).Return(mockExecute) + + mockBody := mock_client.NewMockSdkClientCheckRequestInterface(mockCtrl) + + body := client.ClientCheckRequest{ + User: "user:foo", + Relation: "writer", + Object: "doc:doc1", + } + mockBody.EXPECT().Body(body).Return(mockRequest) + + mockFgaClient.EXPECT().Check(context.Background()).Return(mockBody) + + _, err := check(mockFgaClient, "user:foo", "writer", "doc:doc1") + if err == nil { + t.Error("Expect error but there is none") + } +} + +func TestCheckWithNoError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientCheckRequestInterface(mockCtrl) + + expectedResponse := client.ClientCheckResponse{ + CheckResponse: openfga.CheckResponse{ + Allowed: openfga.PtrBool(true), + }, + HttpResponse: nil, + } + + mockExecute.EXPECT().Execute().Return(&expectedResponse, nil) + + mockRequest := mock_client.NewMockSdkClientCheckRequestInterface(mockCtrl) + options := client.ClientCheckOptions{} + mockRequest.EXPECT().Options(options).Return(mockExecute) + + mockBody := mock_client.NewMockSdkClientCheckRequestInterface(mockCtrl) + + body := client.ClientCheckRequest{ + User: "user:foo", + Relation: "writer", + Object: "doc:doc1", + } + mockBody.EXPECT().Body(body).Return(mockRequest) + + mockFgaClient.EXPECT().Check(context.Background()).Return(mockBody) + + output, err := check(mockFgaClient, "user:foo", "writer", "doc:doc1") + if err != nil { + t.Error(err) + } + + expectedOutput := `{"allowed":true}` + if output != expectedOutput { + t.Errorf("Expected output %v actual %v", expectedOutput, output) + } +} diff --git a/cmd/query/expand.go b/cmd/query/expand.go index 0cf7a35..cbf6575 100644 --- a/cmd/query/expand.go +++ b/cmd/query/expand.go @@ -19,42 +19,59 @@ import ( "context" "encoding/json" "fmt" - "os" "github.com/openfga/cli/lib/cmd-utils" "github.com/openfga/go-sdk/client" "github.com/spf13/cobra" ) +func expand(fgaClient client.SdkClient, relation string, object string) (string, error) { + body := &client.ClientExpandRequest{ + Relation: relation, + Object: object, + } + + tuples, err := fgaClient.Expand(context.Background()).Body(*body).Execute() + if err != nil { + fmt.Printf("Failed to expand tuples due to %v", err) + + return "", fmt.Errorf("failed to expand tuples due to %w", err) + } + + tuplesJSON, err := json.Marshal(tuples) + if err != nil { + fmt.Printf("Failed to expand tuples due to %v", err) + + return "", fmt.Errorf("failed to expand tuples due to %w", err) + } + + return string(tuplesJSON), nil +} + // expandCmd represents the expand command. var expandCmd = &cobra.Command{ Use: "expand", Short: "Expand", Long: "Expands the relationships in userset tree format.", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) + fgaClient, err := clientConfig.GetFgaClient() if err != nil { fmt.Printf("Failed to initialize FGA Client due to %v", err) - os.Exit(1) - } - body := &client.ClientExpandRequest{ - Relation: args[0], - Object: args[1], - } - tuples, err := fgaClient.Expand(context.Background()).Body(*body).Execute() - if err != nil { - fmt.Printf("Failed to expand tuples due to %v", err) - os.Exit(1) + + return fmt.Errorf("failed to initialize FGA Client due to %w", err) } - tuplesJSON, err := json.Marshal(tuples) + output, err := expand(fgaClient, args[0], args[1]) if err != nil { - fmt.Printf("Failed to expand tuples due to %v", err) - os.Exit(1) + return err } - fmt.Print(string(tuplesJSON)) + + fmt.Print(output) + + return nil }, } diff --git a/cmd/query/expand_test.go b/cmd/query/expand_test.go new file mode 100644 index 0000000..4da7b7c --- /dev/null +++ b/cmd/query/expand_test.go @@ -0,0 +1,87 @@ +package query + +import ( + "context" + "encoding/json" + "errors" + "reflect" + "testing" + + "github.com/golang/mock/gomock" + mock_client "github.com/openfga/cli/mocks" + "github.com/openfga/go-sdk/client" +) + +var errMockExpand = errors.New("mock error") + +func TestExpandWithError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientExpandRequestInterface(mockCtrl) + + var expectedResponse client.ClientExpandResponse + + mockExecute.EXPECT().Execute().Return(&expectedResponse, errMockExpand) + + mockBody := mock_client.NewMockSdkClientExpandRequestInterface(mockCtrl) + + body := client.ClientExpandRequest{ + Relation: "writer", + Object: "doc:doc1", + } + mockBody.EXPECT().Body(body).Return(mockExecute) + + mockFgaClient.EXPECT().Expand(context.Background()).Return(mockBody) + + _, err := expand(mockFgaClient, "writer", "doc:doc1") + if err == nil { + t.Error("Expect error but there is none") + } +} + +func TestExpandWithNoError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientExpandRequestInterface(mockCtrl) + + expandResponseTxt := `{"tree":{"root":{"name":"document:roadmap#viewer","union":{"nodes":[{"name": "document:roadmap#viewer","leaf":{"users":{"users":["user:81684243-9356-4421-8fbf-a4f8d36aa31b"]}}}]}}}}` //nolint:all + + expectedResponse := client.ClientExpandResponse{} + if err := json.Unmarshal([]byte(expandResponseTxt), &expectedResponse); err != nil { + t.Fatalf("%v", err) + } + + mockExecute.EXPECT().Execute().Return(&expectedResponse, nil) + + mockBody := mock_client.NewMockSdkClientExpandRequestInterface(mockCtrl) + + body := client.ClientExpandRequest{ + Relation: "writer", + Object: "doc:doc1", + } + mockBody.EXPECT().Body(body).Return(mockExecute) + + mockFgaClient.EXPECT().Expand(context.Background()).Return(mockBody) + + output, err := expand(mockFgaClient, "writer", "doc:doc1") + if err != nil { + t.Error(err) + } + + outputResponse := client.ClientExpandResponse{} + if err := json.Unmarshal([]byte(output), &outputResponse); err != nil { + t.Errorf("%v", err) + } + + if !(reflect.DeepEqual(outputResponse, expectedResponse)) { + t.Errorf("Expect output response %v actual response %v", expandResponseTxt, output) + } +} diff --git a/cmd/query/list-objects.go b/cmd/query/list-objects.go index fb28769..bb9c3b5 100644 --- a/cmd/query/list-objects.go +++ b/cmd/query/list-objects.go @@ -19,45 +19,62 @@ import ( "context" "encoding/json" "fmt" - "os" "github.com/openfga/cli/lib/cmd-utils" "github.com/openfga/go-sdk/client" "github.com/spf13/cobra" ) +// listObjects in the internal function for calling SDK for list objects. +func listObjects(fgaClient client.SdkClient, user string, relation string, types string) (string, error) { + body := &client.ClientListObjectsRequest{ + User: user, + Relation: relation, + Type: types, + } + options := &client.ClientListObjectsOptions{} + + response, err := fgaClient.ListObjects(context.Background()).Body(*body).Options(*options).Execute() + if err != nil { + fmt.Printf("Failed to list objects due to %v", err) + + return "", fmt.Errorf("failed to list objects due to %w", err) + } + + responseJSON, err := json.Marshal(response) + if err != nil { + fmt.Printf("Failed to list objects due to %v", err) + + return "", fmt.Errorf("failed to list objects due to %w", err) + } + + return string(responseJSON), nil +} + // listObjectsCmd represents the listObjects command. var listObjectsCmd = &cobra.Command{ Use: "list-objects", Short: "List Objects", Long: "List the relations a user has with an object.", Args: cobra.ExactArgs(3), //nolint:gomnd - Run: func(cmd *cobra.Command, args []string) { + RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) + fgaClient, err := clientConfig.GetFgaClient() if err != nil { fmt.Printf("Failed to initialize FGA Client due to %v", err) - os.Exit(1) - } - body := &client.ClientListObjectsRequest{ - User: args[0], - Relation: args[1], - Type: args[2], - } - options := &client.ClientListObjectsOptions{} - response, err := fgaClient.ListObjects(context.Background()).Body(*body).Options(*options).Execute() - if err != nil { - fmt.Printf("Failed to list objects due to %v", err) - os.Exit(1) + return fmt.Errorf("failed to initialize FGA Client due to %w", err) } - responseJSON, err := json.Marshal(response) + output, err := listObjects(fgaClient, args[0], args[1], args[2]) if err != nil { - fmt.Printf("Failed to list objects due to %v", err) - os.Exit(1) + return err } - fmt.Print(string(responseJSON)) + + fmt.Print(output) + + return nil }, } diff --git a/cmd/query/list-objects_test.go b/cmd/query/list-objects_test.go new file mode 100644 index 0000000..b9b7a9f --- /dev/null +++ b/cmd/query/list-objects_test.go @@ -0,0 +1,88 @@ +package query + +import ( + "context" + "errors" + "testing" + + "github.com/golang/mock/gomock" + mock_client "github.com/openfga/cli/mocks" + "github.com/openfga/go-sdk/client" +) + +var errMockListObjects = errors.New("mock error") + +func TestListObjectsWithError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientListObjectsRequestInterface(mockCtrl) + + var expectedResponse client.ClientListObjectsResponse + + mockExecute.EXPECT().Execute().Return(&expectedResponse, errMockListObjects) + + mockRequest := mock_client.NewMockSdkClientListObjectsRequestInterface(mockCtrl) + options := client.ClientListObjectsOptions{} + mockRequest.EXPECT().Options(options).Return(mockExecute) + + mockBody := mock_client.NewMockSdkClientListObjectsRequestInterface(mockCtrl) + + body := client.ClientListObjectsRequest{ + User: "user:foo", + Relation: "writer", + Type: "doc", + } + mockBody.EXPECT().Body(body).Return(mockRequest) + + mockFgaClient.EXPECT().ListObjects(context.Background()).Return(mockBody) + + _, err := listObjects(mockFgaClient, "user:foo", "writer", "doc") + if err == nil { + t.Error("Expect error but there is none") + } +} + +func TestListObjectsWithNoError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientListObjectsRequestInterface(mockCtrl) + + expectedResponse := client.ClientListObjectsResponse{ + Objects: &[]string{"doc:doc1", "doc:doc2"}, + } + + mockExecute.EXPECT().Execute().Return(&expectedResponse, nil) + + mockRequest := mock_client.NewMockSdkClientListObjectsRequestInterface(mockCtrl) + options := client.ClientListObjectsOptions{} + mockRequest.EXPECT().Options(options).Return(mockExecute) + + mockBody := mock_client.NewMockSdkClientListObjectsRequestInterface(mockCtrl) + + body := client.ClientListObjectsRequest{ + User: "user:foo", + Relation: "writer", + Type: "doc", + } + mockBody.EXPECT().Body(body).Return(mockRequest) + + mockFgaClient.EXPECT().ListObjects(context.Background()).Return(mockBody) + + output, err := listObjects(mockFgaClient, "user:foo", "writer", "doc") + if err != nil { + t.Error(err) + } + + expectedOutput := "{\"objects\":[\"doc:doc1\",\"doc:doc2\"]}" + if output != expectedOutput { + t.Errorf("Expect %v but actual %v", expectedOutput, output) + } +} diff --git a/cmd/query/list-relations.go b/cmd/query/list-relations.go index 057e1b7..aedea47 100644 --- a/cmd/query/list-relations.go +++ b/cmd/query/list-relations.go @@ -19,78 +19,106 @@ import ( "context" "encoding/json" "fmt" - "os" "strings" "github.com/openfga/cli/lib/cmd-utils" + "github.com/openfga/cli/lib/fga" openfga "github.com/openfga/go-sdk" "github.com/openfga/go-sdk/client" "github.com/spf13/cobra" ) +func listRelations(clientConfig fga.ClientConfig, + fgaClient client.SdkClient, + user string, + objects string, +) (string, error) { + var authorizationModel openfga.AuthorizationModel + + if clientConfig.AuthorizationModelID != "" { + // note that the auth model id is already configured in the fgaClient. + response, err := fgaClient.ReadAuthorizationModel(context.Background()).Execute() + if err != nil { + fmt.Printf("Failed to list relations due to %v", err) + + return "", fmt.Errorf("failed to list relations due to %w", err) + } + + authorizationModel = *response.AuthorizationModel + } else { + response, err := fgaClient.ReadLatestAuthorizationModel(context.Background()).Execute() + if err != nil { + fmt.Printf("Failed to list relations due to %v", err) + + return "", fmt.Errorf("failed to list relations due to %w", err) + } + + authorizationModel = *response.AuthorizationModel + } + + typeDefs := *(authorizationModel.TypeDefinitions) + objectType := strings.Split(objects, ":")[0] + + var relations []string + + for index := range typeDefs { + if typeDefs[index].Type == objectType { + typeDef := typeDefs[index] + for relation := range *typeDef.Relations { + relations = append(relations, relation) + } + + break + } + } + + body := &client.ClientListRelationsRequest{ + User: user, + Object: objects, + Relations: relations, + } + options := &client.ClientListRelationsOptions{} + + response, err := fgaClient.ListRelations(context.Background()).Body(*body).Options(*options).Execute() + if err != nil { + fmt.Printf("Failed to list relations due to %v", err) + + return "", fmt.Errorf("failed to list relations due to %w", err) + } + + responseJSON, err := json.Marshal(response) + if err != nil { + fmt.Printf("Failed to list relations due to %v", err) + + return "", fmt.Errorf("failed to list relations due to %w", err) + } + + return string(responseJSON), nil +} + // listRelationsCmd represents the listRelations command. var listRelationsCmd = &cobra.Command{ Use: "list-relations", Short: "List Relations", Long: "ListRelations if a user has a particular relation with an object.", Args: cobra.ExactArgs(2), //nolint:gomnd - Run: func(cmd *cobra.Command, args []string) { + RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) fgaClient, err := clientConfig.GetFgaClient() if err != nil { fmt.Printf("Failed to initialize FGA Client due to %v", err) - os.Exit(1) - } - var authorizationModel openfga.AuthorizationModel - if clientConfig.AuthorizationModelID != "" { - response, err := fgaClient.ReadAuthorizationModel(context.Background()).Execute() - if err != nil { - fmt.Printf("Failed to list relations due to %v", err) - os.Exit(1) - } - authorizationModel = *response.AuthorizationModel - } else { - response, err := fgaClient.ReadLatestAuthorizationModel(context.Background()).Execute() - if err != nil { - fmt.Printf("Failed to list relations due to %v", err) - os.Exit(1) - } - authorizationModel = *response.AuthorizationModel - } - typeDefs := *(authorizationModel.TypeDefinitions) - objectType := strings.Split(args[1], ":")[0] - var relations []string - - for index := range typeDefs { - if typeDefs[index].Type == objectType { - typeDef := typeDefs[index] - for relation := range *typeDef.Relations { - relations = append(relations, relation) - } - - break - } + return fmt.Errorf("failed to initialize FGA Client due to %w", err) } - body := &client.ClientListRelationsRequest{ - User: args[0], - Object: args[1], - Relations: relations, - } - options := &client.ClientListRelationsOptions{} - response, err := fgaClient.ListRelations(context.Background()).Body(*body).Options(*options).Execute() + output, err := listRelations(clientConfig, fgaClient, args[0], args[1]) if err != nil { - fmt.Printf("Failed to list relations due to %v", err) - os.Exit(1) + return err } - responseJSON, err := json.Marshal(response) - if err != nil { - fmt.Printf("Failed to list relations due to %v", err) - os.Exit(1) - } - fmt.Print(string(responseJSON)) + fmt.Print(output) + + return nil }, } diff --git a/cmd/query/list-relations_test.go b/cmd/query/list-relations_test.go new file mode 100644 index 0000000..a6c5423 --- /dev/null +++ b/cmd/query/list-relations_test.go @@ -0,0 +1,172 @@ +package query + +import ( + "context" + "encoding/json" + "errors" + "testing" + + "github.com/golang/mock/gomock" + "github.com/openfga/cli/lib/fga" + mock_client "github.com/openfga/cli/mocks" + "github.com/openfga/go-sdk/client" +) + +var errMockGet = errors.New("mock get model error") + +var errMockListRelations = errors.New("mock error") + +func TestListRelationsLatestAuthModelError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientReadLatestAuthorizationModelRequestInterface(mockCtrl) + + var expectedResponse client.ClientReadAuthorizationModelResponse + + mockExecute.EXPECT().Execute().Return(&expectedResponse, errMockGet) + mockFgaClient.EXPECT().ReadLatestAuthorizationModel(context.Background()).Return(mockExecute) + + var clientConfig fga.ClientConfig + + _, err := listRelations(clientConfig, mockFgaClient, "user:foo", "doc:doc1") + if err == nil { + t.Error("Expect error but there is none") + } +} + +func TestListRelationsAuthModelSpecifiedError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientReadAuthorizationModelRequestInterface(mockCtrl) + + var expectedResponse client.ClientReadAuthorizationModelResponse + + mockExecute.EXPECT().Execute().Return(&expectedResponse, errMockGet) + mockFgaClient.EXPECT().ReadAuthorizationModel(context.Background()).Return(mockExecute) + + clientConfig := fga.ClientConfig{ + AuthorizationModelID: "01GXSA8YR785C4FYS3C0RTG7B1", + } + + _, err := listRelations(clientConfig, mockFgaClient, "user:foo", "doc:doc1") + if err == nil { + t.Error("Expect error but there is none") + } +} + +func TestListRelationsLatestAuthModelListError(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientReadLatestAuthorizationModelRequestInterface(mockCtrl) + + var expectedResponse client.ClientReadAuthorizationModelResponse + + modelJSON := `{"authorization_model":{"id":"01GXSA8YR785C4FYS3C0RTG7B1","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"doc"}]}}` //nolint:all + if err := json.Unmarshal([]byte(modelJSON), &expectedResponse); err != nil { + t.Fatalf("%v", err) + } + + mockExecute.EXPECT().Execute().Return(&expectedResponse, nil) + + // after reading the latest auth model, expect to call list relations but failure + + mockListRelationsExecute := mock_client.NewMockSdkClientListRelationsRequestInterface(mockCtrl) + + var expectedListRelationsResponse client.ClientListRelationsResponse + + mockListRelationsExecute.EXPECT().Execute().Return(&expectedListRelationsResponse, errMockListRelations) + + mockListRelationsRequest := mock_client.NewMockSdkClientListRelationsRequestInterface(mockCtrl) + listRelationsOptions := client.ClientListRelationsOptions{} + mockListRelationsRequest.EXPECT().Options(listRelationsOptions).Return(mockListRelationsExecute) + + mockBody := mock_client.NewMockSdkClientListRelationsRequestInterface(mockCtrl) + + body := client.ClientListRelationsRequest{ + User: "user:foo", + Relations: []string{"viewer"}, + Object: "doc:doc1", + } + mockBody.EXPECT().Body(body).Return(mockListRelationsRequest) + gomock.InOrder( + mockFgaClient.EXPECT().ReadLatestAuthorizationModel(context.Background()).Return(mockExecute), + mockFgaClient.EXPECT().ListRelations(context.Background()).Return(mockBody), + ) + + var clientConfig fga.ClientConfig + + _, err := listRelations(clientConfig, mockFgaClient, "user:foo", "doc:doc1") + if err == nil { + t.Error("Expect error but there is none") + } +} + +func TestListRelationsLatestAuthModelList(t *testing.T) { + t.Parallel() + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + mockFgaClient := mock_client.NewMockSdkClient(mockCtrl) + + mockExecute := mock_client.NewMockSdkClientReadLatestAuthorizationModelRequestInterface(mockCtrl) + + var expectedResponse client.ClientReadAuthorizationModelResponse + + modelJSON := `{"authorization_model":{"id":"01GXSA8YR785C4FYS3C0RTG7B1","schema_version":"1.1","type_definitions":[{"relations":{"viewer":{"this":{}}},"type":"doc"}]}}` //nolint:all + if err := json.Unmarshal([]byte(modelJSON), &expectedResponse); err != nil { + t.Fatalf("%v", err) + } + + mockExecute.EXPECT().Execute().Return(&expectedResponse, nil) + + // after reading the latest auth model, expect to call list relations but failure + + mockListRelationsExecute := mock_client.NewMockSdkClientListRelationsRequestInterface(mockCtrl) + + expectedListRelationsResponse := client.ClientListRelationsResponse{ + Relations: []string{"viewer"}, + } + + mockListRelationsExecute.EXPECT().Execute().Return(&expectedListRelationsResponse, nil) + + mockListRelationsRequest := mock_client.NewMockSdkClientListRelationsRequestInterface(mockCtrl) + listRelationsOptions := client.ClientListRelationsOptions{} + mockListRelationsRequest.EXPECT().Options(listRelationsOptions).Return(mockListRelationsExecute) + + mockBody := mock_client.NewMockSdkClientListRelationsRequestInterface(mockCtrl) + + body := client.ClientListRelationsRequest{ + User: "user:foo", + Relations: []string{"viewer"}, + Object: "doc:doc1", + } + mockBody.EXPECT().Body(body).Return(mockListRelationsRequest) + gomock.InOrder( + mockFgaClient.EXPECT().ReadLatestAuthorizationModel(context.Background()).Return(mockExecute), + mockFgaClient.EXPECT().ListRelations(context.Background()).Return(mockBody), + ) + + var clientConfig fga.ClientConfig + + output, err := listRelations(clientConfig, mockFgaClient, "user:foo", "doc:doc1") + if err != nil { + t.Error(err) + } + + expectedOutput := "{\"relations\":[\"viewer\"]}" + if output != expectedOutput { + t.Errorf("Expect output %v actual %v", expectedOutput, output) + } +} From 9e766aee6fd9922750c550e6d30bec141ae7ef58 Mon Sep 17 00:00:00 2001 From: Adrian Tam Date: Fri, 30 Jun 2023 11:06:18 -0400 Subject: [PATCH 3/3] fix: update based on code review feedback --- cmd/models/get.go | 6 ------ cmd/models/list.go | 10 +--------- cmd/models/write.go | 8 -------- cmd/query/check.go | 6 ------ cmd/query/expand.go | 6 ------ cmd/query/list-objects.go | 6 ------ cmd/query/list-relations.go | 8 -------- 7 files changed, 1 insertion(+), 49 deletions(-) diff --git a/cmd/models/get.go b/cmd/models/get.go index ca6da57..be037b7 100644 --- a/cmd/models/get.go +++ b/cmd/models/get.go @@ -45,15 +45,11 @@ func getModel(clientConfig fga.ClientConfig, fgaClient client.SdkClient) (string } if err != nil { - fmt.Printf("Failed to get model %v due to %v", clientConfig.AuthorizationModelID, err) - return "", fmt.Errorf("failed to get model %v due to %w", clientConfig.AuthorizationModelID, err) } modelJSON, err := json.Marshal(model) if err != nil { - fmt.Printf("Failed to get model due to %v", err) - return "", fmt.Errorf("failed to get model due to %w", err) } @@ -69,8 +65,6 @@ var getCmd = &cobra.Command{ fgaClient, err := clientConfig.GetFgaClient() if err != nil { - fmt.Printf("Failed to initialize FGA Client due to %v", err) - return fmt.Errorf("failed to initialize FGA Client due to %w", err) } output, err := getModel(clientConfig, fgaClient) diff --git a/cmd/models/list.go b/cmd/models/list.go index 6274645..fb92cc2 100644 --- a/cmd/models/list.go +++ b/cmd/models/list.go @@ -44,9 +44,7 @@ func listModels(fgaClient client.SdkClient, maxPages int) (string, error) { response, err := fgaClient.ReadAuthorizationModels(context.Background()).Options(options).Execute() if err != nil { - fmt.Printf("XXX Failed to list models due to %v", err) - - return "", fmt.Errorf("xxx failed to list models due to %w", err) + return "", fmt.Errorf("failed to list models due to %w", err) } models = append(models, *response.AuthorizationModels...) @@ -62,8 +60,6 @@ func listModels(fgaClient client.SdkClient, maxPages int) (string, error) { modelsJSON, err := json.Marshal(openfga.ReadAuthorizationModelsResponse{AuthorizationModels: &models}) if err != nil { - fmt.Printf("Failed to marshal listed models due to %v", err) - return "", fmt.Errorf("failed to marshal listed models due to %w", err) } @@ -78,14 +74,10 @@ var listCmd = &cobra.Command{ clientConfig := cmdutils.GetClientConfig(cmd) fgaClient, err := clientConfig.GetFgaClient() if err != nil { - fmt.Printf("Failed to initialize FGA Client due to %v", err) - return fmt.Errorf("failed to intialized FGA client due to %w", err) } maxPages, err := cmd.Flags().GetInt("max-pages") if err != nil { - fmt.Printf("Failed to list models due to %v", err) - return fmt.Errorf("failed to list models due to %w", err) } output, err := listModels(fgaClient, maxPages) diff --git a/cmd/models/write.go b/cmd/models/write.go index 0c74b30..130758b 100644 --- a/cmd/models/write.go +++ b/cmd/models/write.go @@ -30,22 +30,16 @@ func write(fgaClient client.SdkClient, text string) (string, error) { err := json.Unmarshal([]byte(text), &body) if err != nil { - fmt.Printf("Failed to parse model due to %v", err) - return "", fmt.Errorf("failed to parse model due to %w", err) } model, err := fgaClient.WriteAuthorizationModel(context.Background()).Body(*body).Execute() if err != nil { - fmt.Printf("Failed to write model due to %v", err) - return "", fmt.Errorf("failed to write model due to %w", err) } modelJSON, err := json.Marshal(model) if err != nil { - fmt.Printf("Failed to write model due to %v", err) - return "", fmt.Errorf("failed to write model due to %w", err) } @@ -62,8 +56,6 @@ var writeCmd = &cobra.Command{ fgaClient, err := clientConfig.GetFgaClient() if err != nil { - fmt.Printf("Failed to initialize FGA Client due to %v", err) - return fmt.Errorf("failed to initialize FGA Client due to %w", err) } diff --git a/cmd/query/check.go b/cmd/query/check.go index e021862..a046f11 100644 --- a/cmd/query/check.go +++ b/cmd/query/check.go @@ -35,15 +35,11 @@ func check(fgaClient client.SdkClient, user string, relation string, object stri response, err := fgaClient.Check(context.Background()).Body(*body).Options(*options).Execute() if err != nil { - fmt.Printf("Failed to check due to %v", err) - return "", fmt.Errorf("failed to check due to %w", err) } responseJSON, err := json.Marshal(response) if err != nil { - fmt.Printf("Failed to check due to %v", err) - return "", fmt.Errorf("failed to check due to %w", err) } @@ -60,8 +56,6 @@ var checkCmd = &cobra.Command{ clientConfig := cmdutils.GetClientConfig(cmd) fgaClient, err := clientConfig.GetFgaClient() if err != nil { - fmt.Printf("Failed to initialize FGA Client due to %v", err) - return fmt.Errorf("failed to initialize FGA Client due to %w", err) } diff --git a/cmd/query/expand.go b/cmd/query/expand.go index cbf6575..e9e572d 100644 --- a/cmd/query/expand.go +++ b/cmd/query/expand.go @@ -33,15 +33,11 @@ func expand(fgaClient client.SdkClient, relation string, object string) (string, tuples, err := fgaClient.Expand(context.Background()).Body(*body).Execute() if err != nil { - fmt.Printf("Failed to expand tuples due to %v", err) - return "", fmt.Errorf("failed to expand tuples due to %w", err) } tuplesJSON, err := json.Marshal(tuples) if err != nil { - fmt.Printf("Failed to expand tuples due to %v", err) - return "", fmt.Errorf("failed to expand tuples due to %w", err) } @@ -59,8 +55,6 @@ var expandCmd = &cobra.Command{ fgaClient, err := clientConfig.GetFgaClient() if err != nil { - fmt.Printf("Failed to initialize FGA Client due to %v", err) - return fmt.Errorf("failed to initialize FGA Client due to %w", err) } diff --git a/cmd/query/list-objects.go b/cmd/query/list-objects.go index bb9c3b5..8c198fe 100644 --- a/cmd/query/list-objects.go +++ b/cmd/query/list-objects.go @@ -36,15 +36,11 @@ func listObjects(fgaClient client.SdkClient, user string, relation string, types response, err := fgaClient.ListObjects(context.Background()).Body(*body).Options(*options).Execute() if err != nil { - fmt.Printf("Failed to list objects due to %v", err) - return "", fmt.Errorf("failed to list objects due to %w", err) } responseJSON, err := json.Marshal(response) if err != nil { - fmt.Printf("Failed to list objects due to %v", err) - return "", fmt.Errorf("failed to list objects due to %w", err) } @@ -62,8 +58,6 @@ var listObjectsCmd = &cobra.Command{ fgaClient, err := clientConfig.GetFgaClient() if err != nil { - fmt.Printf("Failed to initialize FGA Client due to %v", err) - return fmt.Errorf("failed to initialize FGA Client due to %w", err) } diff --git a/cmd/query/list-relations.go b/cmd/query/list-relations.go index aedea47..4c71d70 100644 --- a/cmd/query/list-relations.go +++ b/cmd/query/list-relations.go @@ -39,8 +39,6 @@ func listRelations(clientConfig fga.ClientConfig, // note that the auth model id is already configured in the fgaClient. response, err := fgaClient.ReadAuthorizationModel(context.Background()).Execute() if err != nil { - fmt.Printf("Failed to list relations due to %v", err) - return "", fmt.Errorf("failed to list relations due to %w", err) } @@ -48,8 +46,6 @@ func listRelations(clientConfig fga.ClientConfig, } else { response, err := fgaClient.ReadLatestAuthorizationModel(context.Background()).Execute() if err != nil { - fmt.Printf("Failed to list relations due to %v", err) - return "", fmt.Errorf("failed to list relations due to %w", err) } @@ -81,15 +77,11 @@ func listRelations(clientConfig fga.ClientConfig, response, err := fgaClient.ListRelations(context.Background()).Body(*body).Options(*options).Execute() if err != nil { - fmt.Printf("Failed to list relations due to %v", err) - return "", fmt.Errorf("failed to list relations due to %w", err) } responseJSON, err := json.Marshal(response) if err != nil { - fmt.Printf("Failed to list relations due to %v", err) - return "", fmt.Errorf("failed to list relations due to %w", err) }