diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index bba9504f1..0aa4b1028 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -d38528c3e47dd81c9bdbd918272a3e49d36e09ce \ No newline at end of file +94684175b8bd65f8701f89729351f8069e8309c9 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 2f3ecc4e4..c72fec086 100644 --- a/.gitattributes +++ b/.gitattributes @@ -52,6 +52,18 @@ experimental/mocks/service/iam/mock_service_principals_interface.go linguist-gen experimental/mocks/service/iam/mock_users_interface.go linguist-generated=true experimental/mocks/service/iam/mock_workspace_assignment_interface.go linguist-generated=true experimental/mocks/service/jobs/mock_jobs_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_consumer_fulfillments_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_consumer_installations_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_consumer_listings_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_consumer_personalization_requests_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_consumer_providers_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_provider_exchange_filters_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_provider_exchanges_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_provider_files_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_provider_listings_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_provider_personalization_requests_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_provider_provider_analytics_dashboards_interface.go linguist-generated=true +experimental/mocks/service/marketplace/mock_provider_providers_interface.go linguist-generated=true experimental/mocks/service/ml/mock_experiments_interface.go linguist-generated=true experimental/mocks/service/ml/mock_model_registry_interface.go linguist-generated=true experimental/mocks/service/oauth2/mock_custom_app_integration_interface.go linguist-generated=true @@ -163,6 +175,10 @@ service/jobs/impl.go linguist-generated=true service/jobs/interface.go linguist-generated=true service/jobs/jobs_usage_test.go linguist-generated=true service/jobs/model.go linguist-generated=true +service/marketplace/api.go linguist-generated=true +service/marketplace/impl.go linguist-generated=true +service/marketplace/interface.go linguist-generated=true +service/marketplace/model.go linguist-generated=true service/ml/api.go linguist-generated=true service/ml/experiments_usage_test.go linguist-generated=true service/ml/impl.go linguist-generated=true diff --git a/CHANGELOG.md b/CHANGELOG.md index 15c8fc8f6..fe8673c10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,99 @@ # Version changelog +## 0.38.0 + +### Behavior Changes +* Override INVALID_PARAMETER_VALUE on fetching non-existent job/cluster ([#864](https://github.com/databricks/databricks-sdk-go/pull/864)). The error returned when fetching a non-existent job or cluster has been changed from `INVALID_PARAMETER_VALUE` to `RESOURCE_DOES_NOT_EXIST`. Update your error handling code to check for `databricks.ErrResourceDoesNotExist` instead of `databricks.ErrInvalidParameterValue`. For example, if you are using the `Jobs.GetById` method, you should update your error handling code to: +```go +_, err := w.Jobs.GetById(ctx, "id") +if errors.Is(err, databricks.ErrResourceDoesNotExist) { + // handle the error +} +``` +Note that the original error code is still accessible in the `ErrorCode` field of `APIError`. + +### Other Improvements +* Do not leak secondary authorization tokens in debug logs ([#882](https://github.com/databricks/databricks-sdk-go/pull/882)). +* Fix logging of request bodies containing percent characters. ([#881](https://github.com/databricks/databricks-sdk-go/pull/881)). +* Added clientId and clientSecret to oauth-m2m auth_types ([#885](https://github.com/databricks/databricks-sdk-go/pull/885)). + +### Internal Changes +* Support custom AuthVisitors ([#874](https://github.com/databricks/databricks-sdk-go/pull/874)). + +API Changes: + + * Replaced [catalog.AzureManagedIdentity](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentity) with [catalog.AzureManagedIdentityRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityRequest) and [catalog.AzureManagedIdentityResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityResponse). + * Renamed `FullName` field to `TableName` for [catalog.CancelRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CancelRefreshRequest), [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor), [catalog.DeleteLakehouseMonitorRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#DeleteLakehouseMonitorRequest), [catalog.GetLakehouseMonitorRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#GetLakehouseMonitorRequest), [catalog.GetRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#GetRefreshRequest), [catalog.ListRefreshesRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ListRefreshesRequest). + * Changed `CustomMetrics` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorMetricList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricList). + * Changed `InferenceLog` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). + * Changed `Notifications` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). + * Changed `Snapshot` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to `any`. + * Changed `TimeSeries` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). + * Changed `QuartzCronExpression` field for [catalog.MonitorCronSchedule](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCronSchedule) to be required. + * Changed `TimezoneId` field for [catalog.MonitorCronSchedule](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCronSchedule) to be required. + * Renamed [catalog.MonitorCustomMetric](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCustomMetric) to [catalog.MonitorMetric](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetric). + * Renamed [catalog.MonitorCustomMetricType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCustomMetricType) to [catalog.MonitorMetricType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricType). + * Renamed [catalog.MonitorDestinations](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorDestinations) to [catalog.MonitorDestination](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorDestination). + * Renamed [catalog.MonitorInferenceLogProfileType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLogProfileType) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). + * Renamed [catalog.MonitorInferenceLogProfileTypeProblemType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLogProfileTypeProblemType) to [catalog.MonitorInferenceLogProblemType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLogProblemType). + * Renamed [catalog.MonitorNotificationsConfig](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotificationsConfig) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). + * Changed `CustomMetrics` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorMetricList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricList). + * Changed `DriftMetricsTableName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. + * Changed `InferenceLog` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). + * Changed `MonitorVersion` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. + * Changed `Notifications` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). + * Changed `ProfileMetricsTableName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. + * Changed `Snapshot` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to `any`. + * Changed `Status` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. + * Changed `TableName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. + * Changed `TimeSeries` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). + * Changed `RefreshId` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo) to be required. + * Changed `StartTimeMs` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo) to be required. + * Changed `State` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo) to be required. + * Added `Trigger` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo). + * Removed [catalog.MonitorTimeSeriesProfileType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeriesProfileType). + * Removed `FullName` field for [catalog.RunRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RunRefreshRequest). + * Added `TableName` field for [catalog.RunRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RunRefreshRequest). + * Changed `AzureManagedIdentity` field for [catalog.StorageCredentialInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#StorageCredentialInfo) to . + * Removed `Name` field for [catalog.TableRowFilter](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#TableRowFilter). + * Added `FunctionName` field for [catalog.TableRowFilter](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#TableRowFilter). + * Changed `CustomMetrics` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorMetricList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricList). + * Removed `FullName` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor). + * Changed `InferenceLog` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). + * Changed `Notifications` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). + * Changed `Snapshot` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to `any`. + * Changed `TimeSeries` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). + * Added `TableName` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor). + * Changed `AzureManagedIdentity` field for [catalog.UpdateStorageCredential](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateStorageCredential) to [catalog.AzureManagedIdentityResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityResponse). + * Changed `AzureManagedIdentity` field for [catalog.ValidateStorageCredential](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidateStorageCredential) to [catalog.AzureManagedIdentityRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityRequest). + * Replaced `Operation` field for [catalog.ValidationResult](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResult) with `AwsOperation`, `AzureOperation` and `GcpOperation`. + * Replaced [catalog.ValidationResultOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultOperation) with [catalog.ValidationResultAwsOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultAwsOperation), [catalog.ValidationResultAzureOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultAzureOperation) and [catalog.ValidationResultGcpOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultGcpOperation). + * Added [catalog.MonitorRefreshInfoTrigger](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfoTrigger). + * Added [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). + * Removed [compute.ComputeSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ComputeSpec). + * Removed [compute.ComputeSpecKind](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ComputeSpecKind). + * Added `CloneFrom` field to [compute.CreateCluster](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#CreateCluster), [compute.ClusterSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ClusterSpec), and [compute.EditCluster](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#EditCluster). + * Added [compute.CloneCluster](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#CloneCluster). + * Added [compute.Environment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#Environment). + * Changed `Update` method for [a.WorkspaceAssignment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#WorkspaceAssignmentAPI) account-level service to return [iam.PermissionAssignment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#PermissionAssignment). + * Removed `ComputeKey` field for [jobs.ClusterSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#ClusterSpec). + * Removed `Compute` field for [jobs.CreateJob](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#CreateJob). + * Added `Environments` field for [jobs.CreateJob](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#CreateJob). + * Removed [jobs.JobCompute](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobCompute). + * Removed `Compute` field for [jobs.JobSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobSettings). + * Added `Environments` field for [jobs.JobSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobSettings). + * Removed `ComputeKey` field for [jobs.RunTask](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunTask). + * Removed [jobs.TableTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableTriggerConfiguration). + * Removed `ComputeKey` field for [jobs.Task](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Task). + * Added `EnvironmentKey` field for [jobs.Task](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Task). + * Changed `Table` field for [jobs.TriggerSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TriggerSettings) to [jobs.TableUpdateTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableUpdateTriggerConfiguration). + * Changed `TableUpdate` field for [jobs.TriggerSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TriggerSettings) to [jobs.TableUpdateTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableUpdateTriggerConfiguration). + * Added [jobs.JobEnvironment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobEnvironment). + * Added [jobs.TableUpdateTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableUpdateTriggerConfiguration). + * Added [marketplace](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/marketplace) package. + +OpenAPI SHA: 94684175b8bd65f8701f89729351f8069e8309c9, Date: 2024-04-11 + ## ## 0.37.0 ### Other Changes diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index 276b58576..3772ab5dc 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -14,6 +14,7 @@ import ( "github.com/databricks/databricks-sdk-go/experimental/mocks/service/files" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/iam" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/jobs" + "github.com/databricks/databricks-sdk-go/experimental/mocks/service/marketplace" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/ml" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/pipelines" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/serving" @@ -38,75 +39,87 @@ func NewMockWorkspaceClient(t interface { WorkspaceClient: &databricks.WorkspaceClient{ Config: nil, - AccountAccessControlProxy: iam.NewMockAccountAccessControlProxyInterface(t), - Alerts: sql.NewMockAlertsInterface(t), - Apps: serving.NewMockAppsInterface(t), - ArtifactAllowlists: catalog.NewMockArtifactAllowlistsInterface(t), - Catalogs: catalog.NewMockCatalogsInterface(t), - CleanRooms: sharing.NewMockCleanRoomsInterface(t), - ClusterPolicies: compute.NewMockClusterPoliciesInterface(t), - Clusters: compute.NewMockClustersInterface(t), - CommandExecution: compute.NewMockCommandExecutionInterface(t), - Connections: catalog.NewMockConnectionsInterface(t), - CredentialsManager: settings.NewMockCredentialsManagerInterface(t), - CurrentUser: iam.NewMockCurrentUserInterface(t), - DashboardWidgets: sql.NewMockDashboardWidgetsInterface(t), - Dashboards: sql.NewMockDashboardsInterface(t), - DataSources: sql.NewMockDataSourcesInterface(t), - Dbfs: files.NewMockDbfsInterface(t), - DbsqlPermissions: sql.NewMockDbsqlPermissionsInterface(t), - Experiments: ml.NewMockExperimentsInterface(t), - ExternalLocations: catalog.NewMockExternalLocationsInterface(t), - Files: files.NewMockFilesInterface(t), - Functions: catalog.NewMockFunctionsInterface(t), - GitCredentials: workspace.NewMockGitCredentialsInterface(t), - GlobalInitScripts: compute.NewMockGlobalInitScriptsInterface(t), - Grants: catalog.NewMockGrantsInterface(t), - Groups: iam.NewMockGroupsInterface(t), - InstancePools: compute.NewMockInstancePoolsInterface(t), - InstanceProfiles: compute.NewMockInstanceProfilesInterface(t), - IpAccessLists: settings.NewMockIpAccessListsInterface(t), - Jobs: jobs.NewMockJobsInterface(t), - LakehouseMonitors: catalog.NewMockLakehouseMonitorsInterface(t), - Lakeview: dashboards.NewMockLakeviewInterface(t), - Libraries: compute.NewMockLibrariesInterface(t), - Metastores: catalog.NewMockMetastoresInterface(t), - ModelRegistry: ml.NewMockModelRegistryInterface(t), - ModelVersions: catalog.NewMockModelVersionsInterface(t), - OnlineTables: catalog.NewMockOnlineTablesInterface(t), - PermissionMigration: iam.NewMockPermissionMigrationInterface(t), - Permissions: iam.NewMockPermissionsInterface(t), - Pipelines: pipelines.NewMockPipelinesInterface(t), - PolicyFamilies: compute.NewMockPolicyFamiliesInterface(t), - Providers: sharing.NewMockProvidersInterface(t), - Queries: sql.NewMockQueriesInterface(t), - QueryHistory: sql.NewMockQueryHistoryInterface(t), - QueryVisualizations: sql.NewMockQueryVisualizationsInterface(t), - RecipientActivation: sharing.NewMockRecipientActivationInterface(t), - Recipients: sharing.NewMockRecipientsInterface(t), - RegisteredModels: catalog.NewMockRegisteredModelsInterface(t), - Repos: workspace.NewMockReposInterface(t), - Schemas: catalog.NewMockSchemasInterface(t), - Secrets: workspace.NewMockSecretsInterface(t), - ServicePrincipals: iam.NewMockServicePrincipalsInterface(t), - ServingEndpoints: serving.NewMockServingEndpointsInterface(t), - Settings: settings.NewMockSettingsInterface(t), - Shares: sharing.NewMockSharesInterface(t), - StatementExecution: sql.NewMockStatementExecutionInterface(t), - StorageCredentials: catalog.NewMockStorageCredentialsInterface(t), - SystemSchemas: catalog.NewMockSystemSchemasInterface(t), - TableConstraints: catalog.NewMockTableConstraintsInterface(t), - Tables: catalog.NewMockTablesInterface(t), - TokenManagement: settings.NewMockTokenManagementInterface(t), - Tokens: settings.NewMockTokensInterface(t), - Users: iam.NewMockUsersInterface(t), - VectorSearchEndpoints: vectorsearch.NewMockVectorSearchEndpointsInterface(t), - VectorSearchIndexes: vectorsearch.NewMockVectorSearchIndexesInterface(t), - Volumes: catalog.NewMockVolumesInterface(t), - Warehouses: sql.NewMockWarehousesInterface(t), - Workspace: workspace.NewMockWorkspaceInterface(t), - WorkspaceBindings: catalog.NewMockWorkspaceBindingsInterface(t), - WorkspaceConf: settings.NewMockWorkspaceConfInterface(t), + AccountAccessControlProxy: iam.NewMockAccountAccessControlProxyInterface(t), + Alerts: sql.NewMockAlertsInterface(t), + Apps: serving.NewMockAppsInterface(t), + ArtifactAllowlists: catalog.NewMockArtifactAllowlistsInterface(t), + Catalogs: catalog.NewMockCatalogsInterface(t), + CleanRooms: sharing.NewMockCleanRoomsInterface(t), + ClusterPolicies: compute.NewMockClusterPoliciesInterface(t), + Clusters: compute.NewMockClustersInterface(t), + CommandExecution: compute.NewMockCommandExecutionInterface(t), + Connections: catalog.NewMockConnectionsInterface(t), + ConsumerFulfillments: marketplace.NewMockConsumerFulfillmentsInterface(t), + ConsumerInstallations: marketplace.NewMockConsumerInstallationsInterface(t), + ConsumerListings: marketplace.NewMockConsumerListingsInterface(t), + ConsumerPersonalizationRequests: marketplace.NewMockConsumerPersonalizationRequestsInterface(t), + ConsumerProviders: marketplace.NewMockConsumerProvidersInterface(t), + CredentialsManager: settings.NewMockCredentialsManagerInterface(t), + CurrentUser: iam.NewMockCurrentUserInterface(t), + DashboardWidgets: sql.NewMockDashboardWidgetsInterface(t), + Dashboards: sql.NewMockDashboardsInterface(t), + DataSources: sql.NewMockDataSourcesInterface(t), + Dbfs: files.NewMockDbfsInterface(t), + DbsqlPermissions: sql.NewMockDbsqlPermissionsInterface(t), + Experiments: ml.NewMockExperimentsInterface(t), + ExternalLocations: catalog.NewMockExternalLocationsInterface(t), + Files: files.NewMockFilesInterface(t), + Functions: catalog.NewMockFunctionsInterface(t), + GitCredentials: workspace.NewMockGitCredentialsInterface(t), + GlobalInitScripts: compute.NewMockGlobalInitScriptsInterface(t), + Grants: catalog.NewMockGrantsInterface(t), + Groups: iam.NewMockGroupsInterface(t), + InstancePools: compute.NewMockInstancePoolsInterface(t), + InstanceProfiles: compute.NewMockInstanceProfilesInterface(t), + IpAccessLists: settings.NewMockIpAccessListsInterface(t), + Jobs: jobs.NewMockJobsInterface(t), + LakehouseMonitors: catalog.NewMockLakehouseMonitorsInterface(t), + Lakeview: dashboards.NewMockLakeviewInterface(t), + Libraries: compute.NewMockLibrariesInterface(t), + Metastores: catalog.NewMockMetastoresInterface(t), + ModelRegistry: ml.NewMockModelRegistryInterface(t), + ModelVersions: catalog.NewMockModelVersionsInterface(t), + OnlineTables: catalog.NewMockOnlineTablesInterface(t), + PermissionMigration: iam.NewMockPermissionMigrationInterface(t), + Permissions: iam.NewMockPermissionsInterface(t), + Pipelines: pipelines.NewMockPipelinesInterface(t), + PolicyFamilies: compute.NewMockPolicyFamiliesInterface(t), + ProviderExchangeFilters: marketplace.NewMockProviderExchangeFiltersInterface(t), + ProviderExchanges: marketplace.NewMockProviderExchangesInterface(t), + ProviderFiles: marketplace.NewMockProviderFilesInterface(t), + ProviderListings: marketplace.NewMockProviderListingsInterface(t), + ProviderPersonalizationRequests: marketplace.NewMockProviderPersonalizationRequestsInterface(t), + ProviderProviderAnalyticsDashboards: marketplace.NewMockProviderProviderAnalyticsDashboardsInterface(t), + ProviderProviders: marketplace.NewMockProviderProvidersInterface(t), + Providers: sharing.NewMockProvidersInterface(t), + Queries: sql.NewMockQueriesInterface(t), + QueryHistory: sql.NewMockQueryHistoryInterface(t), + QueryVisualizations: sql.NewMockQueryVisualizationsInterface(t), + RecipientActivation: sharing.NewMockRecipientActivationInterface(t), + Recipients: sharing.NewMockRecipientsInterface(t), + RegisteredModels: catalog.NewMockRegisteredModelsInterface(t), + Repos: workspace.NewMockReposInterface(t), + Schemas: catalog.NewMockSchemasInterface(t), + Secrets: workspace.NewMockSecretsInterface(t), + ServicePrincipals: iam.NewMockServicePrincipalsInterface(t), + ServingEndpoints: serving.NewMockServingEndpointsInterface(t), + Settings: settings.NewMockSettingsInterface(t), + Shares: sharing.NewMockSharesInterface(t), + StatementExecution: sql.NewMockStatementExecutionInterface(t), + StorageCredentials: catalog.NewMockStorageCredentialsInterface(t), + SystemSchemas: catalog.NewMockSystemSchemasInterface(t), + TableConstraints: catalog.NewMockTableConstraintsInterface(t), + Tables: catalog.NewMockTablesInterface(t), + TokenManagement: settings.NewMockTokenManagementInterface(t), + Tokens: settings.NewMockTokensInterface(t), + Users: iam.NewMockUsersInterface(t), + VectorSearchEndpoints: vectorsearch.NewMockVectorSearchEndpointsInterface(t), + VectorSearchIndexes: vectorsearch.NewMockVectorSearchIndexesInterface(t), + Volumes: catalog.NewMockVolumesInterface(t), + Warehouses: sql.NewMockWarehousesInterface(t), + Workspace: workspace.NewMockWorkspaceInterface(t), + WorkspaceBindings: catalog.NewMockWorkspaceBindingsInterface(t), + WorkspaceConf: settings.NewMockWorkspaceConfInterface(t), }, } @@ -250,6 +263,46 @@ func (m *MockWorkspaceClient) GetMockConnectionsAPI() *catalog.MockConnectionsIn return api } +func (m *MockWorkspaceClient) GetMockConsumerFulfillmentsAPI() *marketplace.MockConsumerFulfillmentsInterface { + api, ok := m.WorkspaceClient.ConsumerFulfillments.(*marketplace.MockConsumerFulfillmentsInterface) + if !ok { + panic(fmt.Sprintf("expected ConsumerFulfillments to be *marketplace.MockConsumerFulfillmentsInterface, actual was %T", m.WorkspaceClient.ConsumerFulfillments)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockConsumerInstallationsAPI() *marketplace.MockConsumerInstallationsInterface { + api, ok := m.WorkspaceClient.ConsumerInstallations.(*marketplace.MockConsumerInstallationsInterface) + if !ok { + panic(fmt.Sprintf("expected ConsumerInstallations to be *marketplace.MockConsumerInstallationsInterface, actual was %T", m.WorkspaceClient.ConsumerInstallations)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockConsumerListingsAPI() *marketplace.MockConsumerListingsInterface { + api, ok := m.WorkspaceClient.ConsumerListings.(*marketplace.MockConsumerListingsInterface) + if !ok { + panic(fmt.Sprintf("expected ConsumerListings to be *marketplace.MockConsumerListingsInterface, actual was %T", m.WorkspaceClient.ConsumerListings)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockConsumerPersonalizationRequestsAPI() *marketplace.MockConsumerPersonalizationRequestsInterface { + api, ok := m.WorkspaceClient.ConsumerPersonalizationRequests.(*marketplace.MockConsumerPersonalizationRequestsInterface) + if !ok { + panic(fmt.Sprintf("expected ConsumerPersonalizationRequests to be *marketplace.MockConsumerPersonalizationRequestsInterface, actual was %T", m.WorkspaceClient.ConsumerPersonalizationRequests)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockConsumerProvidersAPI() *marketplace.MockConsumerProvidersInterface { + api, ok := m.WorkspaceClient.ConsumerProviders.(*marketplace.MockConsumerProvidersInterface) + if !ok { + panic(fmt.Sprintf("expected ConsumerProviders to be *marketplace.MockConsumerProvidersInterface, actual was %T", m.WorkspaceClient.ConsumerProviders)) + } + return api +} + func (m *MockWorkspaceClient) GetMockCredentialsManagerAPI() *settings.MockCredentialsManagerInterface { api, ok := m.WorkspaceClient.CredentialsManager.(*settings.MockCredentialsManagerInterface) if !ok { @@ -490,6 +543,62 @@ func (m *MockWorkspaceClient) GetMockPolicyFamiliesAPI() *compute.MockPolicyFami return api } +func (m *MockWorkspaceClient) GetMockProviderExchangeFiltersAPI() *marketplace.MockProviderExchangeFiltersInterface { + api, ok := m.WorkspaceClient.ProviderExchangeFilters.(*marketplace.MockProviderExchangeFiltersInterface) + if !ok { + panic(fmt.Sprintf("expected ProviderExchangeFilters to be *marketplace.MockProviderExchangeFiltersInterface, actual was %T", m.WorkspaceClient.ProviderExchangeFilters)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockProviderExchangesAPI() *marketplace.MockProviderExchangesInterface { + api, ok := m.WorkspaceClient.ProviderExchanges.(*marketplace.MockProviderExchangesInterface) + if !ok { + panic(fmt.Sprintf("expected ProviderExchanges to be *marketplace.MockProviderExchangesInterface, actual was %T", m.WorkspaceClient.ProviderExchanges)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockProviderFilesAPI() *marketplace.MockProviderFilesInterface { + api, ok := m.WorkspaceClient.ProviderFiles.(*marketplace.MockProviderFilesInterface) + if !ok { + panic(fmt.Sprintf("expected ProviderFiles to be *marketplace.MockProviderFilesInterface, actual was %T", m.WorkspaceClient.ProviderFiles)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockProviderListingsAPI() *marketplace.MockProviderListingsInterface { + api, ok := m.WorkspaceClient.ProviderListings.(*marketplace.MockProviderListingsInterface) + if !ok { + panic(fmt.Sprintf("expected ProviderListings to be *marketplace.MockProviderListingsInterface, actual was %T", m.WorkspaceClient.ProviderListings)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockProviderPersonalizationRequestsAPI() *marketplace.MockProviderPersonalizationRequestsInterface { + api, ok := m.WorkspaceClient.ProviderPersonalizationRequests.(*marketplace.MockProviderPersonalizationRequestsInterface) + if !ok { + panic(fmt.Sprintf("expected ProviderPersonalizationRequests to be *marketplace.MockProviderPersonalizationRequestsInterface, actual was %T", m.WorkspaceClient.ProviderPersonalizationRequests)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockProviderProviderAnalyticsDashboardsAPI() *marketplace.MockProviderProviderAnalyticsDashboardsInterface { + api, ok := m.WorkspaceClient.ProviderProviderAnalyticsDashboards.(*marketplace.MockProviderProviderAnalyticsDashboardsInterface) + if !ok { + panic(fmt.Sprintf("expected ProviderProviderAnalyticsDashboards to be *marketplace.MockProviderProviderAnalyticsDashboardsInterface, actual was %T", m.WorkspaceClient.ProviderProviderAnalyticsDashboards)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockProviderProvidersAPI() *marketplace.MockProviderProvidersInterface { + api, ok := m.WorkspaceClient.ProviderProviders.(*marketplace.MockProviderProvidersInterface) + if !ok { + panic(fmt.Sprintf("expected ProviderProviders to be *marketplace.MockProviderProvidersInterface, actual was %T", m.WorkspaceClient.ProviderProviders)) + } + return api +} + func (m *MockWorkspaceClient) GetMockProvidersAPI() *sharing.MockProvidersInterface { api, ok := m.WorkspaceClient.Providers.(*sharing.MockProvidersInterface) if !ok { diff --git a/experimental/mocks/service/catalog/mock_lakehouse_monitors_interface.go b/experimental/mocks/service/catalog/mock_lakehouse_monitors_interface.go index 382eea778..94c6ff1ed 100644 --- a/experimental/mocks/service/catalog/mock_lakehouse_monitors_interface.go +++ b/experimental/mocks/service/catalog/mock_lakehouse_monitors_interface.go @@ -176,17 +176,17 @@ func (_c *MockLakehouseMonitorsInterface_Delete_Call) RunAndReturn(run func(cont return _c } -// DeleteByFullName provides a mock function with given fields: ctx, fullName -func (_m *MockLakehouseMonitorsInterface) DeleteByFullName(ctx context.Context, fullName string) error { - ret := _m.Called(ctx, fullName) +// DeleteByTableName provides a mock function with given fields: ctx, tableName +func (_m *MockLakehouseMonitorsInterface) DeleteByTableName(ctx context.Context, tableName string) error { + ret := _m.Called(ctx, tableName) if len(ret) == 0 { - panic("no return value specified for DeleteByFullName") + panic("no return value specified for DeleteByTableName") } var r0 error if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, fullName) + r0 = rf(ctx, tableName) } else { r0 = ret.Error(0) } @@ -194,31 +194,31 @@ func (_m *MockLakehouseMonitorsInterface) DeleteByFullName(ctx context.Context, return r0 } -// MockLakehouseMonitorsInterface_DeleteByFullName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByFullName' -type MockLakehouseMonitorsInterface_DeleteByFullName_Call struct { +// MockLakehouseMonitorsInterface_DeleteByTableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByTableName' +type MockLakehouseMonitorsInterface_DeleteByTableName_Call struct { *mock.Call } -// DeleteByFullName is a helper method to define mock.On call +// DeleteByTableName is a helper method to define mock.On call // - ctx context.Context -// - fullName string -func (_e *MockLakehouseMonitorsInterface_Expecter) DeleteByFullName(ctx interface{}, fullName interface{}) *MockLakehouseMonitorsInterface_DeleteByFullName_Call { - return &MockLakehouseMonitorsInterface_DeleteByFullName_Call{Call: _e.mock.On("DeleteByFullName", ctx, fullName)} +// - tableName string +func (_e *MockLakehouseMonitorsInterface_Expecter) DeleteByTableName(ctx interface{}, tableName interface{}) *MockLakehouseMonitorsInterface_DeleteByTableName_Call { + return &MockLakehouseMonitorsInterface_DeleteByTableName_Call{Call: _e.mock.On("DeleteByTableName", ctx, tableName)} } -func (_c *MockLakehouseMonitorsInterface_DeleteByFullName_Call) Run(run func(ctx context.Context, fullName string)) *MockLakehouseMonitorsInterface_DeleteByFullName_Call { +func (_c *MockLakehouseMonitorsInterface_DeleteByTableName_Call) Run(run func(ctx context.Context, tableName string)) *MockLakehouseMonitorsInterface_DeleteByTableName_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string)) }) return _c } -func (_c *MockLakehouseMonitorsInterface_DeleteByFullName_Call) Return(_a0 error) *MockLakehouseMonitorsInterface_DeleteByFullName_Call { +func (_c *MockLakehouseMonitorsInterface_DeleteByTableName_Call) Return(_a0 error) *MockLakehouseMonitorsInterface_DeleteByTableName_Call { _c.Call.Return(_a0) return _c } -func (_c *MockLakehouseMonitorsInterface_DeleteByFullName_Call) RunAndReturn(run func(context.Context, string) error) *MockLakehouseMonitorsInterface_DeleteByFullName_Call { +func (_c *MockLakehouseMonitorsInterface_DeleteByTableName_Call) RunAndReturn(run func(context.Context, string) error) *MockLakehouseMonitorsInterface_DeleteByTableName_Call { _c.Call.Return(run) return _c } @@ -282,21 +282,21 @@ func (_c *MockLakehouseMonitorsInterface_Get_Call) RunAndReturn(run func(context return _c } -// GetByFullName provides a mock function with given fields: ctx, fullName -func (_m *MockLakehouseMonitorsInterface) GetByFullName(ctx context.Context, fullName string) (*catalog.MonitorInfo, error) { - ret := _m.Called(ctx, fullName) +// GetByTableName provides a mock function with given fields: ctx, tableName +func (_m *MockLakehouseMonitorsInterface) GetByTableName(ctx context.Context, tableName string) (*catalog.MonitorInfo, error) { + ret := _m.Called(ctx, tableName) if len(ret) == 0 { - panic("no return value specified for GetByFullName") + panic("no return value specified for GetByTableName") } var r0 *catalog.MonitorInfo var r1 error if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.MonitorInfo, error)); ok { - return rf(ctx, fullName) + return rf(ctx, tableName) } if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.MonitorInfo); ok { - r0 = rf(ctx, fullName) + r0 = rf(ctx, tableName) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*catalog.MonitorInfo) @@ -304,7 +304,7 @@ func (_m *MockLakehouseMonitorsInterface) GetByFullName(ctx context.Context, ful } if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, fullName) + r1 = rf(ctx, tableName) } else { r1 = ret.Error(1) } @@ -312,31 +312,31 @@ func (_m *MockLakehouseMonitorsInterface) GetByFullName(ctx context.Context, ful return r0, r1 } -// MockLakehouseMonitorsInterface_GetByFullName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByFullName' -type MockLakehouseMonitorsInterface_GetByFullName_Call struct { +// MockLakehouseMonitorsInterface_GetByTableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByTableName' +type MockLakehouseMonitorsInterface_GetByTableName_Call struct { *mock.Call } -// GetByFullName is a helper method to define mock.On call +// GetByTableName is a helper method to define mock.On call // - ctx context.Context -// - fullName string -func (_e *MockLakehouseMonitorsInterface_Expecter) GetByFullName(ctx interface{}, fullName interface{}) *MockLakehouseMonitorsInterface_GetByFullName_Call { - return &MockLakehouseMonitorsInterface_GetByFullName_Call{Call: _e.mock.On("GetByFullName", ctx, fullName)} +// - tableName string +func (_e *MockLakehouseMonitorsInterface_Expecter) GetByTableName(ctx interface{}, tableName interface{}) *MockLakehouseMonitorsInterface_GetByTableName_Call { + return &MockLakehouseMonitorsInterface_GetByTableName_Call{Call: _e.mock.On("GetByTableName", ctx, tableName)} } -func (_c *MockLakehouseMonitorsInterface_GetByFullName_Call) Run(run func(ctx context.Context, fullName string)) *MockLakehouseMonitorsInterface_GetByFullName_Call { +func (_c *MockLakehouseMonitorsInterface_GetByTableName_Call) Run(run func(ctx context.Context, tableName string)) *MockLakehouseMonitorsInterface_GetByTableName_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string)) }) return _c } -func (_c *MockLakehouseMonitorsInterface_GetByFullName_Call) Return(_a0 *catalog.MonitorInfo, _a1 error) *MockLakehouseMonitorsInterface_GetByFullName_Call { +func (_c *MockLakehouseMonitorsInterface_GetByTableName_Call) Return(_a0 *catalog.MonitorInfo, _a1 error) *MockLakehouseMonitorsInterface_GetByTableName_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockLakehouseMonitorsInterface_GetByFullName_Call) RunAndReturn(run func(context.Context, string) (*catalog.MonitorInfo, error)) *MockLakehouseMonitorsInterface_GetByFullName_Call { +func (_c *MockLakehouseMonitorsInterface_GetByTableName_Call) RunAndReturn(run func(context.Context, string) (*catalog.MonitorInfo, error)) *MockLakehouseMonitorsInterface_GetByTableName_Call { _c.Call.Return(run) return _c } @@ -400,21 +400,21 @@ func (_c *MockLakehouseMonitorsInterface_GetRefresh_Call) RunAndReturn(run func( return _c } -// GetRefreshByFullNameAndRefreshId provides a mock function with given fields: ctx, fullName, refreshId -func (_m *MockLakehouseMonitorsInterface) GetRefreshByFullNameAndRefreshId(ctx context.Context, fullName string, refreshId string) (*catalog.MonitorRefreshInfo, error) { - ret := _m.Called(ctx, fullName, refreshId) +// GetRefreshByTableNameAndRefreshId provides a mock function with given fields: ctx, tableName, refreshId +func (_m *MockLakehouseMonitorsInterface) GetRefreshByTableNameAndRefreshId(ctx context.Context, tableName string, refreshId string) (*catalog.MonitorRefreshInfo, error) { + ret := _m.Called(ctx, tableName, refreshId) if len(ret) == 0 { - panic("no return value specified for GetRefreshByFullNameAndRefreshId") + panic("no return value specified for GetRefreshByTableNameAndRefreshId") } var r0 *catalog.MonitorRefreshInfo var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string) (*catalog.MonitorRefreshInfo, error)); ok { - return rf(ctx, fullName, refreshId) + return rf(ctx, tableName, refreshId) } if rf, ok := ret.Get(0).(func(context.Context, string, string) *catalog.MonitorRefreshInfo); ok { - r0 = rf(ctx, fullName, refreshId) + r0 = rf(ctx, tableName, refreshId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*catalog.MonitorRefreshInfo) @@ -422,7 +422,7 @@ func (_m *MockLakehouseMonitorsInterface) GetRefreshByFullNameAndRefreshId(ctx c } if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, fullName, refreshId) + r1 = rf(ctx, tableName, refreshId) } else { r1 = ret.Error(1) } @@ -430,32 +430,32 @@ func (_m *MockLakehouseMonitorsInterface) GetRefreshByFullNameAndRefreshId(ctx c return r0, r1 } -// MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRefreshByFullNameAndRefreshId' -type MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call struct { +// MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRefreshByTableNameAndRefreshId' +type MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call struct { *mock.Call } -// GetRefreshByFullNameAndRefreshId is a helper method to define mock.On call +// GetRefreshByTableNameAndRefreshId is a helper method to define mock.On call // - ctx context.Context -// - fullName string +// - tableName string // - refreshId string -func (_e *MockLakehouseMonitorsInterface_Expecter) GetRefreshByFullNameAndRefreshId(ctx interface{}, fullName interface{}, refreshId interface{}) *MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call { - return &MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call{Call: _e.mock.On("GetRefreshByFullNameAndRefreshId", ctx, fullName, refreshId)} +func (_e *MockLakehouseMonitorsInterface_Expecter) GetRefreshByTableNameAndRefreshId(ctx interface{}, tableName interface{}, refreshId interface{}) *MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call { + return &MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call{Call: _e.mock.On("GetRefreshByTableNameAndRefreshId", ctx, tableName, refreshId)} } -func (_c *MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call) Run(run func(ctx context.Context, fullName string, refreshId string)) *MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call { +func (_c *MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call) Run(run func(ctx context.Context, tableName string, refreshId string)) *MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string), args[2].(string)) }) return _c } -func (_c *MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call) Return(_a0 *catalog.MonitorRefreshInfo, _a1 error) *MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call { +func (_c *MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call) Return(_a0 *catalog.MonitorRefreshInfo, _a1 error) *MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call) RunAndReturn(run func(context.Context, string, string) (*catalog.MonitorRefreshInfo, error)) *MockLakehouseMonitorsInterface_GetRefreshByFullNameAndRefreshId_Call { +func (_c *MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call) RunAndReturn(run func(context.Context, string, string) (*catalog.MonitorRefreshInfo, error)) *MockLakehouseMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call { _c.Call.Return(run) return _c } @@ -566,21 +566,21 @@ func (_c *MockLakehouseMonitorsInterface_ListRefreshes_Call) RunAndReturn(run fu return _c } -// ListRefreshesByFullName provides a mock function with given fields: ctx, fullName -func (_m *MockLakehouseMonitorsInterface) ListRefreshesByFullName(ctx context.Context, fullName string) ([]catalog.MonitorRefreshInfo, error) { - ret := _m.Called(ctx, fullName) +// ListRefreshesByTableName provides a mock function with given fields: ctx, tableName +func (_m *MockLakehouseMonitorsInterface) ListRefreshesByTableName(ctx context.Context, tableName string) ([]catalog.MonitorRefreshInfo, error) { + ret := _m.Called(ctx, tableName) if len(ret) == 0 { - panic("no return value specified for ListRefreshesByFullName") + panic("no return value specified for ListRefreshesByTableName") } var r0 []catalog.MonitorRefreshInfo var r1 error if rf, ok := ret.Get(0).(func(context.Context, string) ([]catalog.MonitorRefreshInfo, error)); ok { - return rf(ctx, fullName) + return rf(ctx, tableName) } if rf, ok := ret.Get(0).(func(context.Context, string) []catalog.MonitorRefreshInfo); ok { - r0 = rf(ctx, fullName) + r0 = rf(ctx, tableName) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]catalog.MonitorRefreshInfo) @@ -588,7 +588,7 @@ func (_m *MockLakehouseMonitorsInterface) ListRefreshesByFullName(ctx context.Co } if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, fullName) + r1 = rf(ctx, tableName) } else { r1 = ret.Error(1) } @@ -596,31 +596,31 @@ func (_m *MockLakehouseMonitorsInterface) ListRefreshesByFullName(ctx context.Co return r0, r1 } -// MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRefreshesByFullName' -type MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call struct { +// MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRefreshesByTableName' +type MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call struct { *mock.Call } -// ListRefreshesByFullName is a helper method to define mock.On call +// ListRefreshesByTableName is a helper method to define mock.On call // - ctx context.Context -// - fullName string -func (_e *MockLakehouseMonitorsInterface_Expecter) ListRefreshesByFullName(ctx interface{}, fullName interface{}) *MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call { - return &MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call{Call: _e.mock.On("ListRefreshesByFullName", ctx, fullName)} +// - tableName string +func (_e *MockLakehouseMonitorsInterface_Expecter) ListRefreshesByTableName(ctx interface{}, tableName interface{}) *MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call { + return &MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call{Call: _e.mock.On("ListRefreshesByTableName", ctx, tableName)} } -func (_c *MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call) Run(run func(ctx context.Context, fullName string)) *MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call { +func (_c *MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call) Run(run func(ctx context.Context, tableName string)) *MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string)) }) return _c } -func (_c *MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call) Return(_a0 []catalog.MonitorRefreshInfo, _a1 error) *MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call { +func (_c *MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call) Return(_a0 []catalog.MonitorRefreshInfo, _a1 error) *MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call) RunAndReturn(run func(context.Context, string) ([]catalog.MonitorRefreshInfo, error)) *MockLakehouseMonitorsInterface_ListRefreshesByFullName_Call { +func (_c *MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call) RunAndReturn(run func(context.Context, string) ([]catalog.MonitorRefreshInfo, error)) *MockLakehouseMonitorsInterface_ListRefreshesByTableName_Call { _c.Call.Return(run) return _c } diff --git a/experimental/mocks/service/iam/mock_workspace_assignment_interface.go b/experimental/mocks/service/iam/mock_workspace_assignment_interface.go index 2769e3195..71e41b0ab 100644 --- a/experimental/mocks/service/iam/mock_workspace_assignment_interface.go +++ b/experimental/mocks/service/iam/mock_workspace_assignment_interface.go @@ -452,21 +452,33 @@ func (_c *MockWorkspaceAssignmentInterface_ListByWorkspaceId_Call) RunAndReturn( } // Update provides a mock function with given fields: ctx, request -func (_m *MockWorkspaceAssignmentInterface) Update(ctx context.Context, request iam.UpdateWorkspaceAssignments) error { +func (_m *MockWorkspaceAssignmentInterface) Update(ctx context.Context, request iam.UpdateWorkspaceAssignments) (*iam.PermissionAssignment, error) { ret := _m.Called(ctx, request) if len(ret) == 0 { panic("no return value specified for Update") } - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, iam.UpdateWorkspaceAssignments) error); ok { + var r0 *iam.PermissionAssignment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, iam.UpdateWorkspaceAssignments) (*iam.PermissionAssignment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, iam.UpdateWorkspaceAssignments) *iam.PermissionAssignment); ok { r0 = rf(ctx, request) } else { - r0 = ret.Error(0) + if ret.Get(0) != nil { + r0 = ret.Get(0).(*iam.PermissionAssignment) + } } - return r0 + if rf, ok := ret.Get(1).(func(context.Context, iam.UpdateWorkspaceAssignments) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 } // MockWorkspaceAssignmentInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' @@ -488,12 +500,12 @@ func (_c *MockWorkspaceAssignmentInterface_Update_Call) Run(run func(ctx context return _c } -func (_c *MockWorkspaceAssignmentInterface_Update_Call) Return(_a0 error) *MockWorkspaceAssignmentInterface_Update_Call { - _c.Call.Return(_a0) +func (_c *MockWorkspaceAssignmentInterface_Update_Call) Return(_a0 *iam.PermissionAssignment, _a1 error) *MockWorkspaceAssignmentInterface_Update_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MockWorkspaceAssignmentInterface_Update_Call) RunAndReturn(run func(context.Context, iam.UpdateWorkspaceAssignments) error) *MockWorkspaceAssignmentInterface_Update_Call { +func (_c *MockWorkspaceAssignmentInterface_Update_Call) RunAndReturn(run func(context.Context, iam.UpdateWorkspaceAssignments) (*iam.PermissionAssignment, error)) *MockWorkspaceAssignmentInterface_Update_Call { _c.Call.Return(run) return _c } diff --git a/experimental/mocks/service/marketplace/mock_consumer_fulfillments_interface.go b/experimental/mocks/service/marketplace/mock_consumer_fulfillments_interface.go new file mode 100644 index 000000000..7b0d92ad6 --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_consumer_fulfillments_interface.go @@ -0,0 +1,468 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockConsumerFulfillmentsInterface is an autogenerated mock type for the ConsumerFulfillmentsInterface type +type MockConsumerFulfillmentsInterface struct { + mock.Mock +} + +type MockConsumerFulfillmentsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockConsumerFulfillmentsInterface) EXPECT() *MockConsumerFulfillmentsInterface_Expecter { + return &MockConsumerFulfillmentsInterface_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockConsumerFulfillmentsInterface) Get(ctx context.Context, request marketplace.GetListingContentMetadataRequest) listing.Iterator[marketplace.SharedDataObject] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 listing.Iterator[marketplace.SharedDataObject] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingContentMetadataRequest) listing.Iterator[marketplace.SharedDataObject]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.SharedDataObject]) + } + } + + return r0 +} + +// MockConsumerFulfillmentsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockConsumerFulfillmentsInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetListingContentMetadataRequest +func (_e *MockConsumerFulfillmentsInterface_Expecter) Get(ctx interface{}, request interface{}) *MockConsumerFulfillmentsInterface_Get_Call { + return &MockConsumerFulfillmentsInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockConsumerFulfillmentsInterface_Get_Call) Run(run func(ctx context.Context, request marketplace.GetListingContentMetadataRequest)) *MockConsumerFulfillmentsInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetListingContentMetadataRequest)) + }) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_Get_Call) Return(_a0 listing.Iterator[marketplace.SharedDataObject]) *MockConsumerFulfillmentsInterface_Get_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_Get_Call) RunAndReturn(run func(context.Context, marketplace.GetListingContentMetadataRequest) listing.Iterator[marketplace.SharedDataObject]) *MockConsumerFulfillmentsInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetAll provides a mock function with given fields: ctx, request +func (_m *MockConsumerFulfillmentsInterface) GetAll(ctx context.Context, request marketplace.GetListingContentMetadataRequest) ([]marketplace.SharedDataObject, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetAll") + } + + var r0 []marketplace.SharedDataObject + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingContentMetadataRequest) ([]marketplace.SharedDataObject, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingContentMetadataRequest) []marketplace.SharedDataObject); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.SharedDataObject) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetListingContentMetadataRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerFulfillmentsInterface_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type MockConsumerFulfillmentsInterface_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetListingContentMetadataRequest +func (_e *MockConsumerFulfillmentsInterface_Expecter) GetAll(ctx interface{}, request interface{}) *MockConsumerFulfillmentsInterface_GetAll_Call { + return &MockConsumerFulfillmentsInterface_GetAll_Call{Call: _e.mock.On("GetAll", ctx, request)} +} + +func (_c *MockConsumerFulfillmentsInterface_GetAll_Call) Run(run func(ctx context.Context, request marketplace.GetListingContentMetadataRequest)) *MockConsumerFulfillmentsInterface_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetListingContentMetadataRequest)) + }) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_GetAll_Call) Return(_a0 []marketplace.SharedDataObject, _a1 error) *MockConsumerFulfillmentsInterface_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_GetAll_Call) RunAndReturn(run func(context.Context, marketplace.GetListingContentMetadataRequest) ([]marketplace.SharedDataObject, error)) *MockConsumerFulfillmentsInterface_GetAll_Call { + _c.Call.Return(run) + return _c +} + +// GetByListingId provides a mock function with given fields: ctx, listingId +func (_m *MockConsumerFulfillmentsInterface) GetByListingId(ctx context.Context, listingId string) (*marketplace.GetListingContentMetadataResponse, error) { + ret := _m.Called(ctx, listingId) + + if len(ret) == 0 { + panic("no return value specified for GetByListingId") + } + + var r0 *marketplace.GetListingContentMetadataResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.GetListingContentMetadataResponse, error)); ok { + return rf(ctx, listingId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.GetListingContentMetadataResponse); ok { + r0 = rf(ctx, listingId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetListingContentMetadataResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, listingId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerFulfillmentsInterface_GetByListingId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByListingId' +type MockConsumerFulfillmentsInterface_GetByListingId_Call struct { + *mock.Call +} + +// GetByListingId is a helper method to define mock.On call +// - ctx context.Context +// - listingId string +func (_e *MockConsumerFulfillmentsInterface_Expecter) GetByListingId(ctx interface{}, listingId interface{}) *MockConsumerFulfillmentsInterface_GetByListingId_Call { + return &MockConsumerFulfillmentsInterface_GetByListingId_Call{Call: _e.mock.On("GetByListingId", ctx, listingId)} +} + +func (_c *MockConsumerFulfillmentsInterface_GetByListingId_Call) Run(run func(ctx context.Context, listingId string)) *MockConsumerFulfillmentsInterface_GetByListingId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_GetByListingId_Call) Return(_a0 *marketplace.GetListingContentMetadataResponse, _a1 error) *MockConsumerFulfillmentsInterface_GetByListingId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_GetByListingId_Call) RunAndReturn(run func(context.Context, string) (*marketplace.GetListingContentMetadataResponse, error)) *MockConsumerFulfillmentsInterface_GetByListingId_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockConsumerFulfillmentsInterface) Impl() marketplace.ConsumerFulfillmentsService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ConsumerFulfillmentsService + if rf, ok := ret.Get(0).(func() marketplace.ConsumerFulfillmentsService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerFulfillmentsService) + } + } + + return r0 +} + +// MockConsumerFulfillmentsInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockConsumerFulfillmentsInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockConsumerFulfillmentsInterface_Expecter) Impl() *MockConsumerFulfillmentsInterface_Impl_Call { + return &MockConsumerFulfillmentsInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockConsumerFulfillmentsInterface_Impl_Call) Run(run func()) *MockConsumerFulfillmentsInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_Impl_Call) Return(_a0 marketplace.ConsumerFulfillmentsService) *MockConsumerFulfillmentsInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_Impl_Call) RunAndReturn(run func() marketplace.ConsumerFulfillmentsService) *MockConsumerFulfillmentsInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockConsumerFulfillmentsInterface) List(ctx context.Context, request marketplace.ListFulfillmentsRequest) listing.Iterator[marketplace.ListingFulfillment] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.ListingFulfillment] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListFulfillmentsRequest) listing.Iterator[marketplace.ListingFulfillment]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.ListingFulfillment]) + } + } + + return r0 +} + +// MockConsumerFulfillmentsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockConsumerFulfillmentsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListFulfillmentsRequest +func (_e *MockConsumerFulfillmentsInterface_Expecter) List(ctx interface{}, request interface{}) *MockConsumerFulfillmentsInterface_List_Call { + return &MockConsumerFulfillmentsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockConsumerFulfillmentsInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListFulfillmentsRequest)) *MockConsumerFulfillmentsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListFulfillmentsRequest)) + }) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_List_Call) Return(_a0 listing.Iterator[marketplace.ListingFulfillment]) *MockConsumerFulfillmentsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListFulfillmentsRequest) listing.Iterator[marketplace.ListingFulfillment]) *MockConsumerFulfillmentsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockConsumerFulfillmentsInterface) ListAll(ctx context.Context, request marketplace.ListFulfillmentsRequest) ([]marketplace.ListingFulfillment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.ListingFulfillment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListFulfillmentsRequest) ([]marketplace.ListingFulfillment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListFulfillmentsRequest) []marketplace.ListingFulfillment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.ListingFulfillment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListFulfillmentsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerFulfillmentsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockConsumerFulfillmentsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListFulfillmentsRequest +func (_e *MockConsumerFulfillmentsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockConsumerFulfillmentsInterface_ListAll_Call { + return &MockConsumerFulfillmentsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockConsumerFulfillmentsInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListFulfillmentsRequest)) *MockConsumerFulfillmentsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListFulfillmentsRequest)) + }) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_ListAll_Call) Return(_a0 []marketplace.ListingFulfillment, _a1 error) *MockConsumerFulfillmentsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListFulfillmentsRequest) ([]marketplace.ListingFulfillment, error)) *MockConsumerFulfillmentsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// ListByListingId provides a mock function with given fields: ctx, listingId +func (_m *MockConsumerFulfillmentsInterface) ListByListingId(ctx context.Context, listingId string) (*marketplace.ListFulfillmentsResponse, error) { + ret := _m.Called(ctx, listingId) + + if len(ret) == 0 { + panic("no return value specified for ListByListingId") + } + + var r0 *marketplace.ListFulfillmentsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.ListFulfillmentsResponse, error)); ok { + return rf(ctx, listingId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.ListFulfillmentsResponse); ok { + r0 = rf(ctx, listingId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.ListFulfillmentsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, listingId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerFulfillmentsInterface_ListByListingId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListByListingId' +type MockConsumerFulfillmentsInterface_ListByListingId_Call struct { + *mock.Call +} + +// ListByListingId is a helper method to define mock.On call +// - ctx context.Context +// - listingId string +func (_e *MockConsumerFulfillmentsInterface_Expecter) ListByListingId(ctx interface{}, listingId interface{}) *MockConsumerFulfillmentsInterface_ListByListingId_Call { + return &MockConsumerFulfillmentsInterface_ListByListingId_Call{Call: _e.mock.On("ListByListingId", ctx, listingId)} +} + +func (_c *MockConsumerFulfillmentsInterface_ListByListingId_Call) Run(run func(ctx context.Context, listingId string)) *MockConsumerFulfillmentsInterface_ListByListingId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_ListByListingId_Call) Return(_a0 *marketplace.ListFulfillmentsResponse, _a1 error) *MockConsumerFulfillmentsInterface_ListByListingId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_ListByListingId_Call) RunAndReturn(run func(context.Context, string) (*marketplace.ListFulfillmentsResponse, error)) *MockConsumerFulfillmentsInterface_ListByListingId_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockConsumerFulfillmentsInterface) WithImpl(impl marketplace.ConsumerFulfillmentsService) marketplace.ConsumerFulfillmentsInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ConsumerFulfillmentsInterface + if rf, ok := ret.Get(0).(func(marketplace.ConsumerFulfillmentsService) marketplace.ConsumerFulfillmentsInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerFulfillmentsInterface) + } + } + + return r0 +} + +// MockConsumerFulfillmentsInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockConsumerFulfillmentsInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ConsumerFulfillmentsService +func (_e *MockConsumerFulfillmentsInterface_Expecter) WithImpl(impl interface{}) *MockConsumerFulfillmentsInterface_WithImpl_Call { + return &MockConsumerFulfillmentsInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockConsumerFulfillmentsInterface_WithImpl_Call) Run(run func(impl marketplace.ConsumerFulfillmentsService)) *MockConsumerFulfillmentsInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ConsumerFulfillmentsService)) + }) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_WithImpl_Call) Return(_a0 marketplace.ConsumerFulfillmentsInterface) *MockConsumerFulfillmentsInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerFulfillmentsInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ConsumerFulfillmentsService) marketplace.ConsumerFulfillmentsInterface) *MockConsumerFulfillmentsInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockConsumerFulfillmentsInterface creates a new instance of MockConsumerFulfillmentsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockConsumerFulfillmentsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockConsumerFulfillmentsInterface { + mock := &MockConsumerFulfillmentsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_consumer_installations_interface.go b/experimental/mocks/service/marketplace/mock_consumer_installations_interface.go new file mode 100644 index 000000000..4aeda8b3b --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_consumer_installations_interface.go @@ -0,0 +1,622 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockConsumerInstallationsInterface is an autogenerated mock type for the ConsumerInstallationsInterface type +type MockConsumerInstallationsInterface struct { + mock.Mock +} + +type MockConsumerInstallationsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockConsumerInstallationsInterface) EXPECT() *MockConsumerInstallationsInterface_Expecter { + return &MockConsumerInstallationsInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockConsumerInstallationsInterface) Create(ctx context.Context, request marketplace.CreateInstallationRequest) (*marketplace.Installation, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *marketplace.Installation + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateInstallationRequest) (*marketplace.Installation, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateInstallationRequest) *marketplace.Installation); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.Installation) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.CreateInstallationRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerInstallationsInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockConsumerInstallationsInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.CreateInstallationRequest +func (_e *MockConsumerInstallationsInterface_Expecter) Create(ctx interface{}, request interface{}) *MockConsumerInstallationsInterface_Create_Call { + return &MockConsumerInstallationsInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockConsumerInstallationsInterface_Create_Call) Run(run func(ctx context.Context, request marketplace.CreateInstallationRequest)) *MockConsumerInstallationsInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.CreateInstallationRequest)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_Create_Call) Return(_a0 *marketplace.Installation, _a1 error) *MockConsumerInstallationsInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerInstallationsInterface_Create_Call) RunAndReturn(run func(context.Context, marketplace.CreateInstallationRequest) (*marketplace.Installation, error)) *MockConsumerInstallationsInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockConsumerInstallationsInterface) Delete(ctx context.Context, request marketplace.DeleteInstallationRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.DeleteInstallationRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockConsumerInstallationsInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockConsumerInstallationsInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.DeleteInstallationRequest +func (_e *MockConsumerInstallationsInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockConsumerInstallationsInterface_Delete_Call { + return &MockConsumerInstallationsInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockConsumerInstallationsInterface_Delete_Call) Run(run func(ctx context.Context, request marketplace.DeleteInstallationRequest)) *MockConsumerInstallationsInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.DeleteInstallationRequest)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_Delete_Call) Return(_a0 error) *MockConsumerInstallationsInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerInstallationsInterface_Delete_Call) RunAndReturn(run func(context.Context, marketplace.DeleteInstallationRequest) error) *MockConsumerInstallationsInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteByListingIdAndInstallationId provides a mock function with given fields: ctx, listingId, installationId +func (_m *MockConsumerInstallationsInterface) DeleteByListingIdAndInstallationId(ctx context.Context, listingId string, installationId string) error { + ret := _m.Called(ctx, listingId, installationId) + + if len(ret) == 0 { + panic("no return value specified for DeleteByListingIdAndInstallationId") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, listingId, installationId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByListingIdAndInstallationId' +type MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call struct { + *mock.Call +} + +// DeleteByListingIdAndInstallationId is a helper method to define mock.On call +// - ctx context.Context +// - listingId string +// - installationId string +func (_e *MockConsumerInstallationsInterface_Expecter) DeleteByListingIdAndInstallationId(ctx interface{}, listingId interface{}, installationId interface{}) *MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call { + return &MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call{Call: _e.mock.On("DeleteByListingIdAndInstallationId", ctx, listingId, installationId)} +} + +func (_c *MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call) Run(run func(ctx context.Context, listingId string, installationId string)) *MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call) Return(_a0 error) *MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call) RunAndReturn(run func(context.Context, string, string) error) *MockConsumerInstallationsInterface_DeleteByListingIdAndInstallationId_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockConsumerInstallationsInterface) Impl() marketplace.ConsumerInstallationsService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ConsumerInstallationsService + if rf, ok := ret.Get(0).(func() marketplace.ConsumerInstallationsService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerInstallationsService) + } + } + + return r0 +} + +// MockConsumerInstallationsInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockConsumerInstallationsInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockConsumerInstallationsInterface_Expecter) Impl() *MockConsumerInstallationsInterface_Impl_Call { + return &MockConsumerInstallationsInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockConsumerInstallationsInterface_Impl_Call) Run(run func()) *MockConsumerInstallationsInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_Impl_Call) Return(_a0 marketplace.ConsumerInstallationsService) *MockConsumerInstallationsInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerInstallationsInterface_Impl_Call) RunAndReturn(run func() marketplace.ConsumerInstallationsService) *MockConsumerInstallationsInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockConsumerInstallationsInterface) List(ctx context.Context, request marketplace.ListAllInstallationsRequest) listing.Iterator[marketplace.InstallationDetail] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.InstallationDetail] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListAllInstallationsRequest) listing.Iterator[marketplace.InstallationDetail]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.InstallationDetail]) + } + } + + return r0 +} + +// MockConsumerInstallationsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockConsumerInstallationsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListAllInstallationsRequest +func (_e *MockConsumerInstallationsInterface_Expecter) List(ctx interface{}, request interface{}) *MockConsumerInstallationsInterface_List_Call { + return &MockConsumerInstallationsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockConsumerInstallationsInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListAllInstallationsRequest)) *MockConsumerInstallationsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListAllInstallationsRequest)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_List_Call) Return(_a0 listing.Iterator[marketplace.InstallationDetail]) *MockConsumerInstallationsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerInstallationsInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListAllInstallationsRequest) listing.Iterator[marketplace.InstallationDetail]) *MockConsumerInstallationsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockConsumerInstallationsInterface) ListAll(ctx context.Context, request marketplace.ListAllInstallationsRequest) ([]marketplace.InstallationDetail, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.InstallationDetail + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListAllInstallationsRequest) ([]marketplace.InstallationDetail, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListAllInstallationsRequest) []marketplace.InstallationDetail); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.InstallationDetail) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListAllInstallationsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerInstallationsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockConsumerInstallationsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListAllInstallationsRequest +func (_e *MockConsumerInstallationsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockConsumerInstallationsInterface_ListAll_Call { + return &MockConsumerInstallationsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockConsumerInstallationsInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListAllInstallationsRequest)) *MockConsumerInstallationsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListAllInstallationsRequest)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_ListAll_Call) Return(_a0 []marketplace.InstallationDetail, _a1 error) *MockConsumerInstallationsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerInstallationsInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListAllInstallationsRequest) ([]marketplace.InstallationDetail, error)) *MockConsumerInstallationsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// ListListingInstallations provides a mock function with given fields: ctx, request +func (_m *MockConsumerInstallationsInterface) ListListingInstallations(ctx context.Context, request marketplace.ListInstallationsRequest) listing.Iterator[marketplace.InstallationDetail] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListListingInstallations") + } + + var r0 listing.Iterator[marketplace.InstallationDetail] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListInstallationsRequest) listing.Iterator[marketplace.InstallationDetail]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.InstallationDetail]) + } + } + + return r0 +} + +// MockConsumerInstallationsInterface_ListListingInstallations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListListingInstallations' +type MockConsumerInstallationsInterface_ListListingInstallations_Call struct { + *mock.Call +} + +// ListListingInstallations is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListInstallationsRequest +func (_e *MockConsumerInstallationsInterface_Expecter) ListListingInstallations(ctx interface{}, request interface{}) *MockConsumerInstallationsInterface_ListListingInstallations_Call { + return &MockConsumerInstallationsInterface_ListListingInstallations_Call{Call: _e.mock.On("ListListingInstallations", ctx, request)} +} + +func (_c *MockConsumerInstallationsInterface_ListListingInstallations_Call) Run(run func(ctx context.Context, request marketplace.ListInstallationsRequest)) *MockConsumerInstallationsInterface_ListListingInstallations_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListInstallationsRequest)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_ListListingInstallations_Call) Return(_a0 listing.Iterator[marketplace.InstallationDetail]) *MockConsumerInstallationsInterface_ListListingInstallations_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerInstallationsInterface_ListListingInstallations_Call) RunAndReturn(run func(context.Context, marketplace.ListInstallationsRequest) listing.Iterator[marketplace.InstallationDetail]) *MockConsumerInstallationsInterface_ListListingInstallations_Call { + _c.Call.Return(run) + return _c +} + +// ListListingInstallationsAll provides a mock function with given fields: ctx, request +func (_m *MockConsumerInstallationsInterface) ListListingInstallationsAll(ctx context.Context, request marketplace.ListInstallationsRequest) ([]marketplace.InstallationDetail, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListListingInstallationsAll") + } + + var r0 []marketplace.InstallationDetail + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListInstallationsRequest) ([]marketplace.InstallationDetail, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListInstallationsRequest) []marketplace.InstallationDetail); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.InstallationDetail) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListInstallationsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerInstallationsInterface_ListListingInstallationsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListListingInstallationsAll' +type MockConsumerInstallationsInterface_ListListingInstallationsAll_Call struct { + *mock.Call +} + +// ListListingInstallationsAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListInstallationsRequest +func (_e *MockConsumerInstallationsInterface_Expecter) ListListingInstallationsAll(ctx interface{}, request interface{}) *MockConsumerInstallationsInterface_ListListingInstallationsAll_Call { + return &MockConsumerInstallationsInterface_ListListingInstallationsAll_Call{Call: _e.mock.On("ListListingInstallationsAll", ctx, request)} +} + +func (_c *MockConsumerInstallationsInterface_ListListingInstallationsAll_Call) Run(run func(ctx context.Context, request marketplace.ListInstallationsRequest)) *MockConsumerInstallationsInterface_ListListingInstallationsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListInstallationsRequest)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_ListListingInstallationsAll_Call) Return(_a0 []marketplace.InstallationDetail, _a1 error) *MockConsumerInstallationsInterface_ListListingInstallationsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerInstallationsInterface_ListListingInstallationsAll_Call) RunAndReturn(run func(context.Context, marketplace.ListInstallationsRequest) ([]marketplace.InstallationDetail, error)) *MockConsumerInstallationsInterface_ListListingInstallationsAll_Call { + _c.Call.Return(run) + return _c +} + +// ListListingInstallationsByListingId provides a mock function with given fields: ctx, listingId +func (_m *MockConsumerInstallationsInterface) ListListingInstallationsByListingId(ctx context.Context, listingId string) (*marketplace.ListInstallationsResponse, error) { + ret := _m.Called(ctx, listingId) + + if len(ret) == 0 { + panic("no return value specified for ListListingInstallationsByListingId") + } + + var r0 *marketplace.ListInstallationsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.ListInstallationsResponse, error)); ok { + return rf(ctx, listingId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.ListInstallationsResponse); ok { + r0 = rf(ctx, listingId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.ListInstallationsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, listingId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListListingInstallationsByListingId' +type MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call struct { + *mock.Call +} + +// ListListingInstallationsByListingId is a helper method to define mock.On call +// - ctx context.Context +// - listingId string +func (_e *MockConsumerInstallationsInterface_Expecter) ListListingInstallationsByListingId(ctx interface{}, listingId interface{}) *MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call { + return &MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call{Call: _e.mock.On("ListListingInstallationsByListingId", ctx, listingId)} +} + +func (_c *MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call) Run(run func(ctx context.Context, listingId string)) *MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call) Return(_a0 *marketplace.ListInstallationsResponse, _a1 error) *MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call) RunAndReturn(run func(context.Context, string) (*marketplace.ListInstallationsResponse, error)) *MockConsumerInstallationsInterface_ListListingInstallationsByListingId_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockConsumerInstallationsInterface) Update(ctx context.Context, request marketplace.UpdateInstallationRequest) (*marketplace.UpdateInstallationResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *marketplace.UpdateInstallationResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateInstallationRequest) (*marketplace.UpdateInstallationResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateInstallationRequest) *marketplace.UpdateInstallationResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.UpdateInstallationResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.UpdateInstallationRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerInstallationsInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockConsumerInstallationsInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.UpdateInstallationRequest +func (_e *MockConsumerInstallationsInterface_Expecter) Update(ctx interface{}, request interface{}) *MockConsumerInstallationsInterface_Update_Call { + return &MockConsumerInstallationsInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockConsumerInstallationsInterface_Update_Call) Run(run func(ctx context.Context, request marketplace.UpdateInstallationRequest)) *MockConsumerInstallationsInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.UpdateInstallationRequest)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_Update_Call) Return(_a0 *marketplace.UpdateInstallationResponse, _a1 error) *MockConsumerInstallationsInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerInstallationsInterface_Update_Call) RunAndReturn(run func(context.Context, marketplace.UpdateInstallationRequest) (*marketplace.UpdateInstallationResponse, error)) *MockConsumerInstallationsInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockConsumerInstallationsInterface) WithImpl(impl marketplace.ConsumerInstallationsService) marketplace.ConsumerInstallationsInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ConsumerInstallationsInterface + if rf, ok := ret.Get(0).(func(marketplace.ConsumerInstallationsService) marketplace.ConsumerInstallationsInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerInstallationsInterface) + } + } + + return r0 +} + +// MockConsumerInstallationsInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockConsumerInstallationsInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ConsumerInstallationsService +func (_e *MockConsumerInstallationsInterface_Expecter) WithImpl(impl interface{}) *MockConsumerInstallationsInterface_WithImpl_Call { + return &MockConsumerInstallationsInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockConsumerInstallationsInterface_WithImpl_Call) Run(run func(impl marketplace.ConsumerInstallationsService)) *MockConsumerInstallationsInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ConsumerInstallationsService)) + }) + return _c +} + +func (_c *MockConsumerInstallationsInterface_WithImpl_Call) Return(_a0 marketplace.ConsumerInstallationsInterface) *MockConsumerInstallationsInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerInstallationsInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ConsumerInstallationsService) marketplace.ConsumerInstallationsInterface) *MockConsumerInstallationsInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockConsumerInstallationsInterface creates a new instance of MockConsumerInstallationsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockConsumerInstallationsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockConsumerInstallationsInterface { + mock := &MockConsumerInstallationsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_consumer_listings_interface.go b/experimental/mocks/service/marketplace/mock_consumer_listings_interface.go new file mode 100644 index 000000000..19eb7a273 --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_consumer_listings_interface.go @@ -0,0 +1,586 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockConsumerListingsInterface is an autogenerated mock type for the ConsumerListingsInterface type +type MockConsumerListingsInterface struct { + mock.Mock +} + +type MockConsumerListingsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockConsumerListingsInterface) EXPECT() *MockConsumerListingsInterface_Expecter { + return &MockConsumerListingsInterface_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockConsumerListingsInterface) Get(ctx context.Context, request marketplace.GetListingRequest) (*marketplace.GetListingResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *marketplace.GetListingResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingRequest) (*marketplace.GetListingResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingRequest) *marketplace.GetListingResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetListingResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetListingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerListingsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockConsumerListingsInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetListingRequest +func (_e *MockConsumerListingsInterface_Expecter) Get(ctx interface{}, request interface{}) *MockConsumerListingsInterface_Get_Call { + return &MockConsumerListingsInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockConsumerListingsInterface_Get_Call) Run(run func(ctx context.Context, request marketplace.GetListingRequest)) *MockConsumerListingsInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetListingRequest)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_Get_Call) Return(_a0 *marketplace.GetListingResponse, _a1 error) *MockConsumerListingsInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerListingsInterface_Get_Call) RunAndReturn(run func(context.Context, marketplace.GetListingRequest) (*marketplace.GetListingResponse, error)) *MockConsumerListingsInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetById provides a mock function with given fields: ctx, id +func (_m *MockConsumerListingsInterface) GetById(ctx context.Context, id string) (*marketplace.GetListingResponse, error) { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for GetById") + } + + var r0 *marketplace.GetListingResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.GetListingResponse, error)); ok { + return rf(ctx, id) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.GetListingResponse); ok { + r0 = rf(ctx, id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetListingResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerListingsInterface_GetById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetById' +type MockConsumerListingsInterface_GetById_Call struct { + *mock.Call +} + +// GetById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockConsumerListingsInterface_Expecter) GetById(ctx interface{}, id interface{}) *MockConsumerListingsInterface_GetById_Call { + return &MockConsumerListingsInterface_GetById_Call{Call: _e.mock.On("GetById", ctx, id)} +} + +func (_c *MockConsumerListingsInterface_GetById_Call) Run(run func(ctx context.Context, id string)) *MockConsumerListingsInterface_GetById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_GetById_Call) Return(_a0 *marketplace.GetListingResponse, _a1 error) *MockConsumerListingsInterface_GetById_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerListingsInterface_GetById_Call) RunAndReturn(run func(context.Context, string) (*marketplace.GetListingResponse, error)) *MockConsumerListingsInterface_GetById_Call { + _c.Call.Return(run) + return _c +} + +// GetBySummaryName provides a mock function with given fields: ctx, name +func (_m *MockConsumerListingsInterface) GetBySummaryName(ctx context.Context, name string) (*marketplace.Listing, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetBySummaryName") + } + + var r0 *marketplace.Listing + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.Listing, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.Listing); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.Listing) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerListingsInterface_GetBySummaryName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBySummaryName' +type MockConsumerListingsInterface_GetBySummaryName_Call struct { + *mock.Call +} + +// GetBySummaryName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockConsumerListingsInterface_Expecter) GetBySummaryName(ctx interface{}, name interface{}) *MockConsumerListingsInterface_GetBySummaryName_Call { + return &MockConsumerListingsInterface_GetBySummaryName_Call{Call: _e.mock.On("GetBySummaryName", ctx, name)} +} + +func (_c *MockConsumerListingsInterface_GetBySummaryName_Call) Run(run func(ctx context.Context, name string)) *MockConsumerListingsInterface_GetBySummaryName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_GetBySummaryName_Call) Return(_a0 *marketplace.Listing, _a1 error) *MockConsumerListingsInterface_GetBySummaryName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerListingsInterface_GetBySummaryName_Call) RunAndReturn(run func(context.Context, string) (*marketplace.Listing, error)) *MockConsumerListingsInterface_GetBySummaryName_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockConsumerListingsInterface) Impl() marketplace.ConsumerListingsService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ConsumerListingsService + if rf, ok := ret.Get(0).(func() marketplace.ConsumerListingsService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerListingsService) + } + } + + return r0 +} + +// MockConsumerListingsInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockConsumerListingsInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockConsumerListingsInterface_Expecter) Impl() *MockConsumerListingsInterface_Impl_Call { + return &MockConsumerListingsInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockConsumerListingsInterface_Impl_Call) Run(run func()) *MockConsumerListingsInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockConsumerListingsInterface_Impl_Call) Return(_a0 marketplace.ConsumerListingsService) *MockConsumerListingsInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerListingsInterface_Impl_Call) RunAndReturn(run func() marketplace.ConsumerListingsService) *MockConsumerListingsInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockConsumerListingsInterface) List(ctx context.Context, request marketplace.ListListingsRequest) listing.Iterator[marketplace.Listing] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.Listing] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsRequest) listing.Iterator[marketplace.Listing]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.Listing]) + } + } + + return r0 +} + +// MockConsumerListingsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockConsumerListingsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListListingsRequest +func (_e *MockConsumerListingsInterface_Expecter) List(ctx interface{}, request interface{}) *MockConsumerListingsInterface_List_Call { + return &MockConsumerListingsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockConsumerListingsInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListListingsRequest)) *MockConsumerListingsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListListingsRequest)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_List_Call) Return(_a0 listing.Iterator[marketplace.Listing]) *MockConsumerListingsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerListingsInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListListingsRequest) listing.Iterator[marketplace.Listing]) *MockConsumerListingsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockConsumerListingsInterface) ListAll(ctx context.Context, request marketplace.ListListingsRequest) ([]marketplace.Listing, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.Listing + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsRequest) ([]marketplace.Listing, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsRequest) []marketplace.Listing); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.Listing) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListListingsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerListingsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockConsumerListingsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListListingsRequest +func (_e *MockConsumerListingsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockConsumerListingsInterface_ListAll_Call { + return &MockConsumerListingsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockConsumerListingsInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListListingsRequest)) *MockConsumerListingsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListListingsRequest)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_ListAll_Call) Return(_a0 []marketplace.Listing, _a1 error) *MockConsumerListingsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerListingsInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListListingsRequest) ([]marketplace.Listing, error)) *MockConsumerListingsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// ListingSummaryNameToIdMap provides a mock function with given fields: ctx, request +func (_m *MockConsumerListingsInterface) ListingSummaryNameToIdMap(ctx context.Context, request marketplace.ListListingsRequest) (map[string]string, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListingSummaryNameToIdMap") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsRequest) (map[string]string, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsRequest) map[string]string); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListListingsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListingSummaryNameToIdMap' +type MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call struct { + *mock.Call +} + +// ListingSummaryNameToIdMap is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListListingsRequest +func (_e *MockConsumerListingsInterface_Expecter) ListingSummaryNameToIdMap(ctx interface{}, request interface{}) *MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call { + return &MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call{Call: _e.mock.On("ListingSummaryNameToIdMap", ctx, request)} +} + +func (_c *MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call) Run(run func(ctx context.Context, request marketplace.ListListingsRequest)) *MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListListingsRequest)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call) RunAndReturn(run func(context.Context, marketplace.ListListingsRequest) (map[string]string, error)) *MockConsumerListingsInterface_ListingSummaryNameToIdMap_Call { + _c.Call.Return(run) + return _c +} + +// Search provides a mock function with given fields: ctx, request +func (_m *MockConsumerListingsInterface) Search(ctx context.Context, request marketplace.SearchListingsRequest) listing.Iterator[marketplace.Listing] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Search") + } + + var r0 listing.Iterator[marketplace.Listing] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.SearchListingsRequest) listing.Iterator[marketplace.Listing]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.Listing]) + } + } + + return r0 +} + +// MockConsumerListingsInterface_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search' +type MockConsumerListingsInterface_Search_Call struct { + *mock.Call +} + +// Search is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.SearchListingsRequest +func (_e *MockConsumerListingsInterface_Expecter) Search(ctx interface{}, request interface{}) *MockConsumerListingsInterface_Search_Call { + return &MockConsumerListingsInterface_Search_Call{Call: _e.mock.On("Search", ctx, request)} +} + +func (_c *MockConsumerListingsInterface_Search_Call) Run(run func(ctx context.Context, request marketplace.SearchListingsRequest)) *MockConsumerListingsInterface_Search_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.SearchListingsRequest)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_Search_Call) Return(_a0 listing.Iterator[marketplace.Listing]) *MockConsumerListingsInterface_Search_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerListingsInterface_Search_Call) RunAndReturn(run func(context.Context, marketplace.SearchListingsRequest) listing.Iterator[marketplace.Listing]) *MockConsumerListingsInterface_Search_Call { + _c.Call.Return(run) + return _c +} + +// SearchAll provides a mock function with given fields: ctx, request +func (_m *MockConsumerListingsInterface) SearchAll(ctx context.Context, request marketplace.SearchListingsRequest) ([]marketplace.Listing, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for SearchAll") + } + + var r0 []marketplace.Listing + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.SearchListingsRequest) ([]marketplace.Listing, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.SearchListingsRequest) []marketplace.Listing); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.Listing) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.SearchListingsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerListingsInterface_SearchAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchAll' +type MockConsumerListingsInterface_SearchAll_Call struct { + *mock.Call +} + +// SearchAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.SearchListingsRequest +func (_e *MockConsumerListingsInterface_Expecter) SearchAll(ctx interface{}, request interface{}) *MockConsumerListingsInterface_SearchAll_Call { + return &MockConsumerListingsInterface_SearchAll_Call{Call: _e.mock.On("SearchAll", ctx, request)} +} + +func (_c *MockConsumerListingsInterface_SearchAll_Call) Run(run func(ctx context.Context, request marketplace.SearchListingsRequest)) *MockConsumerListingsInterface_SearchAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.SearchListingsRequest)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_SearchAll_Call) Return(_a0 []marketplace.Listing, _a1 error) *MockConsumerListingsInterface_SearchAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerListingsInterface_SearchAll_Call) RunAndReturn(run func(context.Context, marketplace.SearchListingsRequest) ([]marketplace.Listing, error)) *MockConsumerListingsInterface_SearchAll_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockConsumerListingsInterface) WithImpl(impl marketplace.ConsumerListingsService) marketplace.ConsumerListingsInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ConsumerListingsInterface + if rf, ok := ret.Get(0).(func(marketplace.ConsumerListingsService) marketplace.ConsumerListingsInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerListingsInterface) + } + } + + return r0 +} + +// MockConsumerListingsInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockConsumerListingsInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ConsumerListingsService +func (_e *MockConsumerListingsInterface_Expecter) WithImpl(impl interface{}) *MockConsumerListingsInterface_WithImpl_Call { + return &MockConsumerListingsInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockConsumerListingsInterface_WithImpl_Call) Run(run func(impl marketplace.ConsumerListingsService)) *MockConsumerListingsInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ConsumerListingsService)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_WithImpl_Call) Return(_a0 marketplace.ConsumerListingsInterface) *MockConsumerListingsInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerListingsInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ConsumerListingsService) marketplace.ConsumerListingsInterface) *MockConsumerListingsInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockConsumerListingsInterface creates a new instance of MockConsumerListingsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockConsumerListingsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockConsumerListingsInterface { + mock := &MockConsumerListingsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_consumer_personalization_requests_interface.go b/experimental/mocks/service/marketplace/mock_consumer_personalization_requests_interface.go new file mode 100644 index 000000000..a29da0d5e --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_consumer_personalization_requests_interface.go @@ -0,0 +1,419 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockConsumerPersonalizationRequestsInterface is an autogenerated mock type for the ConsumerPersonalizationRequestsInterface type +type MockConsumerPersonalizationRequestsInterface struct { + mock.Mock +} + +type MockConsumerPersonalizationRequestsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockConsumerPersonalizationRequestsInterface) EXPECT() *MockConsumerPersonalizationRequestsInterface_Expecter { + return &MockConsumerPersonalizationRequestsInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockConsumerPersonalizationRequestsInterface) Create(ctx context.Context, request marketplace.CreatePersonalizationRequest) (*marketplace.CreatePersonalizationRequestResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *marketplace.CreatePersonalizationRequestResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreatePersonalizationRequest) (*marketplace.CreatePersonalizationRequestResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreatePersonalizationRequest) *marketplace.CreatePersonalizationRequestResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.CreatePersonalizationRequestResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.CreatePersonalizationRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerPersonalizationRequestsInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockConsumerPersonalizationRequestsInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.CreatePersonalizationRequest +func (_e *MockConsumerPersonalizationRequestsInterface_Expecter) Create(ctx interface{}, request interface{}) *MockConsumerPersonalizationRequestsInterface_Create_Call { + return &MockConsumerPersonalizationRequestsInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockConsumerPersonalizationRequestsInterface_Create_Call) Run(run func(ctx context.Context, request marketplace.CreatePersonalizationRequest)) *MockConsumerPersonalizationRequestsInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.CreatePersonalizationRequest)) + }) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_Create_Call) Return(_a0 *marketplace.CreatePersonalizationRequestResponse, _a1 error) *MockConsumerPersonalizationRequestsInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_Create_Call) RunAndReturn(run func(context.Context, marketplace.CreatePersonalizationRequest) (*marketplace.CreatePersonalizationRequestResponse, error)) *MockConsumerPersonalizationRequestsInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockConsumerPersonalizationRequestsInterface) Get(ctx context.Context, request marketplace.GetPersonalizationRequestRequest) (*marketplace.GetPersonalizationRequestResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *marketplace.GetPersonalizationRequestResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetPersonalizationRequestRequest) (*marketplace.GetPersonalizationRequestResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetPersonalizationRequestRequest) *marketplace.GetPersonalizationRequestResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetPersonalizationRequestResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetPersonalizationRequestRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerPersonalizationRequestsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockConsumerPersonalizationRequestsInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetPersonalizationRequestRequest +func (_e *MockConsumerPersonalizationRequestsInterface_Expecter) Get(ctx interface{}, request interface{}) *MockConsumerPersonalizationRequestsInterface_Get_Call { + return &MockConsumerPersonalizationRequestsInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockConsumerPersonalizationRequestsInterface_Get_Call) Run(run func(ctx context.Context, request marketplace.GetPersonalizationRequestRequest)) *MockConsumerPersonalizationRequestsInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetPersonalizationRequestRequest)) + }) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_Get_Call) Return(_a0 *marketplace.GetPersonalizationRequestResponse, _a1 error) *MockConsumerPersonalizationRequestsInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_Get_Call) RunAndReturn(run func(context.Context, marketplace.GetPersonalizationRequestRequest) (*marketplace.GetPersonalizationRequestResponse, error)) *MockConsumerPersonalizationRequestsInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetByListingId provides a mock function with given fields: ctx, listingId +func (_m *MockConsumerPersonalizationRequestsInterface) GetByListingId(ctx context.Context, listingId string) (*marketplace.GetPersonalizationRequestResponse, error) { + ret := _m.Called(ctx, listingId) + + if len(ret) == 0 { + panic("no return value specified for GetByListingId") + } + + var r0 *marketplace.GetPersonalizationRequestResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.GetPersonalizationRequestResponse, error)); ok { + return rf(ctx, listingId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.GetPersonalizationRequestResponse); ok { + r0 = rf(ctx, listingId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetPersonalizationRequestResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, listingId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerPersonalizationRequestsInterface_GetByListingId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByListingId' +type MockConsumerPersonalizationRequestsInterface_GetByListingId_Call struct { + *mock.Call +} + +// GetByListingId is a helper method to define mock.On call +// - ctx context.Context +// - listingId string +func (_e *MockConsumerPersonalizationRequestsInterface_Expecter) GetByListingId(ctx interface{}, listingId interface{}) *MockConsumerPersonalizationRequestsInterface_GetByListingId_Call { + return &MockConsumerPersonalizationRequestsInterface_GetByListingId_Call{Call: _e.mock.On("GetByListingId", ctx, listingId)} +} + +func (_c *MockConsumerPersonalizationRequestsInterface_GetByListingId_Call) Run(run func(ctx context.Context, listingId string)) *MockConsumerPersonalizationRequestsInterface_GetByListingId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_GetByListingId_Call) Return(_a0 *marketplace.GetPersonalizationRequestResponse, _a1 error) *MockConsumerPersonalizationRequestsInterface_GetByListingId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_GetByListingId_Call) RunAndReturn(run func(context.Context, string) (*marketplace.GetPersonalizationRequestResponse, error)) *MockConsumerPersonalizationRequestsInterface_GetByListingId_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockConsumerPersonalizationRequestsInterface) Impl() marketplace.ConsumerPersonalizationRequestsService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ConsumerPersonalizationRequestsService + if rf, ok := ret.Get(0).(func() marketplace.ConsumerPersonalizationRequestsService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerPersonalizationRequestsService) + } + } + + return r0 +} + +// MockConsumerPersonalizationRequestsInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockConsumerPersonalizationRequestsInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockConsumerPersonalizationRequestsInterface_Expecter) Impl() *MockConsumerPersonalizationRequestsInterface_Impl_Call { + return &MockConsumerPersonalizationRequestsInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockConsumerPersonalizationRequestsInterface_Impl_Call) Run(run func()) *MockConsumerPersonalizationRequestsInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_Impl_Call) Return(_a0 marketplace.ConsumerPersonalizationRequestsService) *MockConsumerPersonalizationRequestsInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_Impl_Call) RunAndReturn(run func() marketplace.ConsumerPersonalizationRequestsService) *MockConsumerPersonalizationRequestsInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockConsumerPersonalizationRequestsInterface) List(ctx context.Context, request marketplace.ListAllPersonalizationRequestsRequest) listing.Iterator[marketplace.PersonalizationRequest] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.PersonalizationRequest] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) listing.Iterator[marketplace.PersonalizationRequest]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.PersonalizationRequest]) + } + } + + return r0 +} + +// MockConsumerPersonalizationRequestsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockConsumerPersonalizationRequestsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListAllPersonalizationRequestsRequest +func (_e *MockConsumerPersonalizationRequestsInterface_Expecter) List(ctx interface{}, request interface{}) *MockConsumerPersonalizationRequestsInterface_List_Call { + return &MockConsumerPersonalizationRequestsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockConsumerPersonalizationRequestsInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListAllPersonalizationRequestsRequest)) *MockConsumerPersonalizationRequestsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListAllPersonalizationRequestsRequest)) + }) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_List_Call) Return(_a0 listing.Iterator[marketplace.PersonalizationRequest]) *MockConsumerPersonalizationRequestsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) listing.Iterator[marketplace.PersonalizationRequest]) *MockConsumerPersonalizationRequestsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockConsumerPersonalizationRequestsInterface) ListAll(ctx context.Context, request marketplace.ListAllPersonalizationRequestsRequest) ([]marketplace.PersonalizationRequest, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.PersonalizationRequest + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) ([]marketplace.PersonalizationRequest, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) []marketplace.PersonalizationRequest); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.PersonalizationRequest) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerPersonalizationRequestsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockConsumerPersonalizationRequestsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListAllPersonalizationRequestsRequest +func (_e *MockConsumerPersonalizationRequestsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockConsumerPersonalizationRequestsInterface_ListAll_Call { + return &MockConsumerPersonalizationRequestsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockConsumerPersonalizationRequestsInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListAllPersonalizationRequestsRequest)) *MockConsumerPersonalizationRequestsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListAllPersonalizationRequestsRequest)) + }) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_ListAll_Call) Return(_a0 []marketplace.PersonalizationRequest, _a1 error) *MockConsumerPersonalizationRequestsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) ([]marketplace.PersonalizationRequest, error)) *MockConsumerPersonalizationRequestsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockConsumerPersonalizationRequestsInterface) WithImpl(impl marketplace.ConsumerPersonalizationRequestsService) marketplace.ConsumerPersonalizationRequestsInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ConsumerPersonalizationRequestsInterface + if rf, ok := ret.Get(0).(func(marketplace.ConsumerPersonalizationRequestsService) marketplace.ConsumerPersonalizationRequestsInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerPersonalizationRequestsInterface) + } + } + + return r0 +} + +// MockConsumerPersonalizationRequestsInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockConsumerPersonalizationRequestsInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ConsumerPersonalizationRequestsService +func (_e *MockConsumerPersonalizationRequestsInterface_Expecter) WithImpl(impl interface{}) *MockConsumerPersonalizationRequestsInterface_WithImpl_Call { + return &MockConsumerPersonalizationRequestsInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockConsumerPersonalizationRequestsInterface_WithImpl_Call) Run(run func(impl marketplace.ConsumerPersonalizationRequestsService)) *MockConsumerPersonalizationRequestsInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ConsumerPersonalizationRequestsService)) + }) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_WithImpl_Call) Return(_a0 marketplace.ConsumerPersonalizationRequestsInterface) *MockConsumerPersonalizationRequestsInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerPersonalizationRequestsInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ConsumerPersonalizationRequestsService) marketplace.ConsumerPersonalizationRequestsInterface) *MockConsumerPersonalizationRequestsInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockConsumerPersonalizationRequestsInterface creates a new instance of MockConsumerPersonalizationRequestsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockConsumerPersonalizationRequestsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockConsumerPersonalizationRequestsInterface { + mock := &MockConsumerPersonalizationRequestsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_consumer_providers_interface.go b/experimental/mocks/service/marketplace/mock_consumer_providers_interface.go new file mode 100644 index 000000000..fc00863b7 --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_consumer_providers_interface.go @@ -0,0 +1,478 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockConsumerProvidersInterface is an autogenerated mock type for the ConsumerProvidersInterface type +type MockConsumerProvidersInterface struct { + mock.Mock +} + +type MockConsumerProvidersInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockConsumerProvidersInterface) EXPECT() *MockConsumerProvidersInterface_Expecter { + return &MockConsumerProvidersInterface_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockConsumerProvidersInterface) Get(ctx context.Context, request marketplace.GetProviderRequest) (*marketplace.GetProviderResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *marketplace.GetProviderResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetProviderRequest) (*marketplace.GetProviderResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetProviderRequest) *marketplace.GetProviderResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetProviderResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetProviderRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerProvidersInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockConsumerProvidersInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetProviderRequest +func (_e *MockConsumerProvidersInterface_Expecter) Get(ctx interface{}, request interface{}) *MockConsumerProvidersInterface_Get_Call { + return &MockConsumerProvidersInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockConsumerProvidersInterface_Get_Call) Run(run func(ctx context.Context, request marketplace.GetProviderRequest)) *MockConsumerProvidersInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetProviderRequest)) + }) + return _c +} + +func (_c *MockConsumerProvidersInterface_Get_Call) Return(_a0 *marketplace.GetProviderResponse, _a1 error) *MockConsumerProvidersInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerProvidersInterface_Get_Call) RunAndReturn(run func(context.Context, marketplace.GetProviderRequest) (*marketplace.GetProviderResponse, error)) *MockConsumerProvidersInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetById provides a mock function with given fields: ctx, id +func (_m *MockConsumerProvidersInterface) GetById(ctx context.Context, id string) (*marketplace.GetProviderResponse, error) { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for GetById") + } + + var r0 *marketplace.GetProviderResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.GetProviderResponse, error)); ok { + return rf(ctx, id) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.GetProviderResponse); ok { + r0 = rf(ctx, id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetProviderResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerProvidersInterface_GetById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetById' +type MockConsumerProvidersInterface_GetById_Call struct { + *mock.Call +} + +// GetById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockConsumerProvidersInterface_Expecter) GetById(ctx interface{}, id interface{}) *MockConsumerProvidersInterface_GetById_Call { + return &MockConsumerProvidersInterface_GetById_Call{Call: _e.mock.On("GetById", ctx, id)} +} + +func (_c *MockConsumerProvidersInterface_GetById_Call) Run(run func(ctx context.Context, id string)) *MockConsumerProvidersInterface_GetById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockConsumerProvidersInterface_GetById_Call) Return(_a0 *marketplace.GetProviderResponse, _a1 error) *MockConsumerProvidersInterface_GetById_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerProvidersInterface_GetById_Call) RunAndReturn(run func(context.Context, string) (*marketplace.GetProviderResponse, error)) *MockConsumerProvidersInterface_GetById_Call { + _c.Call.Return(run) + return _c +} + +// GetByName provides a mock function with given fields: ctx, name +func (_m *MockConsumerProvidersInterface) GetByName(ctx context.Context, name string) (*marketplace.ProviderInfo, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetByName") + } + + var r0 *marketplace.ProviderInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.ProviderInfo, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.ProviderInfo); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.ProviderInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerProvidersInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' +type MockConsumerProvidersInterface_GetByName_Call struct { + *mock.Call +} + +// GetByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockConsumerProvidersInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockConsumerProvidersInterface_GetByName_Call { + return &MockConsumerProvidersInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} +} + +func (_c *MockConsumerProvidersInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockConsumerProvidersInterface_GetByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockConsumerProvidersInterface_GetByName_Call) Return(_a0 *marketplace.ProviderInfo, _a1 error) *MockConsumerProvidersInterface_GetByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerProvidersInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*marketplace.ProviderInfo, error)) *MockConsumerProvidersInterface_GetByName_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockConsumerProvidersInterface) Impl() marketplace.ConsumerProvidersService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ConsumerProvidersService + if rf, ok := ret.Get(0).(func() marketplace.ConsumerProvidersService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerProvidersService) + } + } + + return r0 +} + +// MockConsumerProvidersInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockConsumerProvidersInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockConsumerProvidersInterface_Expecter) Impl() *MockConsumerProvidersInterface_Impl_Call { + return &MockConsumerProvidersInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockConsumerProvidersInterface_Impl_Call) Run(run func()) *MockConsumerProvidersInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockConsumerProvidersInterface_Impl_Call) Return(_a0 marketplace.ConsumerProvidersService) *MockConsumerProvidersInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerProvidersInterface_Impl_Call) RunAndReturn(run func() marketplace.ConsumerProvidersService) *MockConsumerProvidersInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockConsumerProvidersInterface) List(ctx context.Context, request marketplace.ListProvidersRequest) listing.Iterator[marketplace.ProviderInfo] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.ProviderInfo] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) listing.Iterator[marketplace.ProviderInfo]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.ProviderInfo]) + } + } + + return r0 +} + +// MockConsumerProvidersInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockConsumerProvidersInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListProvidersRequest +func (_e *MockConsumerProvidersInterface_Expecter) List(ctx interface{}, request interface{}) *MockConsumerProvidersInterface_List_Call { + return &MockConsumerProvidersInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockConsumerProvidersInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListProvidersRequest)) *MockConsumerProvidersInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListProvidersRequest)) + }) + return _c +} + +func (_c *MockConsumerProvidersInterface_List_Call) Return(_a0 listing.Iterator[marketplace.ProviderInfo]) *MockConsumerProvidersInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerProvidersInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListProvidersRequest) listing.Iterator[marketplace.ProviderInfo]) *MockConsumerProvidersInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockConsumerProvidersInterface) ListAll(ctx context.Context, request marketplace.ListProvidersRequest) ([]marketplace.ProviderInfo, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.ProviderInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) ([]marketplace.ProviderInfo, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) []marketplace.ProviderInfo); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.ProviderInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListProvidersRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerProvidersInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockConsumerProvidersInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListProvidersRequest +func (_e *MockConsumerProvidersInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockConsumerProvidersInterface_ListAll_Call { + return &MockConsumerProvidersInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockConsumerProvidersInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListProvidersRequest)) *MockConsumerProvidersInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListProvidersRequest)) + }) + return _c +} + +func (_c *MockConsumerProvidersInterface_ListAll_Call) Return(_a0 []marketplace.ProviderInfo, _a1 error) *MockConsumerProvidersInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerProvidersInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListProvidersRequest) ([]marketplace.ProviderInfo, error)) *MockConsumerProvidersInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// ProviderInfoNameToIdMap provides a mock function with given fields: ctx, request +func (_m *MockConsumerProvidersInterface) ProviderInfoNameToIdMap(ctx context.Context, request marketplace.ListProvidersRequest) (map[string]string, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ProviderInfoNameToIdMap") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) (map[string]string, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) map[string]string); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListProvidersRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProviderInfoNameToIdMap' +type MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call struct { + *mock.Call +} + +// ProviderInfoNameToIdMap is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListProvidersRequest +func (_e *MockConsumerProvidersInterface_Expecter) ProviderInfoNameToIdMap(ctx interface{}, request interface{}) *MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call { + return &MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call{Call: _e.mock.On("ProviderInfoNameToIdMap", ctx, request)} +} + +func (_c *MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call) Run(run func(ctx context.Context, request marketplace.ListProvidersRequest)) *MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListProvidersRequest)) + }) + return _c +} + +func (_c *MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call) RunAndReturn(run func(context.Context, marketplace.ListProvidersRequest) (map[string]string, error)) *MockConsumerProvidersInterface_ProviderInfoNameToIdMap_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockConsumerProvidersInterface) WithImpl(impl marketplace.ConsumerProvidersService) marketplace.ConsumerProvidersInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ConsumerProvidersInterface + if rf, ok := ret.Get(0).(func(marketplace.ConsumerProvidersService) marketplace.ConsumerProvidersInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ConsumerProvidersInterface) + } + } + + return r0 +} + +// MockConsumerProvidersInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockConsumerProvidersInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ConsumerProvidersService +func (_e *MockConsumerProvidersInterface_Expecter) WithImpl(impl interface{}) *MockConsumerProvidersInterface_WithImpl_Call { + return &MockConsumerProvidersInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockConsumerProvidersInterface_WithImpl_Call) Run(run func(impl marketplace.ConsumerProvidersService)) *MockConsumerProvidersInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ConsumerProvidersService)) + }) + return _c +} + +func (_c *MockConsumerProvidersInterface_WithImpl_Call) Return(_a0 marketplace.ConsumerProvidersInterface) *MockConsumerProvidersInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockConsumerProvidersInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ConsumerProvidersService) marketplace.ConsumerProvidersInterface) *MockConsumerProvidersInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockConsumerProvidersInterface creates a new instance of MockConsumerProvidersInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockConsumerProvidersInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockConsumerProvidersInterface { + mock := &MockConsumerProvidersInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_provider_exchange_filters_interface.go b/experimental/mocks/service/marketplace/mock_provider_exchange_filters_interface.go new file mode 100644 index 000000000..ba0e720dd --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_provider_exchange_filters_interface.go @@ -0,0 +1,572 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockProviderExchangeFiltersInterface is an autogenerated mock type for the ProviderExchangeFiltersInterface type +type MockProviderExchangeFiltersInterface struct { + mock.Mock +} + +type MockProviderExchangeFiltersInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockProviderExchangeFiltersInterface) EXPECT() *MockProviderExchangeFiltersInterface_Expecter { + return &MockProviderExchangeFiltersInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangeFiltersInterface) Create(ctx context.Context, request marketplace.CreateExchangeFilterRequest) (*marketplace.CreateExchangeFilterResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *marketplace.CreateExchangeFilterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateExchangeFilterRequest) (*marketplace.CreateExchangeFilterResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateExchangeFilterRequest) *marketplace.CreateExchangeFilterResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.CreateExchangeFilterResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.CreateExchangeFilterRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangeFiltersInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockProviderExchangeFiltersInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.CreateExchangeFilterRequest +func (_e *MockProviderExchangeFiltersInterface_Expecter) Create(ctx interface{}, request interface{}) *MockProviderExchangeFiltersInterface_Create_Call { + return &MockProviderExchangeFiltersInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockProviderExchangeFiltersInterface_Create_Call) Run(run func(ctx context.Context, request marketplace.CreateExchangeFilterRequest)) *MockProviderExchangeFiltersInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.CreateExchangeFilterRequest)) + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_Create_Call) Return(_a0 *marketplace.CreateExchangeFilterResponse, _a1 error) *MockProviderExchangeFiltersInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_Create_Call) RunAndReturn(run func(context.Context, marketplace.CreateExchangeFilterRequest) (*marketplace.CreateExchangeFilterResponse, error)) *MockProviderExchangeFiltersInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangeFiltersInterface) Delete(ctx context.Context, request marketplace.DeleteExchangeFilterRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.DeleteExchangeFilterRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderExchangeFiltersInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockProviderExchangeFiltersInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.DeleteExchangeFilterRequest +func (_e *MockProviderExchangeFiltersInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockProviderExchangeFiltersInterface_Delete_Call { + return &MockProviderExchangeFiltersInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockProviderExchangeFiltersInterface_Delete_Call) Run(run func(ctx context.Context, request marketplace.DeleteExchangeFilterRequest)) *MockProviderExchangeFiltersInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.DeleteExchangeFilterRequest)) + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_Delete_Call) Return(_a0 error) *MockProviderExchangeFiltersInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_Delete_Call) RunAndReturn(run func(context.Context, marketplace.DeleteExchangeFilterRequest) error) *MockProviderExchangeFiltersInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteById provides a mock function with given fields: ctx, id +func (_m *MockProviderExchangeFiltersInterface) DeleteById(ctx context.Context, id string) error { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for DeleteById") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderExchangeFiltersInterface_DeleteById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteById' +type MockProviderExchangeFiltersInterface_DeleteById_Call struct { + *mock.Call +} + +// DeleteById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockProviderExchangeFiltersInterface_Expecter) DeleteById(ctx interface{}, id interface{}) *MockProviderExchangeFiltersInterface_DeleteById_Call { + return &MockProviderExchangeFiltersInterface_DeleteById_Call{Call: _e.mock.On("DeleteById", ctx, id)} +} + +func (_c *MockProviderExchangeFiltersInterface_DeleteById_Call) Run(run func(ctx context.Context, id string)) *MockProviderExchangeFiltersInterface_DeleteById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_DeleteById_Call) Return(_a0 error) *MockProviderExchangeFiltersInterface_DeleteById_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_DeleteById_Call) RunAndReturn(run func(context.Context, string) error) *MockProviderExchangeFiltersInterface_DeleteById_Call { + _c.Call.Return(run) + return _c +} + +// ExchangeFilterNameToIdMap provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangeFiltersInterface) ExchangeFilterNameToIdMap(ctx context.Context, request marketplace.ListExchangeFiltersRequest) (map[string]string, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ExchangeFilterNameToIdMap") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangeFiltersRequest) (map[string]string, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangeFiltersRequest) map[string]string); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListExchangeFiltersRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExchangeFilterNameToIdMap' +type MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call struct { + *mock.Call +} + +// ExchangeFilterNameToIdMap is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListExchangeFiltersRequest +func (_e *MockProviderExchangeFiltersInterface_Expecter) ExchangeFilterNameToIdMap(ctx interface{}, request interface{}) *MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call { + return &MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call{Call: _e.mock.On("ExchangeFilterNameToIdMap", ctx, request)} +} + +func (_c *MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call) Run(run func(ctx context.Context, request marketplace.ListExchangeFiltersRequest)) *MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListExchangeFiltersRequest)) + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call) RunAndReturn(run func(context.Context, marketplace.ListExchangeFiltersRequest) (map[string]string, error)) *MockProviderExchangeFiltersInterface_ExchangeFilterNameToIdMap_Call { + _c.Call.Return(run) + return _c +} + +// GetByName provides a mock function with given fields: ctx, name +func (_m *MockProviderExchangeFiltersInterface) GetByName(ctx context.Context, name string) (*marketplace.ExchangeFilter, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetByName") + } + + var r0 *marketplace.ExchangeFilter + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.ExchangeFilter, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.ExchangeFilter); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.ExchangeFilter) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangeFiltersInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' +type MockProviderExchangeFiltersInterface_GetByName_Call struct { + *mock.Call +} + +// GetByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockProviderExchangeFiltersInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockProviderExchangeFiltersInterface_GetByName_Call { + return &MockProviderExchangeFiltersInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} +} + +func (_c *MockProviderExchangeFiltersInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockProviderExchangeFiltersInterface_GetByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_GetByName_Call) Return(_a0 *marketplace.ExchangeFilter, _a1 error) *MockProviderExchangeFiltersInterface_GetByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*marketplace.ExchangeFilter, error)) *MockProviderExchangeFiltersInterface_GetByName_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockProviderExchangeFiltersInterface) Impl() marketplace.ProviderExchangeFiltersService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ProviderExchangeFiltersService + if rf, ok := ret.Get(0).(func() marketplace.ProviderExchangeFiltersService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderExchangeFiltersService) + } + } + + return r0 +} + +// MockProviderExchangeFiltersInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockProviderExchangeFiltersInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockProviderExchangeFiltersInterface_Expecter) Impl() *MockProviderExchangeFiltersInterface_Impl_Call { + return &MockProviderExchangeFiltersInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockProviderExchangeFiltersInterface_Impl_Call) Run(run func()) *MockProviderExchangeFiltersInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_Impl_Call) Return(_a0 marketplace.ProviderExchangeFiltersService) *MockProviderExchangeFiltersInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_Impl_Call) RunAndReturn(run func() marketplace.ProviderExchangeFiltersService) *MockProviderExchangeFiltersInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangeFiltersInterface) List(ctx context.Context, request marketplace.ListExchangeFiltersRequest) listing.Iterator[marketplace.ExchangeFilter] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.ExchangeFilter] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangeFiltersRequest) listing.Iterator[marketplace.ExchangeFilter]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.ExchangeFilter]) + } + } + + return r0 +} + +// MockProviderExchangeFiltersInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockProviderExchangeFiltersInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListExchangeFiltersRequest +func (_e *MockProviderExchangeFiltersInterface_Expecter) List(ctx interface{}, request interface{}) *MockProviderExchangeFiltersInterface_List_Call { + return &MockProviderExchangeFiltersInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockProviderExchangeFiltersInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListExchangeFiltersRequest)) *MockProviderExchangeFiltersInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListExchangeFiltersRequest)) + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_List_Call) Return(_a0 listing.Iterator[marketplace.ExchangeFilter]) *MockProviderExchangeFiltersInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListExchangeFiltersRequest) listing.Iterator[marketplace.ExchangeFilter]) *MockProviderExchangeFiltersInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangeFiltersInterface) ListAll(ctx context.Context, request marketplace.ListExchangeFiltersRequest) ([]marketplace.ExchangeFilter, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.ExchangeFilter + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangeFiltersRequest) ([]marketplace.ExchangeFilter, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangeFiltersRequest) []marketplace.ExchangeFilter); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.ExchangeFilter) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListExchangeFiltersRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangeFiltersInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockProviderExchangeFiltersInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListExchangeFiltersRequest +func (_e *MockProviderExchangeFiltersInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockProviderExchangeFiltersInterface_ListAll_Call { + return &MockProviderExchangeFiltersInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockProviderExchangeFiltersInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListExchangeFiltersRequest)) *MockProviderExchangeFiltersInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListExchangeFiltersRequest)) + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_ListAll_Call) Return(_a0 []marketplace.ExchangeFilter, _a1 error) *MockProviderExchangeFiltersInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListExchangeFiltersRequest) ([]marketplace.ExchangeFilter, error)) *MockProviderExchangeFiltersInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangeFiltersInterface) Update(ctx context.Context, request marketplace.UpdateExchangeFilterRequest) (*marketplace.UpdateExchangeFilterResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *marketplace.UpdateExchangeFilterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateExchangeFilterRequest) (*marketplace.UpdateExchangeFilterResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateExchangeFilterRequest) *marketplace.UpdateExchangeFilterResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.UpdateExchangeFilterResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.UpdateExchangeFilterRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangeFiltersInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockProviderExchangeFiltersInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.UpdateExchangeFilterRequest +func (_e *MockProviderExchangeFiltersInterface_Expecter) Update(ctx interface{}, request interface{}) *MockProviderExchangeFiltersInterface_Update_Call { + return &MockProviderExchangeFiltersInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockProviderExchangeFiltersInterface_Update_Call) Run(run func(ctx context.Context, request marketplace.UpdateExchangeFilterRequest)) *MockProviderExchangeFiltersInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.UpdateExchangeFilterRequest)) + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_Update_Call) Return(_a0 *marketplace.UpdateExchangeFilterResponse, _a1 error) *MockProviderExchangeFiltersInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_Update_Call) RunAndReturn(run func(context.Context, marketplace.UpdateExchangeFilterRequest) (*marketplace.UpdateExchangeFilterResponse, error)) *MockProviderExchangeFiltersInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockProviderExchangeFiltersInterface) WithImpl(impl marketplace.ProviderExchangeFiltersService) marketplace.ProviderExchangeFiltersInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ProviderExchangeFiltersInterface + if rf, ok := ret.Get(0).(func(marketplace.ProviderExchangeFiltersService) marketplace.ProviderExchangeFiltersInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderExchangeFiltersInterface) + } + } + + return r0 +} + +// MockProviderExchangeFiltersInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockProviderExchangeFiltersInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ProviderExchangeFiltersService +func (_e *MockProviderExchangeFiltersInterface_Expecter) WithImpl(impl interface{}) *MockProviderExchangeFiltersInterface_WithImpl_Call { + return &MockProviderExchangeFiltersInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockProviderExchangeFiltersInterface_WithImpl_Call) Run(run func(impl marketplace.ProviderExchangeFiltersService)) *MockProviderExchangeFiltersInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ProviderExchangeFiltersService)) + }) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_WithImpl_Call) Return(_a0 marketplace.ProviderExchangeFiltersInterface) *MockProviderExchangeFiltersInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangeFiltersInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ProviderExchangeFiltersService) marketplace.ProviderExchangeFiltersInterface) *MockProviderExchangeFiltersInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockProviderExchangeFiltersInterface creates a new instance of MockProviderExchangeFiltersInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockProviderExchangeFiltersInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockProviderExchangeFiltersInterface { + mock := &MockProviderExchangeFiltersInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_provider_exchanges_interface.go b/experimental/mocks/service/marketplace/mock_provider_exchanges_interface.go new file mode 100644 index 000000000..5c28645cb --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_provider_exchanges_interface.go @@ -0,0 +1,1295 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockProviderExchangesInterface is an autogenerated mock type for the ProviderExchangesInterface type +type MockProviderExchangesInterface struct { + mock.Mock +} + +type MockProviderExchangesInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockProviderExchangesInterface) EXPECT() *MockProviderExchangesInterface_Expecter { + return &MockProviderExchangesInterface_Expecter{mock: &_m.Mock} +} + +// AddListingToExchange provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) AddListingToExchange(ctx context.Context, request marketplace.AddExchangeForListingRequest) (*marketplace.AddExchangeForListingResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for AddListingToExchange") + } + + var r0 *marketplace.AddExchangeForListingResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.AddExchangeForListingRequest) (*marketplace.AddExchangeForListingResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.AddExchangeForListingRequest) *marketplace.AddExchangeForListingResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.AddExchangeForListingResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.AddExchangeForListingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_AddListingToExchange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddListingToExchange' +type MockProviderExchangesInterface_AddListingToExchange_Call struct { + *mock.Call +} + +// AddListingToExchange is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.AddExchangeForListingRequest +func (_e *MockProviderExchangesInterface_Expecter) AddListingToExchange(ctx interface{}, request interface{}) *MockProviderExchangesInterface_AddListingToExchange_Call { + return &MockProviderExchangesInterface_AddListingToExchange_Call{Call: _e.mock.On("AddListingToExchange", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_AddListingToExchange_Call) Run(run func(ctx context.Context, request marketplace.AddExchangeForListingRequest)) *MockProviderExchangesInterface_AddListingToExchange_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.AddExchangeForListingRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_AddListingToExchange_Call) Return(_a0 *marketplace.AddExchangeForListingResponse, _a1 error) *MockProviderExchangesInterface_AddListingToExchange_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_AddListingToExchange_Call) RunAndReturn(run func(context.Context, marketplace.AddExchangeForListingRequest) (*marketplace.AddExchangeForListingResponse, error)) *MockProviderExchangesInterface_AddListingToExchange_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) Create(ctx context.Context, request marketplace.CreateExchangeRequest) (*marketplace.CreateExchangeResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *marketplace.CreateExchangeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateExchangeRequest) (*marketplace.CreateExchangeResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateExchangeRequest) *marketplace.CreateExchangeResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.CreateExchangeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.CreateExchangeRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockProviderExchangesInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.CreateExchangeRequest +func (_e *MockProviderExchangesInterface_Expecter) Create(ctx interface{}, request interface{}) *MockProviderExchangesInterface_Create_Call { + return &MockProviderExchangesInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_Create_Call) Run(run func(ctx context.Context, request marketplace.CreateExchangeRequest)) *MockProviderExchangesInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.CreateExchangeRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_Create_Call) Return(_a0 *marketplace.CreateExchangeResponse, _a1 error) *MockProviderExchangesInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_Create_Call) RunAndReturn(run func(context.Context, marketplace.CreateExchangeRequest) (*marketplace.CreateExchangeResponse, error)) *MockProviderExchangesInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) Delete(ctx context.Context, request marketplace.DeleteExchangeRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.DeleteExchangeRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderExchangesInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockProviderExchangesInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.DeleteExchangeRequest +func (_e *MockProviderExchangesInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockProviderExchangesInterface_Delete_Call { + return &MockProviderExchangesInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_Delete_Call) Run(run func(ctx context.Context, request marketplace.DeleteExchangeRequest)) *MockProviderExchangesInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.DeleteExchangeRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_Delete_Call) Return(_a0 error) *MockProviderExchangesInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangesInterface_Delete_Call) RunAndReturn(run func(context.Context, marketplace.DeleteExchangeRequest) error) *MockProviderExchangesInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteById provides a mock function with given fields: ctx, id +func (_m *MockProviderExchangesInterface) DeleteById(ctx context.Context, id string) error { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for DeleteById") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderExchangesInterface_DeleteById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteById' +type MockProviderExchangesInterface_DeleteById_Call struct { + *mock.Call +} + +// DeleteById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockProviderExchangesInterface_Expecter) DeleteById(ctx interface{}, id interface{}) *MockProviderExchangesInterface_DeleteById_Call { + return &MockProviderExchangesInterface_DeleteById_Call{Call: _e.mock.On("DeleteById", ctx, id)} +} + +func (_c *MockProviderExchangesInterface_DeleteById_Call) Run(run func(ctx context.Context, id string)) *MockProviderExchangesInterface_DeleteById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_DeleteById_Call) Return(_a0 error) *MockProviderExchangesInterface_DeleteById_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangesInterface_DeleteById_Call) RunAndReturn(run func(context.Context, string) error) *MockProviderExchangesInterface_DeleteById_Call { + _c.Call.Return(run) + return _c +} + +// DeleteListingFromExchange provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) DeleteListingFromExchange(ctx context.Context, request marketplace.RemoveExchangeForListingRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteListingFromExchange") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.RemoveExchangeForListingRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderExchangesInterface_DeleteListingFromExchange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteListingFromExchange' +type MockProviderExchangesInterface_DeleteListingFromExchange_Call struct { + *mock.Call +} + +// DeleteListingFromExchange is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.RemoveExchangeForListingRequest +func (_e *MockProviderExchangesInterface_Expecter) DeleteListingFromExchange(ctx interface{}, request interface{}) *MockProviderExchangesInterface_DeleteListingFromExchange_Call { + return &MockProviderExchangesInterface_DeleteListingFromExchange_Call{Call: _e.mock.On("DeleteListingFromExchange", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_DeleteListingFromExchange_Call) Run(run func(ctx context.Context, request marketplace.RemoveExchangeForListingRequest)) *MockProviderExchangesInterface_DeleteListingFromExchange_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.RemoveExchangeForListingRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_DeleteListingFromExchange_Call) Return(_a0 error) *MockProviderExchangesInterface_DeleteListingFromExchange_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangesInterface_DeleteListingFromExchange_Call) RunAndReturn(run func(context.Context, marketplace.RemoveExchangeForListingRequest) error) *MockProviderExchangesInterface_DeleteListingFromExchange_Call { + _c.Call.Return(run) + return _c +} + +// DeleteListingFromExchangeById provides a mock function with given fields: ctx, id +func (_m *MockProviderExchangesInterface) DeleteListingFromExchangeById(ctx context.Context, id string) error { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for DeleteListingFromExchangeById") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderExchangesInterface_DeleteListingFromExchangeById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteListingFromExchangeById' +type MockProviderExchangesInterface_DeleteListingFromExchangeById_Call struct { + *mock.Call +} + +// DeleteListingFromExchangeById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockProviderExchangesInterface_Expecter) DeleteListingFromExchangeById(ctx interface{}, id interface{}) *MockProviderExchangesInterface_DeleteListingFromExchangeById_Call { + return &MockProviderExchangesInterface_DeleteListingFromExchangeById_Call{Call: _e.mock.On("DeleteListingFromExchangeById", ctx, id)} +} + +func (_c *MockProviderExchangesInterface_DeleteListingFromExchangeById_Call) Run(run func(ctx context.Context, id string)) *MockProviderExchangesInterface_DeleteListingFromExchangeById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_DeleteListingFromExchangeById_Call) Return(_a0 error) *MockProviderExchangesInterface_DeleteListingFromExchangeById_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangesInterface_DeleteListingFromExchangeById_Call) RunAndReturn(run func(context.Context, string) error) *MockProviderExchangesInterface_DeleteListingFromExchangeById_Call { + _c.Call.Return(run) + return _c +} + +// ExchangeListingExchangeNameToExchangeIdMap provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) ExchangeListingExchangeNameToExchangeIdMap(ctx context.Context, request marketplace.ListExchangesForListingRequest) (map[string]string, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ExchangeListingExchangeNameToExchangeIdMap") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesForListingRequest) (map[string]string, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesForListingRequest) map[string]string); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListExchangesForListingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExchangeListingExchangeNameToExchangeIdMap' +type MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call struct { + *mock.Call +} + +// ExchangeListingExchangeNameToExchangeIdMap is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListExchangesForListingRequest +func (_e *MockProviderExchangesInterface_Expecter) ExchangeListingExchangeNameToExchangeIdMap(ctx interface{}, request interface{}) *MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call { + return &MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call{Call: _e.mock.On("ExchangeListingExchangeNameToExchangeIdMap", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call) Run(run func(ctx context.Context, request marketplace.ListExchangesForListingRequest)) *MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListExchangesForListingRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call) RunAndReturn(run func(context.Context, marketplace.ListExchangesForListingRequest) (map[string]string, error)) *MockProviderExchangesInterface_ExchangeListingExchangeNameToExchangeIdMap_Call { + _c.Call.Return(run) + return _c +} + +// ExchangeListingListingNameToListingIdMap provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) ExchangeListingListingNameToListingIdMap(ctx context.Context, request marketplace.ListListingsForExchangeRequest) (map[string]string, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ExchangeListingListingNameToListingIdMap") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsForExchangeRequest) (map[string]string, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsForExchangeRequest) map[string]string); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListListingsForExchangeRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExchangeListingListingNameToListingIdMap' +type MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call struct { + *mock.Call +} + +// ExchangeListingListingNameToListingIdMap is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListListingsForExchangeRequest +func (_e *MockProviderExchangesInterface_Expecter) ExchangeListingListingNameToListingIdMap(ctx interface{}, request interface{}) *MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call { + return &MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call{Call: _e.mock.On("ExchangeListingListingNameToListingIdMap", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call) Run(run func(ctx context.Context, request marketplace.ListListingsForExchangeRequest)) *MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListListingsForExchangeRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call) RunAndReturn(run func(context.Context, marketplace.ListListingsForExchangeRequest) (map[string]string, error)) *MockProviderExchangesInterface_ExchangeListingListingNameToListingIdMap_Call { + _c.Call.Return(run) + return _c +} + +// ExchangeNameToIdMap provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) ExchangeNameToIdMap(ctx context.Context, request marketplace.ListExchangesRequest) (map[string]string, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ExchangeNameToIdMap") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesRequest) (map[string]string, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesRequest) map[string]string); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListExchangesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_ExchangeNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExchangeNameToIdMap' +type MockProviderExchangesInterface_ExchangeNameToIdMap_Call struct { + *mock.Call +} + +// ExchangeNameToIdMap is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListExchangesRequest +func (_e *MockProviderExchangesInterface_Expecter) ExchangeNameToIdMap(ctx interface{}, request interface{}) *MockProviderExchangesInterface_ExchangeNameToIdMap_Call { + return &MockProviderExchangesInterface_ExchangeNameToIdMap_Call{Call: _e.mock.On("ExchangeNameToIdMap", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_ExchangeNameToIdMap_Call) Run(run func(ctx context.Context, request marketplace.ListExchangesRequest)) *MockProviderExchangesInterface_ExchangeNameToIdMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListExchangesRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_ExchangeNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockProviderExchangesInterface_ExchangeNameToIdMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_ExchangeNameToIdMap_Call) RunAndReturn(run func(context.Context, marketplace.ListExchangesRequest) (map[string]string, error)) *MockProviderExchangesInterface_ExchangeNameToIdMap_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) Get(ctx context.Context, request marketplace.GetExchangeRequest) (*marketplace.GetExchangeResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *marketplace.GetExchangeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetExchangeRequest) (*marketplace.GetExchangeResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetExchangeRequest) *marketplace.GetExchangeResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetExchangeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetExchangeRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockProviderExchangesInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetExchangeRequest +func (_e *MockProviderExchangesInterface_Expecter) Get(ctx interface{}, request interface{}) *MockProviderExchangesInterface_Get_Call { + return &MockProviderExchangesInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_Get_Call) Run(run func(ctx context.Context, request marketplace.GetExchangeRequest)) *MockProviderExchangesInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetExchangeRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_Get_Call) Return(_a0 *marketplace.GetExchangeResponse, _a1 error) *MockProviderExchangesInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_Get_Call) RunAndReturn(run func(context.Context, marketplace.GetExchangeRequest) (*marketplace.GetExchangeResponse, error)) *MockProviderExchangesInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetByExchangeName provides a mock function with given fields: ctx, name +func (_m *MockProviderExchangesInterface) GetByExchangeName(ctx context.Context, name string) (*marketplace.ExchangeListing, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetByExchangeName") + } + + var r0 *marketplace.ExchangeListing + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.ExchangeListing, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.ExchangeListing); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.ExchangeListing) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_GetByExchangeName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByExchangeName' +type MockProviderExchangesInterface_GetByExchangeName_Call struct { + *mock.Call +} + +// GetByExchangeName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockProviderExchangesInterface_Expecter) GetByExchangeName(ctx interface{}, name interface{}) *MockProviderExchangesInterface_GetByExchangeName_Call { + return &MockProviderExchangesInterface_GetByExchangeName_Call{Call: _e.mock.On("GetByExchangeName", ctx, name)} +} + +func (_c *MockProviderExchangesInterface_GetByExchangeName_Call) Run(run func(ctx context.Context, name string)) *MockProviderExchangesInterface_GetByExchangeName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_GetByExchangeName_Call) Return(_a0 *marketplace.ExchangeListing, _a1 error) *MockProviderExchangesInterface_GetByExchangeName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_GetByExchangeName_Call) RunAndReturn(run func(context.Context, string) (*marketplace.ExchangeListing, error)) *MockProviderExchangesInterface_GetByExchangeName_Call { + _c.Call.Return(run) + return _c +} + +// GetById provides a mock function with given fields: ctx, id +func (_m *MockProviderExchangesInterface) GetById(ctx context.Context, id string) (*marketplace.GetExchangeResponse, error) { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for GetById") + } + + var r0 *marketplace.GetExchangeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.GetExchangeResponse, error)); ok { + return rf(ctx, id) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.GetExchangeResponse); ok { + r0 = rf(ctx, id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetExchangeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_GetById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetById' +type MockProviderExchangesInterface_GetById_Call struct { + *mock.Call +} + +// GetById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockProviderExchangesInterface_Expecter) GetById(ctx interface{}, id interface{}) *MockProviderExchangesInterface_GetById_Call { + return &MockProviderExchangesInterface_GetById_Call{Call: _e.mock.On("GetById", ctx, id)} +} + +func (_c *MockProviderExchangesInterface_GetById_Call) Run(run func(ctx context.Context, id string)) *MockProviderExchangesInterface_GetById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_GetById_Call) Return(_a0 *marketplace.GetExchangeResponse, _a1 error) *MockProviderExchangesInterface_GetById_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_GetById_Call) RunAndReturn(run func(context.Context, string) (*marketplace.GetExchangeResponse, error)) *MockProviderExchangesInterface_GetById_Call { + _c.Call.Return(run) + return _c +} + +// GetByListingName provides a mock function with given fields: ctx, name +func (_m *MockProviderExchangesInterface) GetByListingName(ctx context.Context, name string) (*marketplace.ExchangeListing, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetByListingName") + } + + var r0 *marketplace.ExchangeListing + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.ExchangeListing, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.ExchangeListing); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.ExchangeListing) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_GetByListingName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByListingName' +type MockProviderExchangesInterface_GetByListingName_Call struct { + *mock.Call +} + +// GetByListingName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockProviderExchangesInterface_Expecter) GetByListingName(ctx interface{}, name interface{}) *MockProviderExchangesInterface_GetByListingName_Call { + return &MockProviderExchangesInterface_GetByListingName_Call{Call: _e.mock.On("GetByListingName", ctx, name)} +} + +func (_c *MockProviderExchangesInterface_GetByListingName_Call) Run(run func(ctx context.Context, name string)) *MockProviderExchangesInterface_GetByListingName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_GetByListingName_Call) Return(_a0 *marketplace.ExchangeListing, _a1 error) *MockProviderExchangesInterface_GetByListingName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_GetByListingName_Call) RunAndReturn(run func(context.Context, string) (*marketplace.ExchangeListing, error)) *MockProviderExchangesInterface_GetByListingName_Call { + _c.Call.Return(run) + return _c +} + +// GetByName provides a mock function with given fields: ctx, name +func (_m *MockProviderExchangesInterface) GetByName(ctx context.Context, name string) (*marketplace.Exchange, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetByName") + } + + var r0 *marketplace.Exchange + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.Exchange, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.Exchange); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.Exchange) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' +type MockProviderExchangesInterface_GetByName_Call struct { + *mock.Call +} + +// GetByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockProviderExchangesInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockProviderExchangesInterface_GetByName_Call { + return &MockProviderExchangesInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} +} + +func (_c *MockProviderExchangesInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockProviderExchangesInterface_GetByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_GetByName_Call) Return(_a0 *marketplace.Exchange, _a1 error) *MockProviderExchangesInterface_GetByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*marketplace.Exchange, error)) *MockProviderExchangesInterface_GetByName_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockProviderExchangesInterface) Impl() marketplace.ProviderExchangesService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ProviderExchangesService + if rf, ok := ret.Get(0).(func() marketplace.ProviderExchangesService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderExchangesService) + } + } + + return r0 +} + +// MockProviderExchangesInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockProviderExchangesInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockProviderExchangesInterface_Expecter) Impl() *MockProviderExchangesInterface_Impl_Call { + return &MockProviderExchangesInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockProviderExchangesInterface_Impl_Call) Run(run func()) *MockProviderExchangesInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockProviderExchangesInterface_Impl_Call) Return(_a0 marketplace.ProviderExchangesService) *MockProviderExchangesInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangesInterface_Impl_Call) RunAndReturn(run func() marketplace.ProviderExchangesService) *MockProviderExchangesInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) List(ctx context.Context, request marketplace.ListExchangesRequest) listing.Iterator[marketplace.Exchange] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.Exchange] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesRequest) listing.Iterator[marketplace.Exchange]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.Exchange]) + } + } + + return r0 +} + +// MockProviderExchangesInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockProviderExchangesInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListExchangesRequest +func (_e *MockProviderExchangesInterface_Expecter) List(ctx interface{}, request interface{}) *MockProviderExchangesInterface_List_Call { + return &MockProviderExchangesInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListExchangesRequest)) *MockProviderExchangesInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListExchangesRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_List_Call) Return(_a0 listing.Iterator[marketplace.Exchange]) *MockProviderExchangesInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangesInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListExchangesRequest) listing.Iterator[marketplace.Exchange]) *MockProviderExchangesInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) ListAll(ctx context.Context, request marketplace.ListExchangesRequest) ([]marketplace.Exchange, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.Exchange + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesRequest) ([]marketplace.Exchange, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesRequest) []marketplace.Exchange); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.Exchange) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListExchangesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockProviderExchangesInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListExchangesRequest +func (_e *MockProviderExchangesInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockProviderExchangesInterface_ListAll_Call { + return &MockProviderExchangesInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListExchangesRequest)) *MockProviderExchangesInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListExchangesRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_ListAll_Call) Return(_a0 []marketplace.Exchange, _a1 error) *MockProviderExchangesInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListExchangesRequest) ([]marketplace.Exchange, error)) *MockProviderExchangesInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// ListExchangesForListing provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) ListExchangesForListing(ctx context.Context, request marketplace.ListExchangesForListingRequest) listing.Iterator[marketplace.ExchangeListing] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListExchangesForListing") + } + + var r0 listing.Iterator[marketplace.ExchangeListing] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesForListingRequest) listing.Iterator[marketplace.ExchangeListing]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.ExchangeListing]) + } + } + + return r0 +} + +// MockProviderExchangesInterface_ListExchangesForListing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListExchangesForListing' +type MockProviderExchangesInterface_ListExchangesForListing_Call struct { + *mock.Call +} + +// ListExchangesForListing is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListExchangesForListingRequest +func (_e *MockProviderExchangesInterface_Expecter) ListExchangesForListing(ctx interface{}, request interface{}) *MockProviderExchangesInterface_ListExchangesForListing_Call { + return &MockProviderExchangesInterface_ListExchangesForListing_Call{Call: _e.mock.On("ListExchangesForListing", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_ListExchangesForListing_Call) Run(run func(ctx context.Context, request marketplace.ListExchangesForListingRequest)) *MockProviderExchangesInterface_ListExchangesForListing_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListExchangesForListingRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_ListExchangesForListing_Call) Return(_a0 listing.Iterator[marketplace.ExchangeListing]) *MockProviderExchangesInterface_ListExchangesForListing_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangesInterface_ListExchangesForListing_Call) RunAndReturn(run func(context.Context, marketplace.ListExchangesForListingRequest) listing.Iterator[marketplace.ExchangeListing]) *MockProviderExchangesInterface_ListExchangesForListing_Call { + _c.Call.Return(run) + return _c +} + +// ListExchangesForListingAll provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) ListExchangesForListingAll(ctx context.Context, request marketplace.ListExchangesForListingRequest) ([]marketplace.ExchangeListing, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListExchangesForListingAll") + } + + var r0 []marketplace.ExchangeListing + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesForListingRequest) ([]marketplace.ExchangeListing, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListExchangesForListingRequest) []marketplace.ExchangeListing); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.ExchangeListing) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListExchangesForListingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_ListExchangesForListingAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListExchangesForListingAll' +type MockProviderExchangesInterface_ListExchangesForListingAll_Call struct { + *mock.Call +} + +// ListExchangesForListingAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListExchangesForListingRequest +func (_e *MockProviderExchangesInterface_Expecter) ListExchangesForListingAll(ctx interface{}, request interface{}) *MockProviderExchangesInterface_ListExchangesForListingAll_Call { + return &MockProviderExchangesInterface_ListExchangesForListingAll_Call{Call: _e.mock.On("ListExchangesForListingAll", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_ListExchangesForListingAll_Call) Run(run func(ctx context.Context, request marketplace.ListExchangesForListingRequest)) *MockProviderExchangesInterface_ListExchangesForListingAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListExchangesForListingRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_ListExchangesForListingAll_Call) Return(_a0 []marketplace.ExchangeListing, _a1 error) *MockProviderExchangesInterface_ListExchangesForListingAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_ListExchangesForListingAll_Call) RunAndReturn(run func(context.Context, marketplace.ListExchangesForListingRequest) ([]marketplace.ExchangeListing, error)) *MockProviderExchangesInterface_ListExchangesForListingAll_Call { + _c.Call.Return(run) + return _c +} + +// ListListingsForExchange provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) ListListingsForExchange(ctx context.Context, request marketplace.ListListingsForExchangeRequest) listing.Iterator[marketplace.ExchangeListing] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListListingsForExchange") + } + + var r0 listing.Iterator[marketplace.ExchangeListing] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsForExchangeRequest) listing.Iterator[marketplace.ExchangeListing]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.ExchangeListing]) + } + } + + return r0 +} + +// MockProviderExchangesInterface_ListListingsForExchange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListListingsForExchange' +type MockProviderExchangesInterface_ListListingsForExchange_Call struct { + *mock.Call +} + +// ListListingsForExchange is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListListingsForExchangeRequest +func (_e *MockProviderExchangesInterface_Expecter) ListListingsForExchange(ctx interface{}, request interface{}) *MockProviderExchangesInterface_ListListingsForExchange_Call { + return &MockProviderExchangesInterface_ListListingsForExchange_Call{Call: _e.mock.On("ListListingsForExchange", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_ListListingsForExchange_Call) Run(run func(ctx context.Context, request marketplace.ListListingsForExchangeRequest)) *MockProviderExchangesInterface_ListListingsForExchange_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListListingsForExchangeRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_ListListingsForExchange_Call) Return(_a0 listing.Iterator[marketplace.ExchangeListing]) *MockProviderExchangesInterface_ListListingsForExchange_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangesInterface_ListListingsForExchange_Call) RunAndReturn(run func(context.Context, marketplace.ListListingsForExchangeRequest) listing.Iterator[marketplace.ExchangeListing]) *MockProviderExchangesInterface_ListListingsForExchange_Call { + _c.Call.Return(run) + return _c +} + +// ListListingsForExchangeAll provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) ListListingsForExchangeAll(ctx context.Context, request marketplace.ListListingsForExchangeRequest) ([]marketplace.ExchangeListing, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListListingsForExchangeAll") + } + + var r0 []marketplace.ExchangeListing + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsForExchangeRequest) ([]marketplace.ExchangeListing, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListListingsForExchangeRequest) []marketplace.ExchangeListing); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.ExchangeListing) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListListingsForExchangeRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_ListListingsForExchangeAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListListingsForExchangeAll' +type MockProviderExchangesInterface_ListListingsForExchangeAll_Call struct { + *mock.Call +} + +// ListListingsForExchangeAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListListingsForExchangeRequest +func (_e *MockProviderExchangesInterface_Expecter) ListListingsForExchangeAll(ctx interface{}, request interface{}) *MockProviderExchangesInterface_ListListingsForExchangeAll_Call { + return &MockProviderExchangesInterface_ListListingsForExchangeAll_Call{Call: _e.mock.On("ListListingsForExchangeAll", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_ListListingsForExchangeAll_Call) Run(run func(ctx context.Context, request marketplace.ListListingsForExchangeRequest)) *MockProviderExchangesInterface_ListListingsForExchangeAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListListingsForExchangeRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_ListListingsForExchangeAll_Call) Return(_a0 []marketplace.ExchangeListing, _a1 error) *MockProviderExchangesInterface_ListListingsForExchangeAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_ListListingsForExchangeAll_Call) RunAndReturn(run func(context.Context, marketplace.ListListingsForExchangeRequest) ([]marketplace.ExchangeListing, error)) *MockProviderExchangesInterface_ListListingsForExchangeAll_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockProviderExchangesInterface) Update(ctx context.Context, request marketplace.UpdateExchangeRequest) (*marketplace.UpdateExchangeResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *marketplace.UpdateExchangeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateExchangeRequest) (*marketplace.UpdateExchangeResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateExchangeRequest) *marketplace.UpdateExchangeResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.UpdateExchangeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.UpdateExchangeRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderExchangesInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockProviderExchangesInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.UpdateExchangeRequest +func (_e *MockProviderExchangesInterface_Expecter) Update(ctx interface{}, request interface{}) *MockProviderExchangesInterface_Update_Call { + return &MockProviderExchangesInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockProviderExchangesInterface_Update_Call) Run(run func(ctx context.Context, request marketplace.UpdateExchangeRequest)) *MockProviderExchangesInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.UpdateExchangeRequest)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_Update_Call) Return(_a0 *marketplace.UpdateExchangeResponse, _a1 error) *MockProviderExchangesInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderExchangesInterface_Update_Call) RunAndReturn(run func(context.Context, marketplace.UpdateExchangeRequest) (*marketplace.UpdateExchangeResponse, error)) *MockProviderExchangesInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockProviderExchangesInterface) WithImpl(impl marketplace.ProviderExchangesService) marketplace.ProviderExchangesInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ProviderExchangesInterface + if rf, ok := ret.Get(0).(func(marketplace.ProviderExchangesService) marketplace.ProviderExchangesInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderExchangesInterface) + } + } + + return r0 +} + +// MockProviderExchangesInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockProviderExchangesInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ProviderExchangesService +func (_e *MockProviderExchangesInterface_Expecter) WithImpl(impl interface{}) *MockProviderExchangesInterface_WithImpl_Call { + return &MockProviderExchangesInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockProviderExchangesInterface_WithImpl_Call) Run(run func(impl marketplace.ProviderExchangesService)) *MockProviderExchangesInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ProviderExchangesService)) + }) + return _c +} + +func (_c *MockProviderExchangesInterface_WithImpl_Call) Return(_a0 marketplace.ProviderExchangesInterface) *MockProviderExchangesInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderExchangesInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ProviderExchangesService) marketplace.ProviderExchangesInterface) *MockProviderExchangesInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockProviderExchangesInterface creates a new instance of MockProviderExchangesInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockProviderExchangesInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockProviderExchangesInterface { + mock := &MockProviderExchangesInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_provider_files_interface.go b/experimental/mocks/service/marketplace/mock_provider_files_interface.go new file mode 100644 index 000000000..ca9004d88 --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_provider_files_interface.go @@ -0,0 +1,631 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockProviderFilesInterface is an autogenerated mock type for the ProviderFilesInterface type +type MockProviderFilesInterface struct { + mock.Mock +} + +type MockProviderFilesInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockProviderFilesInterface) EXPECT() *MockProviderFilesInterface_Expecter { + return &MockProviderFilesInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockProviderFilesInterface) Create(ctx context.Context, request marketplace.CreateFileRequest) (*marketplace.CreateFileResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *marketplace.CreateFileResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateFileRequest) (*marketplace.CreateFileResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateFileRequest) *marketplace.CreateFileResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.CreateFileResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.CreateFileRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderFilesInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockProviderFilesInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.CreateFileRequest +func (_e *MockProviderFilesInterface_Expecter) Create(ctx interface{}, request interface{}) *MockProviderFilesInterface_Create_Call { + return &MockProviderFilesInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockProviderFilesInterface_Create_Call) Run(run func(ctx context.Context, request marketplace.CreateFileRequest)) *MockProviderFilesInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.CreateFileRequest)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_Create_Call) Return(_a0 *marketplace.CreateFileResponse, _a1 error) *MockProviderFilesInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderFilesInterface_Create_Call) RunAndReturn(run func(context.Context, marketplace.CreateFileRequest) (*marketplace.CreateFileResponse, error)) *MockProviderFilesInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockProviderFilesInterface) Delete(ctx context.Context, request marketplace.DeleteFileRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.DeleteFileRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderFilesInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockProviderFilesInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.DeleteFileRequest +func (_e *MockProviderFilesInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockProviderFilesInterface_Delete_Call { + return &MockProviderFilesInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockProviderFilesInterface_Delete_Call) Run(run func(ctx context.Context, request marketplace.DeleteFileRequest)) *MockProviderFilesInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.DeleteFileRequest)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_Delete_Call) Return(_a0 error) *MockProviderFilesInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderFilesInterface_Delete_Call) RunAndReturn(run func(context.Context, marketplace.DeleteFileRequest) error) *MockProviderFilesInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteByFileId provides a mock function with given fields: ctx, fileId +func (_m *MockProviderFilesInterface) DeleteByFileId(ctx context.Context, fileId string) error { + ret := _m.Called(ctx, fileId) + + if len(ret) == 0 { + panic("no return value specified for DeleteByFileId") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, fileId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderFilesInterface_DeleteByFileId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByFileId' +type MockProviderFilesInterface_DeleteByFileId_Call struct { + *mock.Call +} + +// DeleteByFileId is a helper method to define mock.On call +// - ctx context.Context +// - fileId string +func (_e *MockProviderFilesInterface_Expecter) DeleteByFileId(ctx interface{}, fileId interface{}) *MockProviderFilesInterface_DeleteByFileId_Call { + return &MockProviderFilesInterface_DeleteByFileId_Call{Call: _e.mock.On("DeleteByFileId", ctx, fileId)} +} + +func (_c *MockProviderFilesInterface_DeleteByFileId_Call) Run(run func(ctx context.Context, fileId string)) *MockProviderFilesInterface_DeleteByFileId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_DeleteByFileId_Call) Return(_a0 error) *MockProviderFilesInterface_DeleteByFileId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderFilesInterface_DeleteByFileId_Call) RunAndReturn(run func(context.Context, string) error) *MockProviderFilesInterface_DeleteByFileId_Call { + _c.Call.Return(run) + return _c +} + +// FileInfoDisplayNameToIdMap provides a mock function with given fields: ctx, request +func (_m *MockProviderFilesInterface) FileInfoDisplayNameToIdMap(ctx context.Context, request marketplace.ListFilesRequest) (map[string]string, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for FileInfoDisplayNameToIdMap") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListFilesRequest) (map[string]string, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListFilesRequest) map[string]string); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListFilesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FileInfoDisplayNameToIdMap' +type MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call struct { + *mock.Call +} + +// FileInfoDisplayNameToIdMap is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListFilesRequest +func (_e *MockProviderFilesInterface_Expecter) FileInfoDisplayNameToIdMap(ctx interface{}, request interface{}) *MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call { + return &MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call{Call: _e.mock.On("FileInfoDisplayNameToIdMap", ctx, request)} +} + +func (_c *MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call) Run(run func(ctx context.Context, request marketplace.ListFilesRequest)) *MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListFilesRequest)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call) RunAndReturn(run func(context.Context, marketplace.ListFilesRequest) (map[string]string, error)) *MockProviderFilesInterface_FileInfoDisplayNameToIdMap_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockProviderFilesInterface) Get(ctx context.Context, request marketplace.GetFileRequest) (*marketplace.GetFileResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *marketplace.GetFileResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetFileRequest) (*marketplace.GetFileResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetFileRequest) *marketplace.GetFileResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetFileResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetFileRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderFilesInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockProviderFilesInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetFileRequest +func (_e *MockProviderFilesInterface_Expecter) Get(ctx interface{}, request interface{}) *MockProviderFilesInterface_Get_Call { + return &MockProviderFilesInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockProviderFilesInterface_Get_Call) Run(run func(ctx context.Context, request marketplace.GetFileRequest)) *MockProviderFilesInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetFileRequest)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_Get_Call) Return(_a0 *marketplace.GetFileResponse, _a1 error) *MockProviderFilesInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderFilesInterface_Get_Call) RunAndReturn(run func(context.Context, marketplace.GetFileRequest) (*marketplace.GetFileResponse, error)) *MockProviderFilesInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetByDisplayName provides a mock function with given fields: ctx, name +func (_m *MockProviderFilesInterface) GetByDisplayName(ctx context.Context, name string) (*marketplace.FileInfo, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetByDisplayName") + } + + var r0 *marketplace.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.FileInfo, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.FileInfo); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.FileInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderFilesInterface_GetByDisplayName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByDisplayName' +type MockProviderFilesInterface_GetByDisplayName_Call struct { + *mock.Call +} + +// GetByDisplayName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockProviderFilesInterface_Expecter) GetByDisplayName(ctx interface{}, name interface{}) *MockProviderFilesInterface_GetByDisplayName_Call { + return &MockProviderFilesInterface_GetByDisplayName_Call{Call: _e.mock.On("GetByDisplayName", ctx, name)} +} + +func (_c *MockProviderFilesInterface_GetByDisplayName_Call) Run(run func(ctx context.Context, name string)) *MockProviderFilesInterface_GetByDisplayName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_GetByDisplayName_Call) Return(_a0 *marketplace.FileInfo, _a1 error) *MockProviderFilesInterface_GetByDisplayName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderFilesInterface_GetByDisplayName_Call) RunAndReturn(run func(context.Context, string) (*marketplace.FileInfo, error)) *MockProviderFilesInterface_GetByDisplayName_Call { + _c.Call.Return(run) + return _c +} + +// GetByFileId provides a mock function with given fields: ctx, fileId +func (_m *MockProviderFilesInterface) GetByFileId(ctx context.Context, fileId string) (*marketplace.GetFileResponse, error) { + ret := _m.Called(ctx, fileId) + + if len(ret) == 0 { + panic("no return value specified for GetByFileId") + } + + var r0 *marketplace.GetFileResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.GetFileResponse, error)); ok { + return rf(ctx, fileId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.GetFileResponse); ok { + r0 = rf(ctx, fileId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetFileResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, fileId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderFilesInterface_GetByFileId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByFileId' +type MockProviderFilesInterface_GetByFileId_Call struct { + *mock.Call +} + +// GetByFileId is a helper method to define mock.On call +// - ctx context.Context +// - fileId string +func (_e *MockProviderFilesInterface_Expecter) GetByFileId(ctx interface{}, fileId interface{}) *MockProviderFilesInterface_GetByFileId_Call { + return &MockProviderFilesInterface_GetByFileId_Call{Call: _e.mock.On("GetByFileId", ctx, fileId)} +} + +func (_c *MockProviderFilesInterface_GetByFileId_Call) Run(run func(ctx context.Context, fileId string)) *MockProviderFilesInterface_GetByFileId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_GetByFileId_Call) Return(_a0 *marketplace.GetFileResponse, _a1 error) *MockProviderFilesInterface_GetByFileId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderFilesInterface_GetByFileId_Call) RunAndReturn(run func(context.Context, string) (*marketplace.GetFileResponse, error)) *MockProviderFilesInterface_GetByFileId_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockProviderFilesInterface) Impl() marketplace.ProviderFilesService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ProviderFilesService + if rf, ok := ret.Get(0).(func() marketplace.ProviderFilesService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderFilesService) + } + } + + return r0 +} + +// MockProviderFilesInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockProviderFilesInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockProviderFilesInterface_Expecter) Impl() *MockProviderFilesInterface_Impl_Call { + return &MockProviderFilesInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockProviderFilesInterface_Impl_Call) Run(run func()) *MockProviderFilesInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockProviderFilesInterface_Impl_Call) Return(_a0 marketplace.ProviderFilesService) *MockProviderFilesInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderFilesInterface_Impl_Call) RunAndReturn(run func() marketplace.ProviderFilesService) *MockProviderFilesInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockProviderFilesInterface) List(ctx context.Context, request marketplace.ListFilesRequest) listing.Iterator[marketplace.FileInfo] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.FileInfo] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListFilesRequest) listing.Iterator[marketplace.FileInfo]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.FileInfo]) + } + } + + return r0 +} + +// MockProviderFilesInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockProviderFilesInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListFilesRequest +func (_e *MockProviderFilesInterface_Expecter) List(ctx interface{}, request interface{}) *MockProviderFilesInterface_List_Call { + return &MockProviderFilesInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockProviderFilesInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListFilesRequest)) *MockProviderFilesInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListFilesRequest)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_List_Call) Return(_a0 listing.Iterator[marketplace.FileInfo]) *MockProviderFilesInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderFilesInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListFilesRequest) listing.Iterator[marketplace.FileInfo]) *MockProviderFilesInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockProviderFilesInterface) ListAll(ctx context.Context, request marketplace.ListFilesRequest) ([]marketplace.FileInfo, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListFilesRequest) ([]marketplace.FileInfo, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListFilesRequest) []marketplace.FileInfo); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.FileInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListFilesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderFilesInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockProviderFilesInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListFilesRequest +func (_e *MockProviderFilesInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockProviderFilesInterface_ListAll_Call { + return &MockProviderFilesInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockProviderFilesInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListFilesRequest)) *MockProviderFilesInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListFilesRequest)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_ListAll_Call) Return(_a0 []marketplace.FileInfo, _a1 error) *MockProviderFilesInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderFilesInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListFilesRequest) ([]marketplace.FileInfo, error)) *MockProviderFilesInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockProviderFilesInterface) WithImpl(impl marketplace.ProviderFilesService) marketplace.ProviderFilesInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ProviderFilesInterface + if rf, ok := ret.Get(0).(func(marketplace.ProviderFilesService) marketplace.ProviderFilesInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderFilesInterface) + } + } + + return r0 +} + +// MockProviderFilesInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockProviderFilesInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ProviderFilesService +func (_e *MockProviderFilesInterface_Expecter) WithImpl(impl interface{}) *MockProviderFilesInterface_WithImpl_Call { + return &MockProviderFilesInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockProviderFilesInterface_WithImpl_Call) Run(run func(impl marketplace.ProviderFilesService)) *MockProviderFilesInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ProviderFilesService)) + }) + return _c +} + +func (_c *MockProviderFilesInterface_WithImpl_Call) Return(_a0 marketplace.ProviderFilesInterface) *MockProviderFilesInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderFilesInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ProviderFilesService) marketplace.ProviderFilesInterface) *MockProviderFilesInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockProviderFilesInterface creates a new instance of MockProviderFilesInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockProviderFilesInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockProviderFilesInterface { + mock := &MockProviderFilesInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_provider_listings_interface.go b/experimental/mocks/service/marketplace/mock_provider_listings_interface.go new file mode 100644 index 000000000..d387d6a99 --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_provider_listings_interface.go @@ -0,0 +1,690 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockProviderListingsInterface is an autogenerated mock type for the ProviderListingsInterface type +type MockProviderListingsInterface struct { + mock.Mock +} + +type MockProviderListingsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockProviderListingsInterface) EXPECT() *MockProviderListingsInterface_Expecter { + return &MockProviderListingsInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockProviderListingsInterface) Create(ctx context.Context, request marketplace.CreateListingRequest) (*marketplace.CreateListingResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *marketplace.CreateListingResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateListingRequest) (*marketplace.CreateListingResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateListingRequest) *marketplace.CreateListingResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.CreateListingResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.CreateListingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderListingsInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockProviderListingsInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.CreateListingRequest +func (_e *MockProviderListingsInterface_Expecter) Create(ctx interface{}, request interface{}) *MockProviderListingsInterface_Create_Call { + return &MockProviderListingsInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockProviderListingsInterface_Create_Call) Run(run func(ctx context.Context, request marketplace.CreateListingRequest)) *MockProviderListingsInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.CreateListingRequest)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_Create_Call) Return(_a0 *marketplace.CreateListingResponse, _a1 error) *MockProviderListingsInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderListingsInterface_Create_Call) RunAndReturn(run func(context.Context, marketplace.CreateListingRequest) (*marketplace.CreateListingResponse, error)) *MockProviderListingsInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockProviderListingsInterface) Delete(ctx context.Context, request marketplace.DeleteListingRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.DeleteListingRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderListingsInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockProviderListingsInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.DeleteListingRequest +func (_e *MockProviderListingsInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockProviderListingsInterface_Delete_Call { + return &MockProviderListingsInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockProviderListingsInterface_Delete_Call) Run(run func(ctx context.Context, request marketplace.DeleteListingRequest)) *MockProviderListingsInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.DeleteListingRequest)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_Delete_Call) Return(_a0 error) *MockProviderListingsInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderListingsInterface_Delete_Call) RunAndReturn(run func(context.Context, marketplace.DeleteListingRequest) error) *MockProviderListingsInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteById provides a mock function with given fields: ctx, id +func (_m *MockProviderListingsInterface) DeleteById(ctx context.Context, id string) error { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for DeleteById") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderListingsInterface_DeleteById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteById' +type MockProviderListingsInterface_DeleteById_Call struct { + *mock.Call +} + +// DeleteById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockProviderListingsInterface_Expecter) DeleteById(ctx interface{}, id interface{}) *MockProviderListingsInterface_DeleteById_Call { + return &MockProviderListingsInterface_DeleteById_Call{Call: _e.mock.On("DeleteById", ctx, id)} +} + +func (_c *MockProviderListingsInterface_DeleteById_Call) Run(run func(ctx context.Context, id string)) *MockProviderListingsInterface_DeleteById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_DeleteById_Call) Return(_a0 error) *MockProviderListingsInterface_DeleteById_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderListingsInterface_DeleteById_Call) RunAndReturn(run func(context.Context, string) error) *MockProviderListingsInterface_DeleteById_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockProviderListingsInterface) Get(ctx context.Context, request marketplace.GetListingRequest) (*marketplace.GetListingResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *marketplace.GetListingResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingRequest) (*marketplace.GetListingResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingRequest) *marketplace.GetListingResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetListingResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetListingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderListingsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockProviderListingsInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetListingRequest +func (_e *MockProviderListingsInterface_Expecter) Get(ctx interface{}, request interface{}) *MockProviderListingsInterface_Get_Call { + return &MockProviderListingsInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockProviderListingsInterface_Get_Call) Run(run func(ctx context.Context, request marketplace.GetListingRequest)) *MockProviderListingsInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetListingRequest)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_Get_Call) Return(_a0 *marketplace.GetListingResponse, _a1 error) *MockProviderListingsInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderListingsInterface_Get_Call) RunAndReturn(run func(context.Context, marketplace.GetListingRequest) (*marketplace.GetListingResponse, error)) *MockProviderListingsInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetById provides a mock function with given fields: ctx, id +func (_m *MockProviderListingsInterface) GetById(ctx context.Context, id string) (*marketplace.GetListingResponse, error) { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for GetById") + } + + var r0 *marketplace.GetListingResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.GetListingResponse, error)); ok { + return rf(ctx, id) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.GetListingResponse); ok { + r0 = rf(ctx, id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetListingResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderListingsInterface_GetById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetById' +type MockProviderListingsInterface_GetById_Call struct { + *mock.Call +} + +// GetById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockProviderListingsInterface_Expecter) GetById(ctx interface{}, id interface{}) *MockProviderListingsInterface_GetById_Call { + return &MockProviderListingsInterface_GetById_Call{Call: _e.mock.On("GetById", ctx, id)} +} + +func (_c *MockProviderListingsInterface_GetById_Call) Run(run func(ctx context.Context, id string)) *MockProviderListingsInterface_GetById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_GetById_Call) Return(_a0 *marketplace.GetListingResponse, _a1 error) *MockProviderListingsInterface_GetById_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderListingsInterface_GetById_Call) RunAndReturn(run func(context.Context, string) (*marketplace.GetListingResponse, error)) *MockProviderListingsInterface_GetById_Call { + _c.Call.Return(run) + return _c +} + +// GetBySummaryName provides a mock function with given fields: ctx, name +func (_m *MockProviderListingsInterface) GetBySummaryName(ctx context.Context, name string) (*marketplace.Listing, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetBySummaryName") + } + + var r0 *marketplace.Listing + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.Listing, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.Listing); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.Listing) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderListingsInterface_GetBySummaryName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBySummaryName' +type MockProviderListingsInterface_GetBySummaryName_Call struct { + *mock.Call +} + +// GetBySummaryName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockProviderListingsInterface_Expecter) GetBySummaryName(ctx interface{}, name interface{}) *MockProviderListingsInterface_GetBySummaryName_Call { + return &MockProviderListingsInterface_GetBySummaryName_Call{Call: _e.mock.On("GetBySummaryName", ctx, name)} +} + +func (_c *MockProviderListingsInterface_GetBySummaryName_Call) Run(run func(ctx context.Context, name string)) *MockProviderListingsInterface_GetBySummaryName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_GetBySummaryName_Call) Return(_a0 *marketplace.Listing, _a1 error) *MockProviderListingsInterface_GetBySummaryName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderListingsInterface_GetBySummaryName_Call) RunAndReturn(run func(context.Context, string) (*marketplace.Listing, error)) *MockProviderListingsInterface_GetBySummaryName_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockProviderListingsInterface) Impl() marketplace.ProviderListingsService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ProviderListingsService + if rf, ok := ret.Get(0).(func() marketplace.ProviderListingsService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderListingsService) + } + } + + return r0 +} + +// MockProviderListingsInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockProviderListingsInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockProviderListingsInterface_Expecter) Impl() *MockProviderListingsInterface_Impl_Call { + return &MockProviderListingsInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockProviderListingsInterface_Impl_Call) Run(run func()) *MockProviderListingsInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockProviderListingsInterface_Impl_Call) Return(_a0 marketplace.ProviderListingsService) *MockProviderListingsInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderListingsInterface_Impl_Call) RunAndReturn(run func() marketplace.ProviderListingsService) *MockProviderListingsInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockProviderListingsInterface) List(ctx context.Context, request marketplace.GetListingsRequest) listing.Iterator[marketplace.Listing] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.Listing] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingsRequest) listing.Iterator[marketplace.Listing]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.Listing]) + } + } + + return r0 +} + +// MockProviderListingsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockProviderListingsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetListingsRequest +func (_e *MockProviderListingsInterface_Expecter) List(ctx interface{}, request interface{}) *MockProviderListingsInterface_List_Call { + return &MockProviderListingsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockProviderListingsInterface_List_Call) Run(run func(ctx context.Context, request marketplace.GetListingsRequest)) *MockProviderListingsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetListingsRequest)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_List_Call) Return(_a0 listing.Iterator[marketplace.Listing]) *MockProviderListingsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderListingsInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.GetListingsRequest) listing.Iterator[marketplace.Listing]) *MockProviderListingsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockProviderListingsInterface) ListAll(ctx context.Context, request marketplace.GetListingsRequest) ([]marketplace.Listing, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.Listing + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingsRequest) ([]marketplace.Listing, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingsRequest) []marketplace.Listing); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.Listing) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetListingsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderListingsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockProviderListingsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetListingsRequest +func (_e *MockProviderListingsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockProviderListingsInterface_ListAll_Call { + return &MockProviderListingsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockProviderListingsInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.GetListingsRequest)) *MockProviderListingsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetListingsRequest)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_ListAll_Call) Return(_a0 []marketplace.Listing, _a1 error) *MockProviderListingsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderListingsInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.GetListingsRequest) ([]marketplace.Listing, error)) *MockProviderListingsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// ListingSummaryNameToIdMap provides a mock function with given fields: ctx, request +func (_m *MockProviderListingsInterface) ListingSummaryNameToIdMap(ctx context.Context, request marketplace.GetListingsRequest) (map[string]string, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListingSummaryNameToIdMap") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingsRequest) (map[string]string, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetListingsRequest) map[string]string); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetListingsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderListingsInterface_ListingSummaryNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListingSummaryNameToIdMap' +type MockProviderListingsInterface_ListingSummaryNameToIdMap_Call struct { + *mock.Call +} + +// ListingSummaryNameToIdMap is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetListingsRequest +func (_e *MockProviderListingsInterface_Expecter) ListingSummaryNameToIdMap(ctx interface{}, request interface{}) *MockProviderListingsInterface_ListingSummaryNameToIdMap_Call { + return &MockProviderListingsInterface_ListingSummaryNameToIdMap_Call{Call: _e.mock.On("ListingSummaryNameToIdMap", ctx, request)} +} + +func (_c *MockProviderListingsInterface_ListingSummaryNameToIdMap_Call) Run(run func(ctx context.Context, request marketplace.GetListingsRequest)) *MockProviderListingsInterface_ListingSummaryNameToIdMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetListingsRequest)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_ListingSummaryNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockProviderListingsInterface_ListingSummaryNameToIdMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderListingsInterface_ListingSummaryNameToIdMap_Call) RunAndReturn(run func(context.Context, marketplace.GetListingsRequest) (map[string]string, error)) *MockProviderListingsInterface_ListingSummaryNameToIdMap_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockProviderListingsInterface) Update(ctx context.Context, request marketplace.UpdateListingRequest) (*marketplace.UpdateListingResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *marketplace.UpdateListingResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateListingRequest) (*marketplace.UpdateListingResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateListingRequest) *marketplace.UpdateListingResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.UpdateListingResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.UpdateListingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderListingsInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockProviderListingsInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.UpdateListingRequest +func (_e *MockProviderListingsInterface_Expecter) Update(ctx interface{}, request interface{}) *MockProviderListingsInterface_Update_Call { + return &MockProviderListingsInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockProviderListingsInterface_Update_Call) Run(run func(ctx context.Context, request marketplace.UpdateListingRequest)) *MockProviderListingsInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.UpdateListingRequest)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_Update_Call) Return(_a0 *marketplace.UpdateListingResponse, _a1 error) *MockProviderListingsInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderListingsInterface_Update_Call) RunAndReturn(run func(context.Context, marketplace.UpdateListingRequest) (*marketplace.UpdateListingResponse, error)) *MockProviderListingsInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockProviderListingsInterface) WithImpl(impl marketplace.ProviderListingsService) marketplace.ProviderListingsInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ProviderListingsInterface + if rf, ok := ret.Get(0).(func(marketplace.ProviderListingsService) marketplace.ProviderListingsInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderListingsInterface) + } + } + + return r0 +} + +// MockProviderListingsInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockProviderListingsInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ProviderListingsService +func (_e *MockProviderListingsInterface_Expecter) WithImpl(impl interface{}) *MockProviderListingsInterface_WithImpl_Call { + return &MockProviderListingsInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockProviderListingsInterface_WithImpl_Call) Run(run func(impl marketplace.ProviderListingsService)) *MockProviderListingsInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ProviderListingsService)) + }) + return _c +} + +func (_c *MockProviderListingsInterface_WithImpl_Call) Return(_a0 marketplace.ProviderListingsInterface) *MockProviderListingsInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderListingsInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ProviderListingsService) marketplace.ProviderListingsInterface) *MockProviderListingsInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockProviderListingsInterface creates a new instance of MockProviderListingsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockProviderListingsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockProviderListingsInterface { + mock := &MockProviderListingsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_provider_personalization_requests_interface.go b/experimental/mocks/service/marketplace/mock_provider_personalization_requests_interface.go new file mode 100644 index 000000000..18525983b --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_provider_personalization_requests_interface.go @@ -0,0 +1,301 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockProviderPersonalizationRequestsInterface is an autogenerated mock type for the ProviderPersonalizationRequestsInterface type +type MockProviderPersonalizationRequestsInterface struct { + mock.Mock +} + +type MockProviderPersonalizationRequestsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockProviderPersonalizationRequestsInterface) EXPECT() *MockProviderPersonalizationRequestsInterface_Expecter { + return &MockProviderPersonalizationRequestsInterface_Expecter{mock: &_m.Mock} +} + +// Impl provides a mock function with given fields: +func (_m *MockProviderPersonalizationRequestsInterface) Impl() marketplace.ProviderPersonalizationRequestsService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ProviderPersonalizationRequestsService + if rf, ok := ret.Get(0).(func() marketplace.ProviderPersonalizationRequestsService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderPersonalizationRequestsService) + } + } + + return r0 +} + +// MockProviderPersonalizationRequestsInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockProviderPersonalizationRequestsInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockProviderPersonalizationRequestsInterface_Expecter) Impl() *MockProviderPersonalizationRequestsInterface_Impl_Call { + return &MockProviderPersonalizationRequestsInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockProviderPersonalizationRequestsInterface_Impl_Call) Run(run func()) *MockProviderPersonalizationRequestsInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_Impl_Call) Return(_a0 marketplace.ProviderPersonalizationRequestsService) *MockProviderPersonalizationRequestsInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_Impl_Call) RunAndReturn(run func() marketplace.ProviderPersonalizationRequestsService) *MockProviderPersonalizationRequestsInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockProviderPersonalizationRequestsInterface) List(ctx context.Context, request marketplace.ListAllPersonalizationRequestsRequest) listing.Iterator[marketplace.PersonalizationRequest] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.PersonalizationRequest] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) listing.Iterator[marketplace.PersonalizationRequest]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.PersonalizationRequest]) + } + } + + return r0 +} + +// MockProviderPersonalizationRequestsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockProviderPersonalizationRequestsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListAllPersonalizationRequestsRequest +func (_e *MockProviderPersonalizationRequestsInterface_Expecter) List(ctx interface{}, request interface{}) *MockProviderPersonalizationRequestsInterface_List_Call { + return &MockProviderPersonalizationRequestsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockProviderPersonalizationRequestsInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListAllPersonalizationRequestsRequest)) *MockProviderPersonalizationRequestsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListAllPersonalizationRequestsRequest)) + }) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_List_Call) Return(_a0 listing.Iterator[marketplace.PersonalizationRequest]) *MockProviderPersonalizationRequestsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) listing.Iterator[marketplace.PersonalizationRequest]) *MockProviderPersonalizationRequestsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockProviderPersonalizationRequestsInterface) ListAll(ctx context.Context, request marketplace.ListAllPersonalizationRequestsRequest) ([]marketplace.PersonalizationRequest, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.PersonalizationRequest + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) ([]marketplace.PersonalizationRequest, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) []marketplace.PersonalizationRequest); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.PersonalizationRequest) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderPersonalizationRequestsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockProviderPersonalizationRequestsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListAllPersonalizationRequestsRequest +func (_e *MockProviderPersonalizationRequestsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockProviderPersonalizationRequestsInterface_ListAll_Call { + return &MockProviderPersonalizationRequestsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockProviderPersonalizationRequestsInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListAllPersonalizationRequestsRequest)) *MockProviderPersonalizationRequestsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListAllPersonalizationRequestsRequest)) + }) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_ListAll_Call) Return(_a0 []marketplace.PersonalizationRequest, _a1 error) *MockProviderPersonalizationRequestsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListAllPersonalizationRequestsRequest) ([]marketplace.PersonalizationRequest, error)) *MockProviderPersonalizationRequestsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockProviderPersonalizationRequestsInterface) Update(ctx context.Context, request marketplace.UpdatePersonalizationRequestRequest) (*marketplace.UpdatePersonalizationRequestResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *marketplace.UpdatePersonalizationRequestResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdatePersonalizationRequestRequest) (*marketplace.UpdatePersonalizationRequestResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdatePersonalizationRequestRequest) *marketplace.UpdatePersonalizationRequestResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.UpdatePersonalizationRequestResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.UpdatePersonalizationRequestRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderPersonalizationRequestsInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockProviderPersonalizationRequestsInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.UpdatePersonalizationRequestRequest +func (_e *MockProviderPersonalizationRequestsInterface_Expecter) Update(ctx interface{}, request interface{}) *MockProviderPersonalizationRequestsInterface_Update_Call { + return &MockProviderPersonalizationRequestsInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockProviderPersonalizationRequestsInterface_Update_Call) Run(run func(ctx context.Context, request marketplace.UpdatePersonalizationRequestRequest)) *MockProviderPersonalizationRequestsInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.UpdatePersonalizationRequestRequest)) + }) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_Update_Call) Return(_a0 *marketplace.UpdatePersonalizationRequestResponse, _a1 error) *MockProviderPersonalizationRequestsInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_Update_Call) RunAndReturn(run func(context.Context, marketplace.UpdatePersonalizationRequestRequest) (*marketplace.UpdatePersonalizationRequestResponse, error)) *MockProviderPersonalizationRequestsInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockProviderPersonalizationRequestsInterface) WithImpl(impl marketplace.ProviderPersonalizationRequestsService) marketplace.ProviderPersonalizationRequestsInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ProviderPersonalizationRequestsInterface + if rf, ok := ret.Get(0).(func(marketplace.ProviderPersonalizationRequestsService) marketplace.ProviderPersonalizationRequestsInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderPersonalizationRequestsInterface) + } + } + + return r0 +} + +// MockProviderPersonalizationRequestsInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockProviderPersonalizationRequestsInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ProviderPersonalizationRequestsService +func (_e *MockProviderPersonalizationRequestsInterface_Expecter) WithImpl(impl interface{}) *MockProviderPersonalizationRequestsInterface_WithImpl_Call { + return &MockProviderPersonalizationRequestsInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockProviderPersonalizationRequestsInterface_WithImpl_Call) Run(run func(impl marketplace.ProviderPersonalizationRequestsService)) *MockProviderPersonalizationRequestsInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ProviderPersonalizationRequestsService)) + }) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_WithImpl_Call) Return(_a0 marketplace.ProviderPersonalizationRequestsInterface) *MockProviderPersonalizationRequestsInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderPersonalizationRequestsInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ProviderPersonalizationRequestsService) marketplace.ProviderPersonalizationRequestsInterface) *MockProviderPersonalizationRequestsInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockProviderPersonalizationRequestsInterface creates a new instance of MockProviderPersonalizationRequestsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockProviderPersonalizationRequestsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockProviderPersonalizationRequestsInterface { + mock := &MockProviderPersonalizationRequestsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_provider_provider_analytics_dashboards_interface.go b/experimental/mocks/service/marketplace/mock_provider_provider_analytics_dashboards_interface.go new file mode 100644 index 000000000..5ff0495ec --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_provider_provider_analytics_dashboards_interface.go @@ -0,0 +1,365 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + mock "github.com/stretchr/testify/mock" +) + +// MockProviderProviderAnalyticsDashboardsInterface is an autogenerated mock type for the ProviderProviderAnalyticsDashboardsInterface type +type MockProviderProviderAnalyticsDashboardsInterface struct { + mock.Mock +} + +type MockProviderProviderAnalyticsDashboardsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockProviderProviderAnalyticsDashboardsInterface) EXPECT() *MockProviderProviderAnalyticsDashboardsInterface_Expecter { + return &MockProviderProviderAnalyticsDashboardsInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx +func (_m *MockProviderProviderAnalyticsDashboardsInterface) Create(ctx context.Context) (*marketplace.ProviderAnalyticsDashboard, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *marketplace.ProviderAnalyticsDashboard + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*marketplace.ProviderAnalyticsDashboard, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *marketplace.ProviderAnalyticsDashboard); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.ProviderAnalyticsDashboard) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProviderAnalyticsDashboardsInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockProviderProviderAnalyticsDashboardsInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockProviderProviderAnalyticsDashboardsInterface_Expecter) Create(ctx interface{}) *MockProviderProviderAnalyticsDashboardsInterface_Create_Call { + return &MockProviderProviderAnalyticsDashboardsInterface_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Create_Call) Run(run func(ctx context.Context)) *MockProviderProviderAnalyticsDashboardsInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Create_Call) Return(_a0 *marketplace.ProviderAnalyticsDashboard, _a1 error) *MockProviderProviderAnalyticsDashboardsInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Create_Call) RunAndReturn(run func(context.Context) (*marketplace.ProviderAnalyticsDashboard, error)) *MockProviderProviderAnalyticsDashboardsInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx +func (_m *MockProviderProviderAnalyticsDashboardsInterface) Get(ctx context.Context) (*marketplace.ListProviderAnalyticsDashboardResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *marketplace.ListProviderAnalyticsDashboardResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*marketplace.ListProviderAnalyticsDashboardResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *marketplace.ListProviderAnalyticsDashboardResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.ListProviderAnalyticsDashboardResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProviderAnalyticsDashboardsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockProviderProviderAnalyticsDashboardsInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockProviderProviderAnalyticsDashboardsInterface_Expecter) Get(ctx interface{}) *MockProviderProviderAnalyticsDashboardsInterface_Get_Call { + return &MockProviderProviderAnalyticsDashboardsInterface_Get_Call{Call: _e.mock.On("Get", ctx)} +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Get_Call) Run(run func(ctx context.Context)) *MockProviderProviderAnalyticsDashboardsInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Get_Call) Return(_a0 *marketplace.ListProviderAnalyticsDashboardResponse, _a1 error) *MockProviderProviderAnalyticsDashboardsInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Get_Call) RunAndReturn(run func(context.Context) (*marketplace.ListProviderAnalyticsDashboardResponse, error)) *MockProviderProviderAnalyticsDashboardsInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetLatestVersion provides a mock function with given fields: ctx +func (_m *MockProviderProviderAnalyticsDashboardsInterface) GetLatestVersion(ctx context.Context) (*marketplace.GetLatestVersionProviderAnalyticsDashboardResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetLatestVersion") + } + + var r0 *marketplace.GetLatestVersionProviderAnalyticsDashboardResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*marketplace.GetLatestVersionProviderAnalyticsDashboardResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *marketplace.GetLatestVersionProviderAnalyticsDashboardResponse); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetLatestVersionProviderAnalyticsDashboardResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestVersion' +type MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call struct { + *mock.Call +} + +// GetLatestVersion is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockProviderProviderAnalyticsDashboardsInterface_Expecter) GetLatestVersion(ctx interface{}) *MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call { + return &MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call{Call: _e.mock.On("GetLatestVersion", ctx)} +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call) Run(run func(ctx context.Context)) *MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call) Return(_a0 *marketplace.GetLatestVersionProviderAnalyticsDashboardResponse, _a1 error) *MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call) RunAndReturn(run func(context.Context) (*marketplace.GetLatestVersionProviderAnalyticsDashboardResponse, error)) *MockProviderProviderAnalyticsDashboardsInterface_GetLatestVersion_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockProviderProviderAnalyticsDashboardsInterface) Impl() marketplace.ProviderProviderAnalyticsDashboardsService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ProviderProviderAnalyticsDashboardsService + if rf, ok := ret.Get(0).(func() marketplace.ProviderProviderAnalyticsDashboardsService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderProviderAnalyticsDashboardsService) + } + } + + return r0 +} + +// MockProviderProviderAnalyticsDashboardsInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockProviderProviderAnalyticsDashboardsInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockProviderProviderAnalyticsDashboardsInterface_Expecter) Impl() *MockProviderProviderAnalyticsDashboardsInterface_Impl_Call { + return &MockProviderProviderAnalyticsDashboardsInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Impl_Call) Run(run func()) *MockProviderProviderAnalyticsDashboardsInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Impl_Call) Return(_a0 marketplace.ProviderProviderAnalyticsDashboardsService) *MockProviderProviderAnalyticsDashboardsInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Impl_Call) RunAndReturn(run func() marketplace.ProviderProviderAnalyticsDashboardsService) *MockProviderProviderAnalyticsDashboardsInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockProviderProviderAnalyticsDashboardsInterface) Update(ctx context.Context, request marketplace.UpdateProviderAnalyticsDashboardRequest) (*marketplace.UpdateProviderAnalyticsDashboardResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *marketplace.UpdateProviderAnalyticsDashboardResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateProviderAnalyticsDashboardRequest) (*marketplace.UpdateProviderAnalyticsDashboardResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateProviderAnalyticsDashboardRequest) *marketplace.UpdateProviderAnalyticsDashboardResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.UpdateProviderAnalyticsDashboardResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.UpdateProviderAnalyticsDashboardRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProviderAnalyticsDashboardsInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockProviderProviderAnalyticsDashboardsInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.UpdateProviderAnalyticsDashboardRequest +func (_e *MockProviderProviderAnalyticsDashboardsInterface_Expecter) Update(ctx interface{}, request interface{}) *MockProviderProviderAnalyticsDashboardsInterface_Update_Call { + return &MockProviderProviderAnalyticsDashboardsInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Update_Call) Run(run func(ctx context.Context, request marketplace.UpdateProviderAnalyticsDashboardRequest)) *MockProviderProviderAnalyticsDashboardsInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.UpdateProviderAnalyticsDashboardRequest)) + }) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Update_Call) Return(_a0 *marketplace.UpdateProviderAnalyticsDashboardResponse, _a1 error) *MockProviderProviderAnalyticsDashboardsInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_Update_Call) RunAndReturn(run func(context.Context, marketplace.UpdateProviderAnalyticsDashboardRequest) (*marketplace.UpdateProviderAnalyticsDashboardResponse, error)) *MockProviderProviderAnalyticsDashboardsInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockProviderProviderAnalyticsDashboardsInterface) WithImpl(impl marketplace.ProviderProviderAnalyticsDashboardsService) marketplace.ProviderProviderAnalyticsDashboardsInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ProviderProviderAnalyticsDashboardsInterface + if rf, ok := ret.Get(0).(func(marketplace.ProviderProviderAnalyticsDashboardsService) marketplace.ProviderProviderAnalyticsDashboardsInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderProviderAnalyticsDashboardsInterface) + } + } + + return r0 +} + +// MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ProviderProviderAnalyticsDashboardsService +func (_e *MockProviderProviderAnalyticsDashboardsInterface_Expecter) WithImpl(impl interface{}) *MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call { + return &MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call) Run(run func(impl marketplace.ProviderProviderAnalyticsDashboardsService)) *MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ProviderProviderAnalyticsDashboardsService)) + }) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call) Return(_a0 marketplace.ProviderProviderAnalyticsDashboardsInterface) *MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ProviderProviderAnalyticsDashboardsService) marketplace.ProviderProviderAnalyticsDashboardsInterface) *MockProviderProviderAnalyticsDashboardsInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockProviderProviderAnalyticsDashboardsInterface creates a new instance of MockProviderProviderAnalyticsDashboardsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockProviderProviderAnalyticsDashboardsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockProviderProviderAnalyticsDashboardsInterface { + mock := &MockProviderProviderAnalyticsDashboardsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/marketplace/mock_provider_providers_interface.go b/experimental/mocks/service/marketplace/mock_provider_providers_interface.go new file mode 100644 index 000000000..c24acb745 --- /dev/null +++ b/experimental/mocks/service/marketplace/mock_provider_providers_interface.go @@ -0,0 +1,690 @@ +// Code generated by mockery v2.39.1. DO NOT EDIT. + +package marketplace + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + marketplace "github.com/databricks/databricks-sdk-go/service/marketplace" + + mock "github.com/stretchr/testify/mock" +) + +// MockProviderProvidersInterface is an autogenerated mock type for the ProviderProvidersInterface type +type MockProviderProvidersInterface struct { + mock.Mock +} + +type MockProviderProvidersInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockProviderProvidersInterface) EXPECT() *MockProviderProvidersInterface_Expecter { + return &MockProviderProvidersInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockProviderProvidersInterface) Create(ctx context.Context, request marketplace.CreateProviderRequest) (*marketplace.CreateProviderResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *marketplace.CreateProviderResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateProviderRequest) (*marketplace.CreateProviderResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.CreateProviderRequest) *marketplace.CreateProviderResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.CreateProviderResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.CreateProviderRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProvidersInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockProviderProvidersInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.CreateProviderRequest +func (_e *MockProviderProvidersInterface_Expecter) Create(ctx interface{}, request interface{}) *MockProviderProvidersInterface_Create_Call { + return &MockProviderProvidersInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockProviderProvidersInterface_Create_Call) Run(run func(ctx context.Context, request marketplace.CreateProviderRequest)) *MockProviderProvidersInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.CreateProviderRequest)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_Create_Call) Return(_a0 *marketplace.CreateProviderResponse, _a1 error) *MockProviderProvidersInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProvidersInterface_Create_Call) RunAndReturn(run func(context.Context, marketplace.CreateProviderRequest) (*marketplace.CreateProviderResponse, error)) *MockProviderProvidersInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockProviderProvidersInterface) Delete(ctx context.Context, request marketplace.DeleteProviderRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.DeleteProviderRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderProvidersInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockProviderProvidersInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.DeleteProviderRequest +func (_e *MockProviderProvidersInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockProviderProvidersInterface_Delete_Call { + return &MockProviderProvidersInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockProviderProvidersInterface_Delete_Call) Run(run func(ctx context.Context, request marketplace.DeleteProviderRequest)) *MockProviderProvidersInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.DeleteProviderRequest)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_Delete_Call) Return(_a0 error) *MockProviderProvidersInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderProvidersInterface_Delete_Call) RunAndReturn(run func(context.Context, marketplace.DeleteProviderRequest) error) *MockProviderProvidersInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteById provides a mock function with given fields: ctx, id +func (_m *MockProviderProvidersInterface) DeleteById(ctx context.Context, id string) error { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for DeleteById") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockProviderProvidersInterface_DeleteById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteById' +type MockProviderProvidersInterface_DeleteById_Call struct { + *mock.Call +} + +// DeleteById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockProviderProvidersInterface_Expecter) DeleteById(ctx interface{}, id interface{}) *MockProviderProvidersInterface_DeleteById_Call { + return &MockProviderProvidersInterface_DeleteById_Call{Call: _e.mock.On("DeleteById", ctx, id)} +} + +func (_c *MockProviderProvidersInterface_DeleteById_Call) Run(run func(ctx context.Context, id string)) *MockProviderProvidersInterface_DeleteById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_DeleteById_Call) Return(_a0 error) *MockProviderProvidersInterface_DeleteById_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderProvidersInterface_DeleteById_Call) RunAndReturn(run func(context.Context, string) error) *MockProviderProvidersInterface_DeleteById_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockProviderProvidersInterface) Get(ctx context.Context, request marketplace.GetProviderRequest) (*marketplace.GetProviderResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *marketplace.GetProviderResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetProviderRequest) (*marketplace.GetProviderResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.GetProviderRequest) *marketplace.GetProviderResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetProviderResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.GetProviderRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProvidersInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockProviderProvidersInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.GetProviderRequest +func (_e *MockProviderProvidersInterface_Expecter) Get(ctx interface{}, request interface{}) *MockProviderProvidersInterface_Get_Call { + return &MockProviderProvidersInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockProviderProvidersInterface_Get_Call) Run(run func(ctx context.Context, request marketplace.GetProviderRequest)) *MockProviderProvidersInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.GetProviderRequest)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_Get_Call) Return(_a0 *marketplace.GetProviderResponse, _a1 error) *MockProviderProvidersInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProvidersInterface_Get_Call) RunAndReturn(run func(context.Context, marketplace.GetProviderRequest) (*marketplace.GetProviderResponse, error)) *MockProviderProvidersInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetById provides a mock function with given fields: ctx, id +func (_m *MockProviderProvidersInterface) GetById(ctx context.Context, id string) (*marketplace.GetProviderResponse, error) { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for GetById") + } + + var r0 *marketplace.GetProviderResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.GetProviderResponse, error)); ok { + return rf(ctx, id) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.GetProviderResponse); ok { + r0 = rf(ctx, id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.GetProviderResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProvidersInterface_GetById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetById' +type MockProviderProvidersInterface_GetById_Call struct { + *mock.Call +} + +// GetById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockProviderProvidersInterface_Expecter) GetById(ctx interface{}, id interface{}) *MockProviderProvidersInterface_GetById_Call { + return &MockProviderProvidersInterface_GetById_Call{Call: _e.mock.On("GetById", ctx, id)} +} + +func (_c *MockProviderProvidersInterface_GetById_Call) Run(run func(ctx context.Context, id string)) *MockProviderProvidersInterface_GetById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_GetById_Call) Return(_a0 *marketplace.GetProviderResponse, _a1 error) *MockProviderProvidersInterface_GetById_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProvidersInterface_GetById_Call) RunAndReturn(run func(context.Context, string) (*marketplace.GetProviderResponse, error)) *MockProviderProvidersInterface_GetById_Call { + _c.Call.Return(run) + return _c +} + +// GetByName provides a mock function with given fields: ctx, name +func (_m *MockProviderProvidersInterface) GetByName(ctx context.Context, name string) (*marketplace.ProviderInfo, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetByName") + } + + var r0 *marketplace.ProviderInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*marketplace.ProviderInfo, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *marketplace.ProviderInfo); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.ProviderInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProvidersInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' +type MockProviderProvidersInterface_GetByName_Call struct { + *mock.Call +} + +// GetByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockProviderProvidersInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockProviderProvidersInterface_GetByName_Call { + return &MockProviderProvidersInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} +} + +func (_c *MockProviderProvidersInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockProviderProvidersInterface_GetByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_GetByName_Call) Return(_a0 *marketplace.ProviderInfo, _a1 error) *MockProviderProvidersInterface_GetByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProvidersInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*marketplace.ProviderInfo, error)) *MockProviderProvidersInterface_GetByName_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockProviderProvidersInterface) Impl() marketplace.ProviderProvidersService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 marketplace.ProviderProvidersService + if rf, ok := ret.Get(0).(func() marketplace.ProviderProvidersService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderProvidersService) + } + } + + return r0 +} + +// MockProviderProvidersInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockProviderProvidersInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockProviderProvidersInterface_Expecter) Impl() *MockProviderProvidersInterface_Impl_Call { + return &MockProviderProvidersInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockProviderProvidersInterface_Impl_Call) Run(run func()) *MockProviderProvidersInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockProviderProvidersInterface_Impl_Call) Return(_a0 marketplace.ProviderProvidersService) *MockProviderProvidersInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderProvidersInterface_Impl_Call) RunAndReturn(run func() marketplace.ProviderProvidersService) *MockProviderProvidersInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockProviderProvidersInterface) List(ctx context.Context, request marketplace.ListProvidersRequest) listing.Iterator[marketplace.ProviderInfo] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[marketplace.ProviderInfo] + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) listing.Iterator[marketplace.ProviderInfo]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[marketplace.ProviderInfo]) + } + } + + return r0 +} + +// MockProviderProvidersInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockProviderProvidersInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListProvidersRequest +func (_e *MockProviderProvidersInterface_Expecter) List(ctx interface{}, request interface{}) *MockProviderProvidersInterface_List_Call { + return &MockProviderProvidersInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockProviderProvidersInterface_List_Call) Run(run func(ctx context.Context, request marketplace.ListProvidersRequest)) *MockProviderProvidersInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListProvidersRequest)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_List_Call) Return(_a0 listing.Iterator[marketplace.ProviderInfo]) *MockProviderProvidersInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderProvidersInterface_List_Call) RunAndReturn(run func(context.Context, marketplace.ListProvidersRequest) listing.Iterator[marketplace.ProviderInfo]) *MockProviderProvidersInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockProviderProvidersInterface) ListAll(ctx context.Context, request marketplace.ListProvidersRequest) ([]marketplace.ProviderInfo, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []marketplace.ProviderInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) ([]marketplace.ProviderInfo, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) []marketplace.ProviderInfo); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]marketplace.ProviderInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListProvidersRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProvidersInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockProviderProvidersInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListProvidersRequest +func (_e *MockProviderProvidersInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockProviderProvidersInterface_ListAll_Call { + return &MockProviderProvidersInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockProviderProvidersInterface_ListAll_Call) Run(run func(ctx context.Context, request marketplace.ListProvidersRequest)) *MockProviderProvidersInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListProvidersRequest)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_ListAll_Call) Return(_a0 []marketplace.ProviderInfo, _a1 error) *MockProviderProvidersInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProvidersInterface_ListAll_Call) RunAndReturn(run func(context.Context, marketplace.ListProvidersRequest) ([]marketplace.ProviderInfo, error)) *MockProviderProvidersInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// ProviderInfoNameToIdMap provides a mock function with given fields: ctx, request +func (_m *MockProviderProvidersInterface) ProviderInfoNameToIdMap(ctx context.Context, request marketplace.ListProvidersRequest) (map[string]string, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ProviderInfoNameToIdMap") + } + + var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) (map[string]string, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.ListProvidersRequest) map[string]string); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.ListProvidersRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProviderInfoNameToIdMap' +type MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call struct { + *mock.Call +} + +// ProviderInfoNameToIdMap is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.ListProvidersRequest +func (_e *MockProviderProvidersInterface_Expecter) ProviderInfoNameToIdMap(ctx interface{}, request interface{}) *MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call { + return &MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call{Call: _e.mock.On("ProviderInfoNameToIdMap", ctx, request)} +} + +func (_c *MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call) Run(run func(ctx context.Context, request marketplace.ListProvidersRequest)) *MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.ListProvidersRequest)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call) RunAndReturn(run func(context.Context, marketplace.ListProvidersRequest) (map[string]string, error)) *MockProviderProvidersInterface_ProviderInfoNameToIdMap_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockProviderProvidersInterface) Update(ctx context.Context, request marketplace.UpdateProviderRequest) (*marketplace.UpdateProviderResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *marketplace.UpdateProviderResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateProviderRequest) (*marketplace.UpdateProviderResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.UpdateProviderRequest) *marketplace.UpdateProviderResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.UpdateProviderResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.UpdateProviderRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProviderProvidersInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockProviderProvidersInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.UpdateProviderRequest +func (_e *MockProviderProvidersInterface_Expecter) Update(ctx interface{}, request interface{}) *MockProviderProvidersInterface_Update_Call { + return &MockProviderProvidersInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockProviderProvidersInterface_Update_Call) Run(run func(ctx context.Context, request marketplace.UpdateProviderRequest)) *MockProviderProvidersInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.UpdateProviderRequest)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_Update_Call) Return(_a0 *marketplace.UpdateProviderResponse, _a1 error) *MockProviderProvidersInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProviderProvidersInterface_Update_Call) RunAndReturn(run func(context.Context, marketplace.UpdateProviderRequest) (*marketplace.UpdateProviderResponse, error)) *MockProviderProvidersInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockProviderProvidersInterface) WithImpl(impl marketplace.ProviderProvidersService) marketplace.ProviderProvidersInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 marketplace.ProviderProvidersInterface + if rf, ok := ret.Get(0).(func(marketplace.ProviderProvidersService) marketplace.ProviderProvidersInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(marketplace.ProviderProvidersInterface) + } + } + + return r0 +} + +// MockProviderProvidersInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockProviderProvidersInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl marketplace.ProviderProvidersService +func (_e *MockProviderProvidersInterface_Expecter) WithImpl(impl interface{}) *MockProviderProvidersInterface_WithImpl_Call { + return &MockProviderProvidersInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockProviderProvidersInterface_WithImpl_Call) Run(run func(impl marketplace.ProviderProvidersService)) *MockProviderProvidersInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(marketplace.ProviderProvidersService)) + }) + return _c +} + +func (_c *MockProviderProvidersInterface_WithImpl_Call) Return(_a0 marketplace.ProviderProvidersInterface) *MockProviderProvidersInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockProviderProvidersInterface_WithImpl_Call) RunAndReturn(run func(marketplace.ProviderProvidersService) marketplace.ProviderProvidersInterface) *MockProviderProvidersInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockProviderProvidersInterface creates a new instance of MockProviderProvidersInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockProviderProvidersInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockProviderProvidersInterface { + mock := &MockProviderProvidersInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internal/permissions_test.go b/internal/permissions_test.go index 589d66cc6..e5c720baf 100644 --- a/internal/permissions_test.go +++ b/internal/permissions_test.go @@ -80,7 +80,7 @@ func TestUcAccWorkspaceAssignmentOnAws(t *testing.T) { spnId := MustParseInt64(spn.Id) - err = a.WorkspaceAssignment.Update(ctx, iam.UpdateWorkspaceAssignments{ + _, err = a.WorkspaceAssignment.Update(ctx, iam.UpdateWorkspaceAssignments{ WorkspaceId: workspaceId, PrincipalId: spnId, Permissions: []iam.WorkspacePermission{ diff --git a/service/catalog/api.go b/service/catalog/api.go index 68c63400d..43a9c6d20 100755 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -1845,7 +1845,7 @@ type LakehouseMonitorsInterface interface { // // Note that the metric tables and dashboard will not be deleted as part of this // call; those assets must be manually cleaned up (if desired). - DeleteByFullName(ctx context.Context, fullName string) error + DeleteByTableName(ctx context.Context, tableName string) error // Get a table monitor. // @@ -1877,7 +1877,7 @@ type LakehouseMonitorsInterface interface { // information on assets created by the monitor. Some information (e.g., // dashboard) may be filtered out if the caller is in a different workspace than // where the monitor was created. - GetByFullName(ctx context.Context, fullName string) (*MonitorInfo, error) + GetByTableName(ctx context.Context, tableName string) (*MonitorInfo, error) // Get refresh. // @@ -1905,7 +1905,7 @@ type LakehouseMonitorsInterface interface { // // Additionally, the call must be made from the workspace where the monitor was // created. - GetRefreshByFullNameAndRefreshId(ctx context.Context, fullName string, refreshId string) (*MonitorRefreshInfo, error) + GetRefreshByTableNameAndRefreshId(ctx context.Context, tableName string, refreshId string) (*MonitorRefreshInfo, error) // List refreshes. // @@ -1935,7 +1935,7 @@ type LakehouseMonitorsInterface interface { // // Additionally, the call must be made from the workspace where the monitor was // created. - ListRefreshesByFullName(ctx context.Context, fullName string) ([]MonitorRefreshInfo, error) + ListRefreshesByTableName(ctx context.Context, tableName string) ([]MonitorRefreshInfo, error) // Queue a metric refresh for a monitor. // @@ -2074,9 +2074,9 @@ func (a *LakehouseMonitorsAPI) Delete(ctx context.Context, request DeleteLakehou // // Note that the metric tables and dashboard will not be deleted as part of this // call; those assets must be manually cleaned up (if desired). -func (a *LakehouseMonitorsAPI) DeleteByFullName(ctx context.Context, fullName string) error { +func (a *LakehouseMonitorsAPI) DeleteByTableName(ctx context.Context, tableName string) error { return a.impl.Delete(ctx, DeleteLakehouseMonitorRequest{ - FullName: fullName, + TableName: tableName, }) } @@ -2112,9 +2112,9 @@ func (a *LakehouseMonitorsAPI) Get(ctx context.Context, request GetLakehouseMoni // information on assets created by the monitor. Some information (e.g., // dashboard) may be filtered out if the caller is in a different workspace than // where the monitor was created. -func (a *LakehouseMonitorsAPI) GetByFullName(ctx context.Context, fullName string) (*MonitorInfo, error) { +func (a *LakehouseMonitorsAPI) GetByTableName(ctx context.Context, tableName string) (*MonitorInfo, error) { return a.impl.Get(ctx, GetLakehouseMonitorRequest{ - FullName: fullName, + TableName: tableName, }) } @@ -2146,9 +2146,9 @@ func (a *LakehouseMonitorsAPI) GetRefresh(ctx context.Context, request GetRefres // // Additionally, the call must be made from the workspace where the monitor was // created. -func (a *LakehouseMonitorsAPI) GetRefreshByFullNameAndRefreshId(ctx context.Context, fullName string, refreshId string) (*MonitorRefreshInfo, error) { +func (a *LakehouseMonitorsAPI) GetRefreshByTableNameAndRefreshId(ctx context.Context, tableName string, refreshId string) (*MonitorRefreshInfo, error) { return a.impl.GetRefresh(ctx, GetRefreshRequest{ - FullName: fullName, + TableName: tableName, RefreshId: refreshId, }) } @@ -2183,9 +2183,9 @@ func (a *LakehouseMonitorsAPI) ListRefreshes(ctx context.Context, request ListRe // // Additionally, the call must be made from the workspace where the monitor was // created. -func (a *LakehouseMonitorsAPI) ListRefreshesByFullName(ctx context.Context, fullName string) ([]MonitorRefreshInfo, error) { +func (a *LakehouseMonitorsAPI) ListRefreshesByTableName(ctx context.Context, tableName string) ([]MonitorRefreshInfo, error) { return a.impl.ListRefreshes(ctx, ListRefreshesRequest{ - FullName: fullName, + TableName: tableName, }) } diff --git a/service/catalog/impl.go b/service/catalog/impl.go index f34216653..d53166712 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -438,7 +438,7 @@ type lakehouseMonitorsImpl struct { func (a *lakehouseMonitorsImpl) CancelRefresh(ctx context.Context, request CancelRefreshRequest) error { var cancelRefreshResponse CancelRefreshResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v/cancel", request.FullName, request.RefreshId) + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v/cancel", request.TableName, request.RefreshId) headers := make(map[string]string) err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &cancelRefreshResponse) return err @@ -446,7 +446,7 @@ func (a *lakehouseMonitorsImpl) CancelRefresh(ctx context.Context, request Cance func (a *lakehouseMonitorsImpl) Create(ctx context.Context, request CreateMonitor) (*MonitorInfo, error) { var monitorInfo MonitorInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.FullName) + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" @@ -456,7 +456,7 @@ func (a *lakehouseMonitorsImpl) Create(ctx context.Context, request CreateMonito func (a *lakehouseMonitorsImpl) Delete(ctx context.Context, request DeleteLakehouseMonitorRequest) error { var deleteResponse DeleteResponse - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.FullName) + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) headers := make(map[string]string) err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) return err @@ -464,7 +464,7 @@ func (a *lakehouseMonitorsImpl) Delete(ctx context.Context, request DeleteLakeho func (a *lakehouseMonitorsImpl) Get(ctx context.Context, request GetLakehouseMonitorRequest) (*MonitorInfo, error) { var monitorInfo MonitorInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.FullName) + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) headers := make(map[string]string) headers["Accept"] = "application/json" err := a.client.Do(ctx, http.MethodGet, path, headers, request, &monitorInfo) @@ -473,7 +473,7 @@ func (a *lakehouseMonitorsImpl) Get(ctx context.Context, request GetLakehouseMon func (a *lakehouseMonitorsImpl) GetRefresh(ctx context.Context, request GetRefreshRequest) (*MonitorRefreshInfo, error) { var monitorRefreshInfo MonitorRefreshInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v", request.FullName, request.RefreshId) + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v", request.TableName, request.RefreshId) headers := make(map[string]string) headers["Accept"] = "application/json" err := a.client.Do(ctx, http.MethodGet, path, headers, request, &monitorRefreshInfo) @@ -482,7 +482,7 @@ func (a *lakehouseMonitorsImpl) GetRefresh(ctx context.Context, request GetRefre func (a *lakehouseMonitorsImpl) ListRefreshes(ctx context.Context, request ListRefreshesRequest) ([]MonitorRefreshInfo, error) { var monitorRefreshInfoList []MonitorRefreshInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", request.FullName) + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", request.TableName) headers := make(map[string]string) headers["Accept"] = "application/json" err := a.client.Do(ctx, http.MethodGet, path, headers, request, &monitorRefreshInfoList) @@ -491,7 +491,7 @@ func (a *lakehouseMonitorsImpl) ListRefreshes(ctx context.Context, request ListR func (a *lakehouseMonitorsImpl) RunRefresh(ctx context.Context, request RunRefreshRequest) (*MonitorRefreshInfo, error) { var monitorRefreshInfo MonitorRefreshInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", request.FullName) + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", request.TableName) headers := make(map[string]string) headers["Accept"] = "application/json" err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &monitorRefreshInfo) @@ -500,7 +500,7 @@ func (a *lakehouseMonitorsImpl) RunRefresh(ctx context.Context, request RunRefre func (a *lakehouseMonitorsImpl) Update(ctx context.Context, request UpdateMonitor) (*MonitorInfo, error) { var monitorInfo MonitorInfo - path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.FullName) + path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" diff --git a/service/catalog/model.go b/service/catalog/model.go index 866cc3596..0a886bffa 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -148,7 +148,31 @@ func (s AwsIamRoleResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type AzureManagedIdentity struct { +type AzureManagedIdentityRequest struct { + // The Azure resource ID of the Azure Databricks Access Connector. Use the + // format + // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}. + AccessConnectorId string `json:"access_connector_id"` + // The Azure resource ID of the managed identity. Use the format + // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}. + // This is only available for user-assgined identities. For system-assigned + // identities, the access_connector_id is used to identify the identity. If + // this field is not provided, then we assume the AzureManagedIdentity is + // for a system-assigned identity. + ManagedIdentityId string `json:"managed_identity_id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *AzureManagedIdentityRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s AzureManagedIdentityRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type AzureManagedIdentityResponse struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}. @@ -166,11 +190,11 @@ type AzureManagedIdentity struct { ForceSendFields []string `json:"-"` } -func (s *AzureManagedIdentity) UnmarshalJSON(b []byte) error { +func (s *AzureManagedIdentityResponse) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } -func (s AzureManagedIdentity) MarshalJSON() ([]byte, error) { +func (s AzureManagedIdentityResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } @@ -187,10 +211,10 @@ type AzureServicePrincipal struct { // Cancel refresh type CancelRefreshRequest struct { - // Full name of the table. - FullName string `json:"-" url:"-"` // ID of the refresh. RefreshId string `json:"-" url:"-"` + // Full name of the table. + TableName string `json:"-" url:"-"` } type CancelRefreshResponse struct { @@ -943,15 +967,13 @@ type CreateMonitor struct { // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics []MonitorCustomMetric `json:"custom_metrics,omitempty"` + CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` // The data classification config for the monitor. DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - // Full name of the table. - FullName string `json:"-" url:"-"` // Configuration for monitoring inference logs. - InferenceLog *MonitorInferenceLogProfileType `json:"inference_log,omitempty"` + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` // The notification settings for the monitor. - Notifications *MonitorNotificationsConfig `json:"notifications,omitempty"` + Notifications *MonitorNotifications `json:"notifications,omitempty"` // Schema where output metric tables are created. OutputSchemaName string `json:"output_schema_name"` // The schedule for automatically updating and refreshing metric tables. @@ -966,9 +988,11 @@ type CreateMonitor struct { // slices. SlicingExprs []string `json:"slicing_exprs,omitempty"` // Configuration for monitoring snapshot tables. - Snapshot *MonitorSnapshotProfileType `json:"snapshot,omitempty"` + Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + // Full name of the table. + TableName string `json:"-" url:"-"` // Configuration for monitoring time series tables. - TimeSeries *MonitorTimeSeriesProfileType `json:"time_series,omitempty"` + TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` // Optional argument to specify the warehouse for dashboard creation. If not // specified, the first running warehouse will be used. WarehouseId string `json:"warehouse_id,omitempty"` @@ -1056,7 +1080,7 @@ type CreateStorageCredential struct { // The AWS IAM role configuration. AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` // The Azure service principal configuration. AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` // The Cloudflare API token configuration. @@ -1335,7 +1359,7 @@ func (s DeleteFunctionRequest) MarshalJSON() ([]byte, error) { // Delete a table monitor type DeleteLakehouseMonitorRequest struct { // Full name of the table. - FullName string `json:"-" url:"-"` + TableName string `json:"-" url:"-"` } // Delete a metastore @@ -2205,7 +2229,7 @@ func (s GetGrantRequest) MarshalJSON() ([]byte, error) { // Get a table monitor type GetLakehouseMonitorRequest struct { // Full name of the table. - FullName string `json:"-" url:"-"` + TableName string `json:"-" url:"-"` } // Get a metastore @@ -2323,10 +2347,10 @@ type GetOnlineTableRequest struct { // Get refresh type GetRefreshRequest struct { - // Full name of the table. - FullName string `json:"-" url:"-"` // ID of the refresh. RefreshId string `json:"-" url:"-"` + // Full name of the table. + TableName string `json:"-" url:"-"` } // Get a Registered Model @@ -2623,7 +2647,7 @@ func (s ListModelVersionsResponse) MarshalJSON() ([]byte, error) { // List refreshes type ListRefreshesRequest struct { // Full name of the table. - FullName string `json:"-" url:"-"` + TableName string `json:"-" url:"-"` } // List Registered Models @@ -2634,10 +2658,23 @@ type ListRegisteredModelsRequest struct { // Whether to include registered models in the response for which the // principal can only access selective metadata for IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - // Max number of registered models to return. If catalog and schema are - // unspecified, max_results must be specified. If max_results is - // unspecified, we return all results, starting from the page specified by - // page_token. + // Max number of registered models to return. + // + // If both catalog and schema are specified: - when max_results is not + // specified, the page length is set to a server configured value (10000, as + // of 4/2/2024). - when set to a value greater than 0, the page length is + // the minimum of this value and a server configured value (10000, as of + // 4/2/2024); - when set to 0, the page length is set to a server configured + // value (10000, as of 4/2/2024); - when set to a value less than 0, an + // invalid parameter error is returned; + // + // If neither schema nor catalog is specified: - when max_results is not + // specified, the page length is set to a server configured value (100, as + // of 4/2/2024). - when set to a value greater than 0, the page length is + // the minimum of this value and a server configured value (1000, as of + // 4/2/2024); - when set to 0, the page length is set to a server configured + // value (100, as of 4/2/2024); - when set to a value less than 0, an + // invalid parameter error is returned; MaxResults int `json:"-" url:"max_results,omitempty"` // Opaque token to send for the next page of results (pagination). PageToken string `json:"-" url:"page_token,omitempty"` @@ -3156,27 +3193,18 @@ func (f *ModelVersionInfoStatus) Type() string { } type MonitorCronSchedule struct { - // Whether the schedule is paused or not + // Read only field that indicates whether a schedule is paused or not. PauseStatus MonitorCronSchedulePauseStatus `json:"pause_status,omitempty"` - // A cron expression using quartz syntax that describes the schedule for a - // job. - QuartzCronExpression string `json:"quartz_cron_expression,omitempty"` - // A Java timezone id. The schedule for a job will be resolved with respect - // to this timezone. - TimezoneId string `json:"timezone_id,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *MonitorCronSchedule) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s MonitorCronSchedule) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) + // The expression that determines when to run the monitor. See [examples]. + // + // [examples]: https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html + QuartzCronExpression string `json:"quartz_cron_expression"` + // The timezone id (e.g., ``"PST"``) in which to evaluate the quartz + // expression. + TimezoneId string `json:"timezone_id"` } -// Whether the schedule is paused or not +// Read only field that indicates whether a schedule is paused or not. type MonitorCronSchedulePauseStatus string const MonitorCronSchedulePauseStatusPaused MonitorCronSchedulePauseStatus = `PAUSED` @@ -3204,66 +3232,6 @@ func (f *MonitorCronSchedulePauseStatus) Type() string { return "MonitorCronSchedulePauseStatus" } -type MonitorCustomMetric struct { - // Jinja template for a SQL expression that specifies how to compute the - // metric. See [create metric definition]. - // - // [create metric definition]: https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition - Definition string `json:"definition,omitempty"` - // Columns on the monitored table to apply the custom metrics to. - InputColumns []string `json:"input_columns,omitempty"` - // Name of the custom metric. - Name string `json:"name,omitempty"` - // The output type of the custom metric. - OutputDataType string `json:"output_data_type,omitempty"` - // The type of the custom metric. - Type MonitorCustomMetricType `json:"type,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *MonitorCustomMetric) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s MonitorCustomMetric) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) -} - -// The type of the custom metric. -type MonitorCustomMetricType string - -const MonitorCustomMetricTypeCustomMetricTypeAggregate MonitorCustomMetricType = `CUSTOM_METRIC_TYPE_AGGREGATE` - -const MonitorCustomMetricTypeCustomMetricTypeDerived MonitorCustomMetricType = `CUSTOM_METRIC_TYPE_DERIVED` - -const MonitorCustomMetricTypeCustomMetricTypeDrift MonitorCustomMetricType = `CUSTOM_METRIC_TYPE_DRIFT` - -const MonitorCustomMetricTypeMonitorStatusError MonitorCustomMetricType = `MONITOR_STATUS_ERROR` - -const MonitorCustomMetricTypeMonitorStatusFailed MonitorCustomMetricType = `MONITOR_STATUS_FAILED` - -// String representation for [fmt.Print] -func (f *MonitorCustomMetricType) String() string { - return string(*f) -} - -// Set raw string value and validate it against allowed values -func (f *MonitorCustomMetricType) Set(v string) error { - switch v { - case `CUSTOM_METRIC_TYPE_AGGREGATE`, `CUSTOM_METRIC_TYPE_DERIVED`, `CUSTOM_METRIC_TYPE_DRIFT`, `MONITOR_STATUS_ERROR`, `MONITOR_STATUS_FAILED`: - *f = MonitorCustomMetricType(v) - return nil - default: - return fmt.Errorf(`value "%s" is not one of "CUSTOM_METRIC_TYPE_AGGREGATE", "CUSTOM_METRIC_TYPE_DERIVED", "CUSTOM_METRIC_TYPE_DRIFT", "MONITOR_STATUS_ERROR", "MONITOR_STATUS_FAILED"`, v) - } -} - -// Type always returns MonitorCustomMetricType to satisfy [pflag.Value] interface -func (f *MonitorCustomMetricType) Type() string { - return "MonitorCustomMetricType" -} - type MonitorDataClassificationConfig struct { // Whether data classification is enabled. Enabled bool `json:"enabled,omitempty"` @@ -3279,66 +3247,80 @@ func (s MonitorDataClassificationConfig) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type MonitorDestinations struct { +type MonitorDestination struct { // The list of email addresses to send the notification to. A maximum of 5 // email addresses is supported. EmailAddresses []string `json:"email_addresses,omitempty"` } -type MonitorInferenceLogProfileType struct { - // List of granularities to use when aggregating data into time windows - // based on their timestamp. - Granularities []string `json:"granularities,omitempty"` - // Column of the model label. +type MonitorInferenceLog struct { + // Granularities for aggregating data into time windows based on their + // timestamp. Currently the following static granularities are supported: + // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" + // week(s)"``, ``"1 month"``, ``"1 year"``}. + Granularities []string `json:"granularities"` + // Optional column that contains the ground truth for the prediction. LabelCol string `json:"label_col,omitempty"` - // Column of the model id or version. - ModelIdCol string `json:"model_id_col,omitempty"` - // Column of the model prediction. - PredictionCol string `json:"prediction_col,omitempty"` - // Column of the model prediction probabilities. + // Column that contains the id of the model generating the predictions. + // Metrics will be computed per model id by default, and also across all + // model ids. + ModelIdCol string `json:"model_id_col"` + // Column that contains the output/prediction from the model. + PredictionCol string `json:"prediction_col"` + // Optional column that contains the prediction probabilities for each class + // in a classification problem type. The values in this column should be a + // map, mapping each class label to the prediction probability for a given + // sample. The map should be of PySpark MapType(). PredictionProbaCol string `json:"prediction_proba_col,omitempty"` - // Problem type the model aims to solve. - ProblemType MonitorInferenceLogProfileTypeProblemType `json:"problem_type,omitempty"` - // Column of the timestamp of predictions. - TimestampCol string `json:"timestamp_col,omitempty"` + // Problem type the model aims to solve. Determines the type of + // model-quality metrics that will be computed. + ProblemType MonitorInferenceLogProblemType `json:"problem_type"` + // Column that contains the timestamps of requests. The column must be one + // of the following: - A ``TimestampType`` column - A column whose values + // can be converted to timestamps through the pyspark ``to_timestamp`` + // [function]. + // + // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html + TimestampCol string `json:"timestamp_col"` ForceSendFields []string `json:"-"` } -func (s *MonitorInferenceLogProfileType) UnmarshalJSON(b []byte) error { +func (s *MonitorInferenceLog) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } -func (s MonitorInferenceLogProfileType) MarshalJSON() ([]byte, error) { +func (s MonitorInferenceLog) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Problem type the model aims to solve. -type MonitorInferenceLogProfileTypeProblemType string +// Problem type the model aims to solve. Determines the type of model-quality +// metrics that will be computed. +type MonitorInferenceLogProblemType string -const MonitorInferenceLogProfileTypeProblemTypeProblemTypeClassification MonitorInferenceLogProfileTypeProblemType = `PROBLEM_TYPE_CLASSIFICATION` +const MonitorInferenceLogProblemTypeProblemTypeClassification MonitorInferenceLogProblemType = `PROBLEM_TYPE_CLASSIFICATION` -const MonitorInferenceLogProfileTypeProblemTypeProblemTypeRegression MonitorInferenceLogProfileTypeProblemType = `PROBLEM_TYPE_REGRESSION` +const MonitorInferenceLogProblemTypeProblemTypeRegression MonitorInferenceLogProblemType = `PROBLEM_TYPE_REGRESSION` // String representation for [fmt.Print] -func (f *MonitorInferenceLogProfileTypeProblemType) String() string { +func (f *MonitorInferenceLogProblemType) String() string { return string(*f) } // Set raw string value and validate it against allowed values -func (f *MonitorInferenceLogProfileTypeProblemType) Set(v string) error { +func (f *MonitorInferenceLogProblemType) Set(v string) error { switch v { case `PROBLEM_TYPE_CLASSIFICATION`, `PROBLEM_TYPE_REGRESSION`: - *f = MonitorInferenceLogProfileTypeProblemType(v) + *f = MonitorInferenceLogProblemType(v) return nil default: return fmt.Errorf(`value "%s" is not one of "PROBLEM_TYPE_CLASSIFICATION", "PROBLEM_TYPE_REGRESSION"`, v) } } -// Type always returns MonitorInferenceLogProfileTypeProblemType to satisfy [pflag.Value] interface -func (f *MonitorInferenceLogProfileTypeProblemType) Type() string { - return "MonitorInferenceLogProfileTypeProblemType" +// Type always returns MonitorInferenceLogProblemType to satisfy [pflag.Value] interface +func (f *MonitorInferenceLogProblemType) Type() string { + return "MonitorInferenceLogProblemType" } type MonitorInfo struct { @@ -3351,28 +3333,29 @@ type MonitorInfo struct { // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics []MonitorCustomMetric `json:"custom_metrics,omitempty"` - // The ID of the generated dashboard. + CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` + // Id of dashboard that visualizes the computed metrics. This can be empty + // if the monitor is in PENDING state. DashboardId string `json:"dashboard_id,omitempty"` // The data classification config for the monitor. DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` // The full name of the drift metrics table. Format: // __catalog_name__.__schema_name__.__table_name__. - DriftMetricsTableName string `json:"drift_metrics_table_name,omitempty"` + DriftMetricsTableName string `json:"drift_metrics_table_name"` // Configuration for monitoring inference logs. - InferenceLog *MonitorInferenceLogProfileType `json:"inference_log,omitempty"` + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` // The latest failure message of the monitor (if any). LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` // The version of the monitor config (e.g. 1,2,3). If negative, the monitor // may be corrupted. - MonitorVersion string `json:"monitor_version,omitempty"` + MonitorVersion string `json:"monitor_version"` // The notification settings for the monitor. - Notifications *MonitorNotificationsConfig `json:"notifications,omitempty"` + Notifications *MonitorNotifications `json:"notifications,omitempty"` // Schema where output metric tables are created. OutputSchemaName string `json:"output_schema_name,omitempty"` // The full name of the profile metrics table. Format: // __catalog_name__.__schema_name__.__table_name__. - ProfileMetricsTableName string `json:"profile_metrics_table_name,omitempty"` + ProfileMetricsTableName string `json:"profile_metrics_table_name"` // The schedule for automatically updating and refreshing metric tables. Schedule *MonitorCronSchedule `json:"schedule,omitempty"` // List of column expressions to slice data with for targeted analysis. The @@ -3382,14 +3365,14 @@ type MonitorInfo struct { // slices. SlicingExprs []string `json:"slicing_exprs,omitempty"` // Configuration for monitoring snapshot tables. - Snapshot *MonitorSnapshotProfileType `json:"snapshot,omitempty"` + Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` // The status of the monitor. - Status MonitorInfoStatus `json:"status,omitempty"` + Status MonitorInfoStatus `json:"status"` // The full name of the table to monitor. Format: // __catalog_name__.__schema_name__.__table_name__. - TableName string `json:"table_name,omitempty"` + TableName string `json:"table_name"` // Configuration for monitoring time series tables. - TimeSeries *MonitorTimeSeriesProfileType `json:"time_series,omitempty"` + TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` ForceSendFields []string `json:"-"` } @@ -3436,23 +3419,96 @@ func (f *MonitorInfoStatus) Type() string { return "MonitorInfoStatus" } -type MonitorNotificationsConfig struct { +type MonitorMetric struct { + // Jinja template for a SQL expression that specifies how to compute the + // metric. See [create metric definition]. + // + // [create metric definition]: https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition + Definition string `json:"definition"` + // A list of column names in the input table the metric should be computed + // for. Can use ``":table"`` to indicate that the metric needs information + // from multiple columns. + InputColumns []string `json:"input_columns"` + // Name of the metric in the output tables. + Name string `json:"name"` + // The output type of the custom metric. + OutputDataType string `json:"output_data_type"` + // Can only be one of ``"CUSTOM_METRIC_TYPE_AGGREGATE"``, + // ``"CUSTOM_METRIC_TYPE_DERIVED"``, or ``"CUSTOM_METRIC_TYPE_DRIFT"``. The + // ``"CUSTOM_METRIC_TYPE_AGGREGATE"`` and ``"CUSTOM_METRIC_TYPE_DERIVED"`` + // metrics are computed on a single table, whereas the + // ``"CUSTOM_METRIC_TYPE_DRIFT"`` compare metrics across baseline and input + // table, or across the two consecutive time windows. - + // CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your + // table - CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed + // aggregate metrics - CUSTOM_METRIC_TYPE_DRIFT: depend on previously + // computed aggregate or derived metrics + Type MonitorMetricType `json:"type"` +} + +// Can only be one of “"CUSTOM_METRIC_TYPE_AGGREGATE"“, +// “"CUSTOM_METRIC_TYPE_DERIVED"“, or “"CUSTOM_METRIC_TYPE_DRIFT"“. The +// “"CUSTOM_METRIC_TYPE_AGGREGATE"“ and “"CUSTOM_METRIC_TYPE_DERIVED"“ +// metrics are computed on a single table, whereas the +// “"CUSTOM_METRIC_TYPE_DRIFT"“ compare metrics across baseline and input +// table, or across the two consecutive time windows. - +// CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your +// table - CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed aggregate +// metrics - CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate +// or derived metrics +type MonitorMetricType string + +const MonitorMetricTypeCustomMetricTypeAggregate MonitorMetricType = `CUSTOM_METRIC_TYPE_AGGREGATE` + +const MonitorMetricTypeCustomMetricTypeDerived MonitorMetricType = `CUSTOM_METRIC_TYPE_DERIVED` + +const MonitorMetricTypeCustomMetricTypeDrift MonitorMetricType = `CUSTOM_METRIC_TYPE_DRIFT` + +// String representation for [fmt.Print] +func (f *MonitorMetricType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *MonitorMetricType) Set(v string) error { + switch v { + case `CUSTOM_METRIC_TYPE_AGGREGATE`, `CUSTOM_METRIC_TYPE_DERIVED`, `CUSTOM_METRIC_TYPE_DRIFT`: + *f = MonitorMetricType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "CUSTOM_METRIC_TYPE_AGGREGATE", "CUSTOM_METRIC_TYPE_DERIVED", "CUSTOM_METRIC_TYPE_DRIFT"`, v) + } +} + +// Type always returns MonitorMetricType to satisfy [pflag.Value] interface +func (f *MonitorMetricType) Type() string { + return "MonitorMetricType" +} + +type MonitorNotifications struct { // Who to send notifications to on monitor failure. - OnFailure *MonitorDestinations `json:"on_failure,omitempty"` + OnFailure *MonitorDestination `json:"on_failure,omitempty"` + // Who to send notifications to when new data classification tags are + // detected. + OnNewClassificationTagDetected *MonitorDestination `json:"on_new_classification_tag_detected,omitempty"` } type MonitorRefreshInfo struct { - // The time at which the refresh ended, in epoch milliseconds. + // Time at which refresh operation completed (milliseconds since 1/1/1970 + // UTC). EndTimeMs int64 `json:"end_time_ms,omitempty"` // An optional message to give insight into the current state of the job // (e.g. FAILURE messages). Message string `json:"message,omitempty"` - // The ID of the refresh. - RefreshId int64 `json:"refresh_id,omitempty"` - // The time at which the refresh started, in epoch milliseconds. - StartTimeMs int64 `json:"start_time_ms,omitempty"` + // Unique id of the refresh operation. + RefreshId int64 `json:"refresh_id"` + // Time at which refresh operation was initiated (milliseconds since + // 1/1/1970 UTC). + StartTimeMs int64 `json:"start_time_ms"` // The current state of the refresh. - State MonitorRefreshInfoState `json:"state,omitempty"` + State MonitorRefreshInfoState `json:"state"` + // The method by which the refresh was triggered. + Trigger MonitorRefreshInfoTrigger `json:"trigger,omitempty"` ForceSendFields []string `json:"-"` } @@ -3499,26 +3555,50 @@ func (f *MonitorRefreshInfoState) Type() string { return "MonitorRefreshInfoState" } -type MonitorSnapshotProfileType struct { +// The method by which the refresh was triggered. +type MonitorRefreshInfoTrigger string + +const MonitorRefreshInfoTriggerManual MonitorRefreshInfoTrigger = `MANUAL` + +const MonitorRefreshInfoTriggerSchedule MonitorRefreshInfoTrigger = `SCHEDULE` + +// String representation for [fmt.Print] +func (f *MonitorRefreshInfoTrigger) String() string { + return string(*f) } -type MonitorTimeSeriesProfileType struct { - // List of granularities to use when aggregating data into time windows - // based on their timestamp. - Granularities []string `json:"granularities,omitempty"` - // The timestamp column. This must be timestamp types or convertible to - // timestamp types using the pyspark to_timestamp function. - TimestampCol string `json:"timestamp_col,omitempty"` +// Set raw string value and validate it against allowed values +func (f *MonitorRefreshInfoTrigger) Set(v string) error { + switch v { + case `MANUAL`, `SCHEDULE`: + *f = MonitorRefreshInfoTrigger(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "MANUAL", "SCHEDULE"`, v) + } +} - ForceSendFields []string `json:"-"` +// Type always returns MonitorRefreshInfoTrigger to satisfy [pflag.Value] interface +func (f *MonitorRefreshInfoTrigger) Type() string { + return "MonitorRefreshInfoTrigger" } -func (s *MonitorTimeSeriesProfileType) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +type MonitorSnapshot struct { } -func (s MonitorTimeSeriesProfileType) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +type MonitorTimeSeries struct { + // Granularities for aggregating data into time windows based on their + // timestamp. Currently the following static granularities are supported: + // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" + // week(s)"``, ``"1 month"``, ``"1 year"``}. + Granularities []string `json:"granularities"` + // Column that contains the timestamps of requests. The column must be one + // of the following: - A ``TimestampType`` column - A column whose values + // can be converted to timestamps through the pyspark ``to_timestamp`` + // [function]. + // + // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html + TimestampCol string `json:"timestamp_col"` } type NamedTableConstraint struct { @@ -3982,7 +4062,7 @@ func (s RegisteredModelInfo) MarshalJSON() ([]byte, error) { // Queue a metric refresh for a monitor type RunRefreshRequest struct { // Full name of the table. - FullName string `json:"-" url:"-"` + TableName string `json:"-" url:"-"` } type SchemaInfo struct { @@ -4158,7 +4238,7 @@ type StorageCredentialInfo struct { // The AWS IAM role configuration. AwsIamRole *AwsIamRoleResponse `json:"aws_iam_role,omitempty"` // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` // The Azure service principal configuration. AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` // The Cloudflare API token configuration. @@ -4377,12 +4457,12 @@ func (s TableInfo) MarshalJSON() ([]byte, error) { } type TableRowFilter struct { + // The full name of the row filter SQL UDF. + FunctionName string `json:"function_name"` // The list of table columns to be passed as input to the row filter // function. The column types should match the types of the filter function // arguments. InputColumnNames []string `json:"input_column_names"` - // The full name of the row filter SQL UDF. - Name string `json:"name"` } type TableSummary struct { @@ -4683,15 +4763,13 @@ type UpdateMonitor struct { // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics []MonitorCustomMetric `json:"custom_metrics,omitempty"` + CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` // The data classification config for the monitor. DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - // Full name of the table. - FullName string `json:"-" url:"-"` // Configuration for monitoring inference logs. - InferenceLog *MonitorInferenceLogProfileType `json:"inference_log,omitempty"` + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` // The notification settings for the monitor. - Notifications *MonitorNotificationsConfig `json:"notifications,omitempty"` + Notifications *MonitorNotifications `json:"notifications,omitempty"` // Schema where output metric tables are created. OutputSchemaName string `json:"output_schema_name"` // The schedule for automatically updating and refreshing metric tables. @@ -4703,9 +4781,11 @@ type UpdateMonitor struct { // slices. SlicingExprs []string `json:"slicing_exprs,omitempty"` // Configuration for monitoring snapshot tables. - Snapshot *MonitorSnapshotProfileType `json:"snapshot,omitempty"` + Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` + // Full name of the table. + TableName string `json:"-" url:"-"` // Configuration for monitoring time series tables. - TimeSeries *MonitorTimeSeriesProfileType `json:"time_series,omitempty"` + TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` ForceSendFields []string `json:"-"` } @@ -4781,7 +4861,7 @@ type UpdateStorageCredential struct { // The AWS IAM role configuration. AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + AzureManagedIdentity *AzureManagedIdentityResponse `json:"azure_managed_identity,omitempty"` // The Azure service principal configuration. AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` // The Cloudflare API token configuration. @@ -4879,7 +4959,7 @@ type ValidateStorageCredential struct { // The AWS IAM role configuration. AwsIamRole *AwsIamRoleRequest `json:"aws_iam_role,omitempty"` // The Azure managed identity configuration. - AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` + AzureManagedIdentity *AzureManagedIdentityRequest `json:"azure_managed_identity,omitempty"` // The Azure service principal configuration. AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` // The Cloudflare API token configuration. @@ -4924,10 +5004,14 @@ func (s ValidateStorageCredentialResponse) MarshalJSON() ([]byte, error) { } type ValidationResult struct { + // The operation tested. + AwsOperation ValidationResultAwsOperation `json:"aws_operation,omitempty"` + // The operation tested. + AzureOperation ValidationResultAzureOperation `json:"azure_operation,omitempty"` + // The operation tested. + GcpOperation ValidationResultGcpOperation `json:"gcp_operation,omitempty"` // Error message would exist when the result does not equal to **PASS**. Message string `json:"message,omitempty"` - // The operation tested. - Operation ValidationResultOperation `json:"operation,omitempty"` // The results of the tested operation. Result ValidationResultResult `json:"result,omitempty"` @@ -4943,35 +5027,107 @@ func (s ValidationResult) MarshalJSON() ([]byte, error) { } // The operation tested. -type ValidationResultOperation string +type ValidationResultAwsOperation string + +const ValidationResultAwsOperationDelete ValidationResultAwsOperation = `DELETE` + +const ValidationResultAwsOperationList ValidationResultAwsOperation = `LIST` + +const ValidationResultAwsOperationPathExists ValidationResultAwsOperation = `PATH_EXISTS` + +const ValidationResultAwsOperationRead ValidationResultAwsOperation = `READ` + +const ValidationResultAwsOperationWrite ValidationResultAwsOperation = `WRITE` + +// String representation for [fmt.Print] +func (f *ValidationResultAwsOperation) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ValidationResultAwsOperation) Set(v string) error { + switch v { + case `DELETE`, `LIST`, `PATH_EXISTS`, `READ`, `WRITE`: + *f = ValidationResultAwsOperation(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DELETE", "LIST", "PATH_EXISTS", "READ", "WRITE"`, v) + } +} + +// Type always returns ValidationResultAwsOperation to satisfy [pflag.Value] interface +func (f *ValidationResultAwsOperation) Type() string { + return "ValidationResultAwsOperation" +} + +// The operation tested. +type ValidationResultAzureOperation string + +const ValidationResultAzureOperationDelete ValidationResultAzureOperation = `DELETE` + +const ValidationResultAzureOperationHierarchicalNamespaceEnabled ValidationResultAzureOperation = `HIERARCHICAL_NAMESPACE_ENABLED` + +const ValidationResultAzureOperationList ValidationResultAzureOperation = `LIST` + +const ValidationResultAzureOperationPathExists ValidationResultAzureOperation = `PATH_EXISTS` + +const ValidationResultAzureOperationRead ValidationResultAzureOperation = `READ` + +const ValidationResultAzureOperationWrite ValidationResultAzureOperation = `WRITE` + +// String representation for [fmt.Print] +func (f *ValidationResultAzureOperation) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ValidationResultAzureOperation) Set(v string) error { + switch v { + case `DELETE`, `HIERARCHICAL_NAMESPACE_ENABLED`, `LIST`, `PATH_EXISTS`, `READ`, `WRITE`: + *f = ValidationResultAzureOperation(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DELETE", "HIERARCHICAL_NAMESPACE_ENABLED", "LIST", "PATH_EXISTS", "READ", "WRITE"`, v) + } +} + +// Type always returns ValidationResultAzureOperation to satisfy [pflag.Value] interface +func (f *ValidationResultAzureOperation) Type() string { + return "ValidationResultAzureOperation" +} + +// The operation tested. +type ValidationResultGcpOperation string + +const ValidationResultGcpOperationDelete ValidationResultGcpOperation = `DELETE` -const ValidationResultOperationDelete ValidationResultOperation = `DELETE` +const ValidationResultGcpOperationList ValidationResultGcpOperation = `LIST` -const ValidationResultOperationList ValidationResultOperation = `LIST` +const ValidationResultGcpOperationPathExists ValidationResultGcpOperation = `PATH_EXISTS` -const ValidationResultOperationRead ValidationResultOperation = `READ` +const ValidationResultGcpOperationRead ValidationResultGcpOperation = `READ` -const ValidationResultOperationWrite ValidationResultOperation = `WRITE` +const ValidationResultGcpOperationWrite ValidationResultGcpOperation = `WRITE` // String representation for [fmt.Print] -func (f *ValidationResultOperation) String() string { +func (f *ValidationResultGcpOperation) String() string { return string(*f) } // Set raw string value and validate it against allowed values -func (f *ValidationResultOperation) Set(v string) error { +func (f *ValidationResultGcpOperation) Set(v string) error { switch v { - case `DELETE`, `LIST`, `READ`, `WRITE`: - *f = ValidationResultOperation(v) + case `DELETE`, `LIST`, `PATH_EXISTS`, `READ`, `WRITE`: + *f = ValidationResultGcpOperation(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "DELETE", "LIST", "READ", "WRITE"`, v) + return fmt.Errorf(`value "%s" is not one of "DELETE", "LIST", "PATH_EXISTS", "READ", "WRITE"`, v) } } -// Type always returns ValidationResultOperation to satisfy [pflag.Value] interface -func (f *ValidationResultOperation) Type() string { - return "ValidationResultOperation" +// Type always returns ValidationResultGcpOperation to satisfy [pflag.Value] interface +func (f *ValidationResultGcpOperation) Type() string { + return "ValidationResultGcpOperation" } // The results of the tested operation. diff --git a/service/compute/model.go b/service/compute/model.go index 06674c5f0..d6f91c4c5 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -323,6 +323,11 @@ func (s ClientsTypes) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CloneCluster struct { + // The cluster that is being cloned. + SourceClusterId string `json:"source_cluster_id"` +} + type CloudProviderNodeInfo struct { Status []CloudProviderNodeStatus `json:"status,omitempty"` } @@ -1105,6 +1110,9 @@ type ClusterSpec struct { // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + // When specified, this clones libraries from a source cluster during the + // creation of a new cluster. + CloneFrom *CloneCluster `json:"clone_from,omitempty"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, @@ -1328,37 +1336,6 @@ func (s CommandStatusResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type ComputeSpec struct { - // The kind of compute described by this compute specification. - Kind ComputeSpecKind `json:"kind,omitempty"` -} - -// The kind of compute described by this compute specification. -type ComputeSpecKind string - -const ComputeSpecKindServerlessPreview ComputeSpecKind = `SERVERLESS_PREVIEW` - -// String representation for [fmt.Print] -func (f *ComputeSpecKind) String() string { - return string(*f) -} - -// Set raw string value and validate it against allowed values -func (f *ComputeSpecKind) Set(v string) error { - switch v { - case `SERVERLESS_PREVIEW`: - *f = ComputeSpecKind(v) - return nil - default: - return fmt.Errorf(`value "%s" is not one of "SERVERLESS_PREVIEW"`, v) - } -} - -// Type always returns ComputeSpecKind to satisfy [pflag.Value] interface -func (f *ComputeSpecKind) Type() string { - return "ComputeSpecKind" -} - type ContextStatus string const ContextStatusError ContextStatus = `Error` @@ -1429,6 +1406,9 @@ type CreateCluster struct { // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + // When specified, this clones libraries from a source cluster during the + // creation of a new cluster. + CloneFrom *CloneCluster `json:"clone_from,omitempty"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, @@ -2111,6 +2091,9 @@ type EditCluster struct { // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. AzureAttributes *AzureAttributes `json:"azure_attributes,omitempty"` + // When specified, this clones libraries from a source cluster during the + // creation of a new cluster. + CloneFrom *CloneCluster `json:"clone_from,omitempty"` // ID of the cluser ClusterId string `json:"cluster_id"` // The configuration for delivering spark logs to a long-term storage @@ -2351,6 +2334,22 @@ type EditPolicyResponse struct { type EditResponse struct { } +// The a environment entity used to preserve serverless environment side panel +// and jobs' environment for non-notebook task. In this minimal environment +// spec, only pip dependencies are supported. Next ID: 5 +type Environment struct { + // * User-friendly name for the client version: “client”: “1” The + // version is a string, consisting of the major client version + Client string `json:"client"` + // List of pip dependencies, as supported by the version of pip in this + // environment. Each dependency is a pip requirement file line + // https://pip.pypa.io/en/stable/reference/requirements-file-format/ Allowed + // dependency could be , , (WSFS or Volumes in Databricks), E.g. + // dependencies: ["foo==0.0.1", "-r /Workspace/test/requirements.txt"] + Dependencies []string `json:"dependencies,omitempty"` +} + type EventDetails struct { // * For created clusters, the attributes of the cluster. * For edited // clusters, the new attributes of the cluster. diff --git a/service/iam/api.go b/service/iam/api.go index 19476ad38..8e4dca9a6 100755 --- a/service/iam/api.go +++ b/service/iam/api.go @@ -2244,7 +2244,7 @@ type WorkspaceAssignmentInterface interface { // // Creates or updates the workspace permissions assignment in a given account // and workspace for the specified principal. - Update(ctx context.Context, request UpdateWorkspaceAssignments) error + Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error) } func NewWorkspaceAssignment(client *client.DatabricksClient) *WorkspaceAssignmentAPI { @@ -2363,6 +2363,6 @@ func (a *WorkspaceAssignmentAPI) ListByWorkspaceId(ctx context.Context, workspac // // Creates or updates the workspace permissions assignment in a given account // and workspace for the specified principal. -func (a *WorkspaceAssignmentAPI) Update(ctx context.Context, request UpdateWorkspaceAssignments) error { +func (a *WorkspaceAssignmentAPI) Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error) { return a.impl.Update(ctx, request) } diff --git a/service/iam/impl.go b/service/iam/impl.go index 934fb9669..97b325e7d 100755 --- a/service/iam/impl.go +++ b/service/iam/impl.go @@ -584,12 +584,12 @@ func (a *workspaceAssignmentImpl) List(ctx context.Context, request ListWorkspac return &permissionAssignments, err } -func (a *workspaceAssignmentImpl) Update(ctx context.Context, request UpdateWorkspaceAssignments) error { - var workspaceAssignmentsUpdated WorkspaceAssignmentsUpdated +func (a *workspaceAssignmentImpl) Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error) { + var permissionAssignment PermissionAssignment path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/principals/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.PrincipalId) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &workspaceAssignmentsUpdated) - return err + err := a.client.Do(ctx, http.MethodPut, path, headers, request, &permissionAssignment) + return &permissionAssignment, err } diff --git a/service/iam/interface.go b/service/iam/interface.go index 9958fbdd4..59c25c67e 100755 --- a/service/iam/interface.go +++ b/service/iam/interface.go @@ -484,5 +484,5 @@ type WorkspaceAssignmentService interface { // // Creates or updates the workspace permissions assignment in a given // account and workspace for the specified principal. - Update(ctx context.Context, request UpdateWorkspaceAssignments) error + Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error) } diff --git a/service/iam/model.go b/service/iam/model.go index c144eefa6..efe5ef174 100755 --- a/service/iam/model.go +++ b/service/iam/model.go @@ -214,7 +214,7 @@ type GetPermissionRequest struct { // The type of the request object. Can be one of the following: // authorization, clusters, cluster-policies, directories, experiments, // files, instance-pools, jobs, notebooks, pipelines, registered-models, - // repos, serving-endpoints, or sql-warehouses. + // repos, serving-endpoints, or warehouses. RequestObjectType string `json:"-" url:"-"` } @@ -1135,14 +1135,14 @@ type PermissionsRequest struct { // The type of the request object. Can be one of the following: // authorization, clusters, cluster-policies, directories, experiments, // files, instance-pools, jobs, notebooks, pipelines, registered-models, - // repos, serving-endpoints, or sql-warehouses. + // repos, serving-endpoints, or warehouses. RequestObjectType string `json:"-" url:"-"` } type PrincipalOutput struct { // The display name of the principal. DisplayName string `json:"display_name,omitempty"` - // The group name of the groupl. Present only if the principal is a group. + // The group name of the group. Present only if the principal is a group. GroupName string `json:"group_name,omitempty"` // The unique, opaque id of the principal. PrincipalId int64 `json:"principal_id,omitempty"` @@ -1284,7 +1284,9 @@ type UpdateRuleSetRequest struct { } type UpdateWorkspaceAssignments struct { - // Array of permissions assignments to update on the workspace. + // Array of permissions assignments to update on the workspace. Note that + // excluding this field will have the same effect as providing an empty list + // which will result in the deletion of all permissions for the principal. Permissions []WorkspacePermission `json:"permissions"` // The ID of the user, service principal, or group. PrincipalId int64 `json:"-" url:"-"` @@ -1315,7 +1317,7 @@ type User struct { Groups []ComplexValue `json:"groups,omitempty"` // Databricks user ID. This is automatically set by Databricks. Any value // provided by the client will be ignored. - Id string `json:"id,omitempty" url:"-"` + Id string `json:"id,omitempty"` Name *Name `json:"name,omitempty"` // Corresponds to AWS instance profile/arn role. @@ -1363,9 +1365,6 @@ func (f *UserSchema) Type() string { return "UserSchema" } -type WorkspaceAssignmentsUpdated struct { -} - type WorkspacePermission string const WorkspacePermissionAdmin WorkspacePermission = `ADMIN` diff --git a/service/iam/workspace_assignment_usage_test.go b/service/iam/workspace_assignment_usage_test.go index 4222b1178..3ea024d3f 100755 --- a/service/iam/workspace_assignment_usage_test.go +++ b/service/iam/workspace_assignment_usage_test.go @@ -69,7 +69,7 @@ func ExampleWorkspaceAssignmentAPI_Update_workspaceAssignmentOnAws() { return i }(os.Getenv("DUMMY_WORKSPACE_ID")) - err = a.WorkspaceAssignment.Update(ctx, iam.UpdateWorkspaceAssignments{ + _, err = a.WorkspaceAssignment.Update(ctx, iam.UpdateWorkspaceAssignments{ WorkspaceId: workspaceId, PrincipalId: spnId, Permissions: []iam.WorkspacePermission{iam.WorkspacePermissionUser}, diff --git a/service/jobs/model.go b/service/jobs/model.go index 394487fb0..684be1160 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -228,9 +228,6 @@ func (s ClusterInstance) MarshalJSON() ([]byte, error) { } type ClusterSpec struct { - // The key of the compute requirement, specified in `job.settings.compute`, - // to use for execution of this task. - ComputeKey string `json:"compute_key,omitempty"` // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest @@ -358,9 +355,6 @@ type Continuous struct { type CreateJob struct { // List of permissions to set on the job. AccessControlList []iam.AccessControlRequest `json:"access_control_list,omitempty"` - // A list of compute requirements that can be referenced by tasks of this - // job. - Compute []JobCompute `json:"compute,omitempty"` // An optional continuous property for this job. The continuous property // will ensure that there is always one run executing. Only one of // `schedule` and `continuous` can be used. @@ -378,6 +372,9 @@ type CreateJob struct { // An optional set of email addresses that is notified when runs of this job // begin or complete as well as when this job is deleted. EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + // A list of task execution environment specifications that can be + // referenced by tasks of this job. + Environments []JobEnvironment `json:"environments,omitempty"` // Used to tell what is the format of the job. This field is ignored in // Create/Update/Reset calls. When using the Jobs API 2.1 this value is // always set to `"MULTI_TASK"`. @@ -956,15 +953,6 @@ type JobCluster struct { NewCluster compute.ClusterSpec `json:"new_cluster"` } -type JobCompute struct { - // A unique name for the compute requirement. This field is required and - // must be unique within the job. `JobTaskSettings` may refer to this field - // to determine the compute requirements for the task execution. - ComputeKey string `json:"compute_key"` - - Spec compute.ComputeSpec `json:"spec"` -} - type JobDeployment struct { // The kind of deployment that manages the job. // @@ -1081,6 +1069,15 @@ func (s JobEmailNotifications) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type JobEnvironment struct { + // The key of an environment. It has to be unique within a job. + EnvironmentKey string `json:"environment_key"` + // The a environment entity used to preserve serverless environment side + // panel and jobs' environment for non-notebook task. In this minimal + // environment spec, only pip dependencies are supported. Next ID: 5 + Spec *compute.Environment `json:"spec,omitempty"` +} + type JobNotificationSettings struct { // If true, do not send notifications to recipients specified in // `on_failure` if the run is canceled. @@ -1243,9 +1240,6 @@ func (s JobRunAs) MarshalJSON() ([]byte, error) { } type JobSettings struct { - // A list of compute requirements that can be referenced by tasks of this - // job. - Compute []JobCompute `json:"compute,omitempty"` // An optional continuous property for this job. The continuous property // will ensure that there is always one run executing. Only one of // `schedule` and `continuous` can be used. @@ -1263,6 +1257,9 @@ type JobSettings struct { // An optional set of email addresses that is notified when runs of this job // begin or complete as well as when this job is deleted. EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` + // A list of task execution environment specifications that can be + // referenced by tasks of this job. + Environments []JobEnvironment `json:"environments,omitempty"` // Used to tell what is the format of the job. This field is ignored in // Create/Update/Reset calls. When using the Jobs API 2.1 this value is // always set to `"MULTI_TASK"`. @@ -2805,9 +2802,6 @@ type RunTask struct { // cluster, this field is set once the Jobs service has requested a cluster // for the run. ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"` - // The key of the compute requirement, specified in `job.settings.compute`, - // to use for execution of this task. - ComputeKey string `json:"compute_key,omitempty"` // If condition_task, specifies a condition with an outcome that can be used // to control the execution of other tasks. Does not require a cluster to // execute and does not support retries or notifications. @@ -3619,7 +3613,7 @@ func (s SubmitTask) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type TableTriggerConfiguration struct { +type TableUpdateTriggerConfiguration struct { // The table(s) condition based on which to trigger a job run. Condition Condition `json:"condition,omitempty"` // If set, the trigger starts a run only after the specified amount of time @@ -3638,18 +3632,15 @@ type TableTriggerConfiguration struct { ForceSendFields []string `json:"-"` } -func (s *TableTriggerConfiguration) UnmarshalJSON(b []byte) error { +func (s *TableUpdateTriggerConfiguration) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } -func (s TableTriggerConfiguration) MarshalJSON() ([]byte, error) { +func (s TableUpdateTriggerConfiguration) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } type Task struct { - // The key of the compute requirement, specified in `job.settings.compute`, - // to use for execution of this task. - ComputeKey string `json:"compute_key,omitempty"` // If condition_task, specifies a condition with an outcome that can be used // to control the execution of other tasks. Does not require a cluster to // execute and does not support retries or notifications. @@ -3671,6 +3662,10 @@ type Task struct { // task begin or complete as well as when this task is deleted. The default // behavior is to not send any emails. EmailNotifications *TaskEmailNotifications `json:"email_notifications,omitempty"` + // The key that references an environment spec in a job. This field is + // required for Python script, Python wheel and dbt tasks when using + // serverless compute. + EnvironmentKey string `json:"environment_key,omitempty"` // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest @@ -3873,9 +3868,9 @@ type TriggerSettings struct { // Whether this trigger is paused or not. PauseStatus PauseStatus `json:"pause_status,omitempty"` // Old table trigger settings name. Deprecated in favor of `table_update`. - Table *TableTriggerConfiguration `json:"table,omitempty"` + Table *TableUpdateTriggerConfiguration `json:"table,omitempty"` - TableUpdate *TableTriggerConfiguration `json:"table_update,omitempty"` + TableUpdate *TableUpdateTriggerConfiguration `json:"table_update,omitempty"` } // The type of trigger that fired this run. diff --git a/service/marketplace/api.go b/service/marketplace/api.go new file mode 100755 index 000000000..d6ea7e048 --- /dev/null +++ b/service/marketplace/api.go @@ -0,0 +1,2680 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +// These APIs allow you to manage Consumer Fulfillments, Consumer Installations, Consumer Listings, Consumer Personalization Requests, Consumer Providers, Provider Exchange Filters, Provider Exchanges, Provider Files, Provider Listings, Provider Personalization Requests, Provider Provider Analytics Dashboards, Provider Providers, etc. +package marketplace + +import ( + "context" + "fmt" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" + "github.com/databricks/databricks-sdk-go/useragent" +) + +type ConsumerFulfillmentsInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockConsumerFulfillmentsInterface instead. + WithImpl(impl ConsumerFulfillmentsService) ConsumerFulfillmentsInterface + + // Impl returns low-level ConsumerFulfillments API implementation + // Deprecated: use MockConsumerFulfillmentsInterface instead. + Impl() ConsumerFulfillmentsService + + // Get listing content metadata. + // + // Get a high level preview of the metadata of listing installable content. + // + // This method is generated by Databricks SDK Code Generator. + Get(ctx context.Context, request GetListingContentMetadataRequest) listing.Iterator[SharedDataObject] + + // Get listing content metadata. + // + // Get a high level preview of the metadata of listing installable content. + // + // This method is generated by Databricks SDK Code Generator. + GetAll(ctx context.Context, request GetListingContentMetadataRequest) ([]SharedDataObject, error) + + // Get listing content metadata. + // + // Get a high level preview of the metadata of listing installable content. + GetByListingId(ctx context.Context, listingId string) (*GetListingContentMetadataResponse, error) + + // List all listing fulfillments. + // + // Get all listings fulfillments associated with a listing. A _fulfillment_ is a + // potential installation. Standard installations contain metadata about the + // attached share or git repo. Only one of these fields will be present. + // Personalized installations contain metadata about the attached share or git + // repo, as well as the Delta Sharing recipient type. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListFulfillmentsRequest) listing.Iterator[ListingFulfillment] + + // List all listing fulfillments. + // + // Get all listings fulfillments associated with a listing. A _fulfillment_ is a + // potential installation. Standard installations contain metadata about the + // attached share or git repo. Only one of these fields will be present. + // Personalized installations contain metadata about the attached share or git + // repo, as well as the Delta Sharing recipient type. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListFulfillmentsRequest) ([]ListingFulfillment, error) + + // List all listing fulfillments. + // + // Get all listings fulfillments associated with a listing. A _fulfillment_ is a + // potential installation. Standard installations contain metadata about the + // attached share or git repo. Only one of these fields will be present. + // Personalized installations contain metadata about the attached share or git + // repo, as well as the Delta Sharing recipient type. + ListByListingId(ctx context.Context, listingId string) (*ListFulfillmentsResponse, error) +} + +func NewConsumerFulfillments(client *client.DatabricksClient) *ConsumerFulfillmentsAPI { + return &ConsumerFulfillmentsAPI{ + impl: &consumerFulfillmentsImpl{ + client: client, + }, + } +} + +// Fulfillments are entities that allow consumers to preview installations. +type ConsumerFulfillmentsAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ConsumerFulfillmentsService) + impl ConsumerFulfillmentsService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockConsumerFulfillmentsInterface instead. +func (a *ConsumerFulfillmentsAPI) WithImpl(impl ConsumerFulfillmentsService) ConsumerFulfillmentsInterface { + a.impl = impl + return a +} + +// Impl returns low-level ConsumerFulfillments API implementation +// Deprecated: use MockConsumerFulfillmentsInterface instead. +func (a *ConsumerFulfillmentsAPI) Impl() ConsumerFulfillmentsService { + return a.impl +} + +// Get listing content metadata. +// +// Get a high level preview of the metadata of listing installable content. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerFulfillmentsAPI) Get(ctx context.Context, request GetListingContentMetadataRequest) listing.Iterator[SharedDataObject] { + + getNextPage := func(ctx context.Context, req GetListingContentMetadataRequest) (*GetListingContentMetadataResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.Get(ctx, req) + } + getItems := func(resp *GetListingContentMetadataResponse) []SharedDataObject { + return resp.SharedDataObjects + } + getNextReq := func(resp *GetListingContentMetadataResponse) *GetListingContentMetadataRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Get listing content metadata. +// +// Get a high level preview of the metadata of listing installable content. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerFulfillmentsAPI) GetAll(ctx context.Context, request GetListingContentMetadataRequest) ([]SharedDataObject, error) { + iterator := a.Get(ctx, request) + return listing.ToSlice[SharedDataObject](ctx, iterator) +} + +// Get listing content metadata. +// +// Get a high level preview of the metadata of listing installable content. +func (a *ConsumerFulfillmentsAPI) GetByListingId(ctx context.Context, listingId string) (*GetListingContentMetadataResponse, error) { + return a.impl.Get(ctx, GetListingContentMetadataRequest{ + ListingId: listingId, + }) +} + +// List all listing fulfillments. +// +// Get all listings fulfillments associated with a listing. A _fulfillment_ is a +// potential installation. Standard installations contain metadata about the +// attached share or git repo. Only one of these fields will be present. +// Personalized installations contain metadata about the attached share or git +// repo, as well as the Delta Sharing recipient type. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerFulfillmentsAPI) List(ctx context.Context, request ListFulfillmentsRequest) listing.Iterator[ListingFulfillment] { + + getNextPage := func(ctx context.Context, req ListFulfillmentsRequest) (*ListFulfillmentsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListFulfillmentsResponse) []ListingFulfillment { + return resp.Fulfillments + } + getNextReq := func(resp *ListFulfillmentsResponse) *ListFulfillmentsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List all listing fulfillments. +// +// Get all listings fulfillments associated with a listing. A _fulfillment_ is a +// potential installation. Standard installations contain metadata about the +// attached share or git repo. Only one of these fields will be present. +// Personalized installations contain metadata about the attached share or git +// repo, as well as the Delta Sharing recipient type. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerFulfillmentsAPI) ListAll(ctx context.Context, request ListFulfillmentsRequest) ([]ListingFulfillment, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[ListingFulfillment](ctx, iterator) +} + +// List all listing fulfillments. +// +// Get all listings fulfillments associated with a listing. A _fulfillment_ is a +// potential installation. Standard installations contain metadata about the +// attached share or git repo. Only one of these fields will be present. +// Personalized installations contain metadata about the attached share or git +// repo, as well as the Delta Sharing recipient type. +func (a *ConsumerFulfillmentsAPI) ListByListingId(ctx context.Context, listingId string) (*ListFulfillmentsResponse, error) { + return a.impl.List(ctx, ListFulfillmentsRequest{ + ListingId: listingId, + }) +} + +type ConsumerInstallationsInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockConsumerInstallationsInterface instead. + WithImpl(impl ConsumerInstallationsService) ConsumerInstallationsInterface + + // Impl returns low-level ConsumerInstallations API implementation + // Deprecated: use MockConsumerInstallationsInterface instead. + Impl() ConsumerInstallationsService + + // Install from a listing. + // + // Install payload associated with a Databricks Marketplace listing. + Create(ctx context.Context, request CreateInstallationRequest) (*Installation, error) + + // Uninstall from a listing. + // + // Uninstall an installation associated with a Databricks Marketplace listing. + Delete(ctx context.Context, request DeleteInstallationRequest) error + + // Uninstall from a listing. + // + // Uninstall an installation associated with a Databricks Marketplace listing. + DeleteByListingIdAndInstallationId(ctx context.Context, listingId string, installationId string) error + + // List all installations. + // + // List all installations across all listings. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListAllInstallationsRequest) listing.Iterator[InstallationDetail] + + // List all installations. + // + // List all installations across all listings. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListAllInstallationsRequest) ([]InstallationDetail, error) + + // List installations for a listing. + // + // List all installations for a particular listing. + // + // This method is generated by Databricks SDK Code Generator. + ListListingInstallations(ctx context.Context, request ListInstallationsRequest) listing.Iterator[InstallationDetail] + + // List installations for a listing. + // + // List all installations for a particular listing. + // + // This method is generated by Databricks SDK Code Generator. + ListListingInstallationsAll(ctx context.Context, request ListInstallationsRequest) ([]InstallationDetail, error) + + // List installations for a listing. + // + // List all installations for a particular listing. + ListListingInstallationsByListingId(ctx context.Context, listingId string) (*ListInstallationsResponse, error) + + // Update an installation. + // + // This is a update API that will update the part of the fields defined in the + // installation table as well as interact with external services according to + // the fields not included in the installation table 1. the token will be rotate + // if the rotateToken flag is true 2. the token will be forcibly rotate if the + // rotateToken flag is true and the tokenInfo field is empty + Update(ctx context.Context, request UpdateInstallationRequest) (*UpdateInstallationResponse, error) +} + +func NewConsumerInstallations(client *client.DatabricksClient) *ConsumerInstallationsAPI { + return &ConsumerInstallationsAPI{ + impl: &consumerInstallationsImpl{ + client: client, + }, + } +} + +// Installations are entities that allow consumers to interact with Databricks +// Marketplace listings. +type ConsumerInstallationsAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ConsumerInstallationsService) + impl ConsumerInstallationsService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockConsumerInstallationsInterface instead. +func (a *ConsumerInstallationsAPI) WithImpl(impl ConsumerInstallationsService) ConsumerInstallationsInterface { + a.impl = impl + return a +} + +// Impl returns low-level ConsumerInstallations API implementation +// Deprecated: use MockConsumerInstallationsInterface instead. +func (a *ConsumerInstallationsAPI) Impl() ConsumerInstallationsService { + return a.impl +} + +// Install from a listing. +// +// Install payload associated with a Databricks Marketplace listing. +func (a *ConsumerInstallationsAPI) Create(ctx context.Context, request CreateInstallationRequest) (*Installation, error) { + return a.impl.Create(ctx, request) +} + +// Uninstall from a listing. +// +// Uninstall an installation associated with a Databricks Marketplace listing. +func (a *ConsumerInstallationsAPI) Delete(ctx context.Context, request DeleteInstallationRequest) error { + return a.impl.Delete(ctx, request) +} + +// Uninstall from a listing. +// +// Uninstall an installation associated with a Databricks Marketplace listing. +func (a *ConsumerInstallationsAPI) DeleteByListingIdAndInstallationId(ctx context.Context, listingId string, installationId string) error { + return a.impl.Delete(ctx, DeleteInstallationRequest{ + ListingId: listingId, + InstallationId: installationId, + }) +} + +// List all installations. +// +// List all installations across all listings. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerInstallationsAPI) List(ctx context.Context, request ListAllInstallationsRequest) listing.Iterator[InstallationDetail] { + + getNextPage := func(ctx context.Context, req ListAllInstallationsRequest) (*ListAllInstallationsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListAllInstallationsResponse) []InstallationDetail { + return resp.Installations + } + getNextReq := func(resp *ListAllInstallationsResponse) *ListAllInstallationsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List all installations. +// +// List all installations across all listings. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerInstallationsAPI) ListAll(ctx context.Context, request ListAllInstallationsRequest) ([]InstallationDetail, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[InstallationDetail](ctx, iterator) +} + +// List installations for a listing. +// +// List all installations for a particular listing. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerInstallationsAPI) ListListingInstallations(ctx context.Context, request ListInstallationsRequest) listing.Iterator[InstallationDetail] { + + getNextPage := func(ctx context.Context, req ListInstallationsRequest) (*ListInstallationsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.ListListingInstallations(ctx, req) + } + getItems := func(resp *ListInstallationsResponse) []InstallationDetail { + return resp.Installations + } + getNextReq := func(resp *ListInstallationsResponse) *ListInstallationsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List installations for a listing. +// +// List all installations for a particular listing. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerInstallationsAPI) ListListingInstallationsAll(ctx context.Context, request ListInstallationsRequest) ([]InstallationDetail, error) { + iterator := a.ListListingInstallations(ctx, request) + return listing.ToSlice[InstallationDetail](ctx, iterator) +} + +// List installations for a listing. +// +// List all installations for a particular listing. +func (a *ConsumerInstallationsAPI) ListListingInstallationsByListingId(ctx context.Context, listingId string) (*ListInstallationsResponse, error) { + return a.impl.ListListingInstallations(ctx, ListInstallationsRequest{ + ListingId: listingId, + }) +} + +// Update an installation. +// +// This is a update API that will update the part of the fields defined in the +// installation table as well as interact with external services according to +// the fields not included in the installation table 1. the token will be rotate +// if the rotateToken flag is true 2. the token will be forcibly rotate if the +// rotateToken flag is true and the tokenInfo field is empty +func (a *ConsumerInstallationsAPI) Update(ctx context.Context, request UpdateInstallationRequest) (*UpdateInstallationResponse, error) { + return a.impl.Update(ctx, request) +} + +type ConsumerListingsInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockConsumerListingsInterface instead. + WithImpl(impl ConsumerListingsService) ConsumerListingsInterface + + // Impl returns low-level ConsumerListings API implementation + // Deprecated: use MockConsumerListingsInterface instead. + Impl() ConsumerListingsService + + // Get listing. + // + // Get a published listing in the Databricks Marketplace that the consumer has + // access to. + Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) + + // Get listing. + // + // Get a published listing in the Databricks Marketplace that the consumer has + // access to. + GetById(ctx context.Context, id string) (*GetListingResponse, error) + + // List listings. + // + // List all published listings in the Databricks Marketplace that the consumer + // has access to. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListListingsRequest) listing.Iterator[Listing] + + // List listings. + // + // List all published listings in the Databricks Marketplace that the consumer + // has access to. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListListingsRequest) ([]Listing, error) + + // ListingSummaryNameToIdMap calls [ConsumerListingsAPI.ListAll] and creates a map of results with [Listing].Summary.Name as key and [Listing].Id as value. + // + // Returns an error if there's more than one [Listing] with the same .Summary.Name. + // + // Note: All [Listing] instances are loaded into memory before creating a map. + // + // This method is generated by Databricks SDK Code Generator. + ListingSummaryNameToIdMap(ctx context.Context, request ListListingsRequest) (map[string]string, error) + + // GetBySummaryName calls [ConsumerListingsAPI.ListingSummaryNameToIdMap] and returns a single [Listing]. + // + // Returns an error if there's more than one [Listing] with the same .Summary.Name. + // + // Note: All [Listing] instances are loaded into memory before returning matching by name. + // + // This method is generated by Databricks SDK Code Generator. + GetBySummaryName(ctx context.Context, name string) (*Listing, error) + + // Search listings. + // + // Search published listings in the Databricks Marketplace that the consumer has + // access to. This query supports a variety of different search parameters and + // performs fuzzy matching. + // + // This method is generated by Databricks SDK Code Generator. + Search(ctx context.Context, request SearchListingsRequest) listing.Iterator[Listing] + + // Search listings. + // + // Search published listings in the Databricks Marketplace that the consumer has + // access to. This query supports a variety of different search parameters and + // performs fuzzy matching. + // + // This method is generated by Databricks SDK Code Generator. + SearchAll(ctx context.Context, request SearchListingsRequest) ([]Listing, error) +} + +func NewConsumerListings(client *client.DatabricksClient) *ConsumerListingsAPI { + return &ConsumerListingsAPI{ + impl: &consumerListingsImpl{ + client: client, + }, + } +} + +// Listings are the core entities in the Marketplace. They represent the +// products that are available for consumption. +type ConsumerListingsAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ConsumerListingsService) + impl ConsumerListingsService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockConsumerListingsInterface instead. +func (a *ConsumerListingsAPI) WithImpl(impl ConsumerListingsService) ConsumerListingsInterface { + a.impl = impl + return a +} + +// Impl returns low-level ConsumerListings API implementation +// Deprecated: use MockConsumerListingsInterface instead. +func (a *ConsumerListingsAPI) Impl() ConsumerListingsService { + return a.impl +} + +// Get listing. +// +// Get a published listing in the Databricks Marketplace that the consumer has +// access to. +func (a *ConsumerListingsAPI) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) { + return a.impl.Get(ctx, request) +} + +// Get listing. +// +// Get a published listing in the Databricks Marketplace that the consumer has +// access to. +func (a *ConsumerListingsAPI) GetById(ctx context.Context, id string) (*GetListingResponse, error) { + return a.impl.Get(ctx, GetListingRequest{ + Id: id, + }) +} + +// List listings. +// +// List all published listings in the Databricks Marketplace that the consumer +// has access to. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerListingsAPI) List(ctx context.Context, request ListListingsRequest) listing.Iterator[Listing] { + + getNextPage := func(ctx context.Context, req ListListingsRequest) (*ListListingsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListListingsResponse) []Listing { + return resp.Listings + } + getNextReq := func(resp *ListListingsResponse) *ListListingsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List listings. +// +// List all published listings in the Databricks Marketplace that the consumer +// has access to. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerListingsAPI) ListAll(ctx context.Context, request ListListingsRequest) ([]Listing, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[Listing](ctx, iterator) +} + +// ListingSummaryNameToIdMap calls [ConsumerListingsAPI.ListAll] and creates a map of results with [Listing].Summary.Name as key and [Listing].Id as value. +// +// Returns an error if there's more than one [Listing] with the same .Summary.Name. +// +// Note: All [Listing] instances are loaded into memory before creating a map. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerListingsAPI) ListingSummaryNameToIdMap(ctx context.Context, request ListListingsRequest) (map[string]string, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") + mapping := map[string]string{} + result, err := a.ListAll(ctx, request) + if err != nil { + return nil, err + } + for _, v := range result { + key := v.Summary.Name + _, duplicate := mapping[key] + if duplicate { + return nil, fmt.Errorf("duplicate .Summary.Name: %s", key) + } + mapping[key] = v.Id + } + return mapping, nil +} + +// GetBySummaryName calls [ConsumerListingsAPI.ListingSummaryNameToIdMap] and returns a single [Listing]. +// +// Returns an error if there's more than one [Listing] with the same .Summary.Name. +// +// Note: All [Listing] instances are loaded into memory before returning matching by name. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerListingsAPI) GetBySummaryName(ctx context.Context, name string) (*Listing, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") + result, err := a.ListAll(ctx, ListListingsRequest{}) + if err != nil { + return nil, err + } + tmp := map[string][]Listing{} + for _, v := range result { + key := v.Summary.Name + tmp[key] = append(tmp[key], v) + } + alternatives, ok := tmp[name] + if !ok || len(alternatives) == 0 { + return nil, fmt.Errorf("Listing named '%s' does not exist", name) + } + if len(alternatives) > 1 { + return nil, fmt.Errorf("there are %d instances of Listing named '%s'", len(alternatives), name) + } + return &alternatives[0], nil +} + +// Search listings. +// +// Search published listings in the Databricks Marketplace that the consumer has +// access to. This query supports a variety of different search parameters and +// performs fuzzy matching. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerListingsAPI) Search(ctx context.Context, request SearchListingsRequest) listing.Iterator[Listing] { + + getNextPage := func(ctx context.Context, req SearchListingsRequest) (*SearchListingsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.Search(ctx, req) + } + getItems := func(resp *SearchListingsResponse) []Listing { + return resp.Listings + } + getNextReq := func(resp *SearchListingsResponse) *SearchListingsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Search listings. +// +// Search published listings in the Databricks Marketplace that the consumer has +// access to. This query supports a variety of different search parameters and +// performs fuzzy matching. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerListingsAPI) SearchAll(ctx context.Context, request SearchListingsRequest) ([]Listing, error) { + iterator := a.Search(ctx, request) + return listing.ToSlice[Listing](ctx, iterator) +} + +type ConsumerPersonalizationRequestsInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockConsumerPersonalizationRequestsInterface instead. + WithImpl(impl ConsumerPersonalizationRequestsService) ConsumerPersonalizationRequestsInterface + + // Impl returns low-level ConsumerPersonalizationRequests API implementation + // Deprecated: use MockConsumerPersonalizationRequestsInterface instead. + Impl() ConsumerPersonalizationRequestsService + + // Create a personalization request. + // + // Create a personalization request for a listing. + Create(ctx context.Context, request CreatePersonalizationRequest) (*CreatePersonalizationRequestResponse, error) + + // Get the personalization request for a listing. + // + // Get the personalization request for a listing. Each consumer can make at + // *most* one personalization request for a listing. + Get(ctx context.Context, request GetPersonalizationRequestRequest) (*GetPersonalizationRequestResponse, error) + + // Get the personalization request for a listing. + // + // Get the personalization request for a listing. Each consumer can make at + // *most* one personalization request for a listing. + GetByListingId(ctx context.Context, listingId string) (*GetPersonalizationRequestResponse, error) + + // List all personalization requests. + // + // List personalization requests for a consumer across all listings. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListAllPersonalizationRequestsRequest) listing.Iterator[PersonalizationRequest] + + // List all personalization requests. + // + // List personalization requests for a consumer across all listings. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListAllPersonalizationRequestsRequest) ([]PersonalizationRequest, error) +} + +func NewConsumerPersonalizationRequests(client *client.DatabricksClient) *ConsumerPersonalizationRequestsAPI { + return &ConsumerPersonalizationRequestsAPI{ + impl: &consumerPersonalizationRequestsImpl{ + client: client, + }, + } +} + +// Personalization Requests allow customers to interact with the individualized +// Marketplace listing flow. +type ConsumerPersonalizationRequestsAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ConsumerPersonalizationRequestsService) + impl ConsumerPersonalizationRequestsService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockConsumerPersonalizationRequestsInterface instead. +func (a *ConsumerPersonalizationRequestsAPI) WithImpl(impl ConsumerPersonalizationRequestsService) ConsumerPersonalizationRequestsInterface { + a.impl = impl + return a +} + +// Impl returns low-level ConsumerPersonalizationRequests API implementation +// Deprecated: use MockConsumerPersonalizationRequestsInterface instead. +func (a *ConsumerPersonalizationRequestsAPI) Impl() ConsumerPersonalizationRequestsService { + return a.impl +} + +// Create a personalization request. +// +// Create a personalization request for a listing. +func (a *ConsumerPersonalizationRequestsAPI) Create(ctx context.Context, request CreatePersonalizationRequest) (*CreatePersonalizationRequestResponse, error) { + return a.impl.Create(ctx, request) +} + +// Get the personalization request for a listing. +// +// Get the personalization request for a listing. Each consumer can make at +// *most* one personalization request for a listing. +func (a *ConsumerPersonalizationRequestsAPI) Get(ctx context.Context, request GetPersonalizationRequestRequest) (*GetPersonalizationRequestResponse, error) { + return a.impl.Get(ctx, request) +} + +// Get the personalization request for a listing. +// +// Get the personalization request for a listing. Each consumer can make at +// *most* one personalization request for a listing. +func (a *ConsumerPersonalizationRequestsAPI) GetByListingId(ctx context.Context, listingId string) (*GetPersonalizationRequestResponse, error) { + return a.impl.Get(ctx, GetPersonalizationRequestRequest{ + ListingId: listingId, + }) +} + +// List all personalization requests. +// +// List personalization requests for a consumer across all listings. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerPersonalizationRequestsAPI) List(ctx context.Context, request ListAllPersonalizationRequestsRequest) listing.Iterator[PersonalizationRequest] { + + getNextPage := func(ctx context.Context, req ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListAllPersonalizationRequestsResponse) []PersonalizationRequest { + return resp.PersonalizationRequests + } + getNextReq := func(resp *ListAllPersonalizationRequestsResponse) *ListAllPersonalizationRequestsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List all personalization requests. +// +// List personalization requests for a consumer across all listings. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerPersonalizationRequestsAPI) ListAll(ctx context.Context, request ListAllPersonalizationRequestsRequest) ([]PersonalizationRequest, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[PersonalizationRequest](ctx, iterator) +} + +type ConsumerProvidersInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockConsumerProvidersInterface instead. + WithImpl(impl ConsumerProvidersService) ConsumerProvidersInterface + + // Impl returns low-level ConsumerProviders API implementation + // Deprecated: use MockConsumerProvidersInterface instead. + Impl() ConsumerProvidersService + + // Get a provider. + // + // Get a provider in the Databricks Marketplace with at least one visible + // listing. + Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) + + // Get a provider. + // + // Get a provider in the Databricks Marketplace with at least one visible + // listing. + GetById(ctx context.Context, id string) (*GetProviderResponse, error) + + // List providers. + // + // List all providers in the Databricks Marketplace with at least one visible + // listing. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListProvidersRequest) listing.Iterator[ProviderInfo] + + // List providers. + // + // List all providers in the Databricks Marketplace with at least one visible + // listing. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListProvidersRequest) ([]ProviderInfo, error) + + // ProviderInfoNameToIdMap calls [ConsumerProvidersAPI.ListAll] and creates a map of results with [ProviderInfo].Name as key and [ProviderInfo].Id as value. + // + // Returns an error if there's more than one [ProviderInfo] with the same .Name. + // + // Note: All [ProviderInfo] instances are loaded into memory before creating a map. + // + // This method is generated by Databricks SDK Code Generator. + ProviderInfoNameToIdMap(ctx context.Context, request ListProvidersRequest) (map[string]string, error) + + // GetByName calls [ConsumerProvidersAPI.ProviderInfoNameToIdMap] and returns a single [ProviderInfo]. + // + // Returns an error if there's more than one [ProviderInfo] with the same .Name. + // + // Note: All [ProviderInfo] instances are loaded into memory before returning matching by name. + // + // This method is generated by Databricks SDK Code Generator. + GetByName(ctx context.Context, name string) (*ProviderInfo, error) +} + +func NewConsumerProviders(client *client.DatabricksClient) *ConsumerProvidersAPI { + return &ConsumerProvidersAPI{ + impl: &consumerProvidersImpl{ + client: client, + }, + } +} + +// Providers are the entities that publish listings to the Marketplace. +type ConsumerProvidersAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ConsumerProvidersService) + impl ConsumerProvidersService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockConsumerProvidersInterface instead. +func (a *ConsumerProvidersAPI) WithImpl(impl ConsumerProvidersService) ConsumerProvidersInterface { + a.impl = impl + return a +} + +// Impl returns low-level ConsumerProviders API implementation +// Deprecated: use MockConsumerProvidersInterface instead. +func (a *ConsumerProvidersAPI) Impl() ConsumerProvidersService { + return a.impl +} + +// Get a provider. +// +// Get a provider in the Databricks Marketplace with at least one visible +// listing. +func (a *ConsumerProvidersAPI) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) { + return a.impl.Get(ctx, request) +} + +// Get a provider. +// +// Get a provider in the Databricks Marketplace with at least one visible +// listing. +func (a *ConsumerProvidersAPI) GetById(ctx context.Context, id string) (*GetProviderResponse, error) { + return a.impl.Get(ctx, GetProviderRequest{ + Id: id, + }) +} + +// List providers. +// +// List all providers in the Databricks Marketplace with at least one visible +// listing. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerProvidersAPI) List(ctx context.Context, request ListProvidersRequest) listing.Iterator[ProviderInfo] { + + getNextPage := func(ctx context.Context, req ListProvidersRequest) (*ListProvidersResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListProvidersResponse) []ProviderInfo { + return resp.Providers + } + getNextReq := func(resp *ListProvidersResponse) *ListProvidersRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List providers. +// +// List all providers in the Databricks Marketplace with at least one visible +// listing. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerProvidersAPI) ListAll(ctx context.Context, request ListProvidersRequest) ([]ProviderInfo, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[ProviderInfo](ctx, iterator) +} + +// ProviderInfoNameToIdMap calls [ConsumerProvidersAPI.ListAll] and creates a map of results with [ProviderInfo].Name as key and [ProviderInfo].Id as value. +// +// Returns an error if there's more than one [ProviderInfo] with the same .Name. +// +// Note: All [ProviderInfo] instances are loaded into memory before creating a map. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerProvidersAPI) ProviderInfoNameToIdMap(ctx context.Context, request ListProvidersRequest) (map[string]string, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") + mapping := map[string]string{} + result, err := a.ListAll(ctx, request) + if err != nil { + return nil, err + } + for _, v := range result { + key := v.Name + _, duplicate := mapping[key] + if duplicate { + return nil, fmt.Errorf("duplicate .Name: %s", key) + } + mapping[key] = v.Id + } + return mapping, nil +} + +// GetByName calls [ConsumerProvidersAPI.ProviderInfoNameToIdMap] and returns a single [ProviderInfo]. +// +// Returns an error if there's more than one [ProviderInfo] with the same .Name. +// +// Note: All [ProviderInfo] instances are loaded into memory before returning matching by name. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ConsumerProvidersAPI) GetByName(ctx context.Context, name string) (*ProviderInfo, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") + result, err := a.ListAll(ctx, ListProvidersRequest{}) + if err != nil { + return nil, err + } + tmp := map[string][]ProviderInfo{} + for _, v := range result { + key := v.Name + tmp[key] = append(tmp[key], v) + } + alternatives, ok := tmp[name] + if !ok || len(alternatives) == 0 { + return nil, fmt.Errorf("ProviderInfo named '%s' does not exist", name) + } + if len(alternatives) > 1 { + return nil, fmt.Errorf("there are %d instances of ProviderInfo named '%s'", len(alternatives), name) + } + return &alternatives[0], nil +} + +type ProviderExchangeFiltersInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockProviderExchangeFiltersInterface instead. + WithImpl(impl ProviderExchangeFiltersService) ProviderExchangeFiltersInterface + + // Impl returns low-level ProviderExchangeFilters API implementation + // Deprecated: use MockProviderExchangeFiltersInterface instead. + Impl() ProviderExchangeFiltersService + + // Create a new exchange filter. + // + // Add an exchange filter. + Create(ctx context.Context, request CreateExchangeFilterRequest) (*CreateExchangeFilterResponse, error) + + // Delete an exchange filter. + // + // Delete an exchange filter + Delete(ctx context.Context, request DeleteExchangeFilterRequest) error + + // Delete an exchange filter. + // + // Delete an exchange filter + DeleteById(ctx context.Context, id string) error + + // List exchange filters. + // + // List exchange filter + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListExchangeFiltersRequest) listing.Iterator[ExchangeFilter] + + // List exchange filters. + // + // List exchange filter + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListExchangeFiltersRequest) ([]ExchangeFilter, error) + + // ExchangeFilterNameToIdMap calls [ProviderExchangeFiltersAPI.ListAll] and creates a map of results with [ExchangeFilter].Name as key and [ExchangeFilter].Id as value. + // + // Returns an error if there's more than one [ExchangeFilter] with the same .Name. + // + // Note: All [ExchangeFilter] instances are loaded into memory before creating a map. + // + // This method is generated by Databricks SDK Code Generator. + ExchangeFilterNameToIdMap(ctx context.Context, request ListExchangeFiltersRequest) (map[string]string, error) + + // GetByName calls [ProviderExchangeFiltersAPI.ExchangeFilterNameToIdMap] and returns a single [ExchangeFilter]. + // + // Returns an error if there's more than one [ExchangeFilter] with the same .Name. + // + // Note: All [ExchangeFilter] instances are loaded into memory before returning matching by name. + // + // This method is generated by Databricks SDK Code Generator. + GetByName(ctx context.Context, name string) (*ExchangeFilter, error) + + // Update exchange filter. + // + // Update an exchange filter. + Update(ctx context.Context, request UpdateExchangeFilterRequest) (*UpdateExchangeFilterResponse, error) +} + +func NewProviderExchangeFilters(client *client.DatabricksClient) *ProviderExchangeFiltersAPI { + return &ProviderExchangeFiltersAPI{ + impl: &providerExchangeFiltersImpl{ + client: client, + }, + } +} + +// Marketplace exchanges filters curate which groups can access an exchange. +type ProviderExchangeFiltersAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ProviderExchangeFiltersService) + impl ProviderExchangeFiltersService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockProviderExchangeFiltersInterface instead. +func (a *ProviderExchangeFiltersAPI) WithImpl(impl ProviderExchangeFiltersService) ProviderExchangeFiltersInterface { + a.impl = impl + return a +} + +// Impl returns low-level ProviderExchangeFilters API implementation +// Deprecated: use MockProviderExchangeFiltersInterface instead. +func (a *ProviderExchangeFiltersAPI) Impl() ProviderExchangeFiltersService { + return a.impl +} + +// Create a new exchange filter. +// +// Add an exchange filter. +func (a *ProviderExchangeFiltersAPI) Create(ctx context.Context, request CreateExchangeFilterRequest) (*CreateExchangeFilterResponse, error) { + return a.impl.Create(ctx, request) +} + +// Delete an exchange filter. +// +// Delete an exchange filter +func (a *ProviderExchangeFiltersAPI) Delete(ctx context.Context, request DeleteExchangeFilterRequest) error { + return a.impl.Delete(ctx, request) +} + +// Delete an exchange filter. +// +// Delete an exchange filter +func (a *ProviderExchangeFiltersAPI) DeleteById(ctx context.Context, id string) error { + return a.impl.Delete(ctx, DeleteExchangeFilterRequest{ + Id: id, + }) +} + +// List exchange filters. +// +// # List exchange filter +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangeFiltersAPI) List(ctx context.Context, request ListExchangeFiltersRequest) listing.Iterator[ExchangeFilter] { + + getNextPage := func(ctx context.Context, req ListExchangeFiltersRequest) (*ListExchangeFiltersResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListExchangeFiltersResponse) []ExchangeFilter { + return resp.Filters + } + getNextReq := func(resp *ListExchangeFiltersResponse) *ListExchangeFiltersRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List exchange filters. +// +// # List exchange filter +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangeFiltersAPI) ListAll(ctx context.Context, request ListExchangeFiltersRequest) ([]ExchangeFilter, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[ExchangeFilter](ctx, iterator) +} + +// ExchangeFilterNameToIdMap calls [ProviderExchangeFiltersAPI.ListAll] and creates a map of results with [ExchangeFilter].Name as key and [ExchangeFilter].Id as value. +// +// Returns an error if there's more than one [ExchangeFilter] with the same .Name. +// +// Note: All [ExchangeFilter] instances are loaded into memory before creating a map. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangeFiltersAPI) ExchangeFilterNameToIdMap(ctx context.Context, request ListExchangeFiltersRequest) (map[string]string, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") + mapping := map[string]string{} + result, err := a.ListAll(ctx, request) + if err != nil { + return nil, err + } + for _, v := range result { + key := v.Name + _, duplicate := mapping[key] + if duplicate { + return nil, fmt.Errorf("duplicate .Name: %s", key) + } + mapping[key] = v.Id + } + return mapping, nil +} + +// GetByName calls [ProviderExchangeFiltersAPI.ExchangeFilterNameToIdMap] and returns a single [ExchangeFilter]. +// +// Returns an error if there's more than one [ExchangeFilter] with the same .Name. +// +// Note: All [ExchangeFilter] instances are loaded into memory before returning matching by name. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangeFiltersAPI) GetByName(ctx context.Context, name string) (*ExchangeFilter, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") + result, err := a.ListAll(ctx, ListExchangeFiltersRequest{}) + if err != nil { + return nil, err + } + tmp := map[string][]ExchangeFilter{} + for _, v := range result { + key := v.Name + tmp[key] = append(tmp[key], v) + } + alternatives, ok := tmp[name] + if !ok || len(alternatives) == 0 { + return nil, fmt.Errorf("ExchangeFilter named '%s' does not exist", name) + } + if len(alternatives) > 1 { + return nil, fmt.Errorf("there are %d instances of ExchangeFilter named '%s'", len(alternatives), name) + } + return &alternatives[0], nil +} + +// Update exchange filter. +// +// Update an exchange filter. +func (a *ProviderExchangeFiltersAPI) Update(ctx context.Context, request UpdateExchangeFilterRequest) (*UpdateExchangeFilterResponse, error) { + return a.impl.Update(ctx, request) +} + +type ProviderExchangesInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockProviderExchangesInterface instead. + WithImpl(impl ProviderExchangesService) ProviderExchangesInterface + + // Impl returns low-level ProviderExchanges API implementation + // Deprecated: use MockProviderExchangesInterface instead. + Impl() ProviderExchangesService + + // Add an exchange for listing. + // + // Associate an exchange with a listing + AddListingToExchange(ctx context.Context, request AddExchangeForListingRequest) (*AddExchangeForListingResponse, error) + + // Create an exchange. + // + // Create an exchange + Create(ctx context.Context, request CreateExchangeRequest) (*CreateExchangeResponse, error) + + // Delete an exchange. + // + // This removes a listing from marketplace. + Delete(ctx context.Context, request DeleteExchangeRequest) error + + // Delete an exchange. + // + // This removes a listing from marketplace. + DeleteById(ctx context.Context, id string) error + + // Remove an exchange for listing. + // + // Disassociate an exchange with a listing + DeleteListingFromExchange(ctx context.Context, request RemoveExchangeForListingRequest) error + + // Remove an exchange for listing. + // + // Disassociate an exchange with a listing + DeleteListingFromExchangeById(ctx context.Context, id string) error + + // Get an exchange. + // + // Get an exchange. + Get(ctx context.Context, request GetExchangeRequest) (*GetExchangeResponse, error) + + // Get an exchange. + // + // Get an exchange. + GetById(ctx context.Context, id string) (*GetExchangeResponse, error) + + // List exchanges. + // + // List exchanges visible to provider + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListExchangesRequest) listing.Iterator[Exchange] + + // List exchanges. + // + // List exchanges visible to provider + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListExchangesRequest) ([]Exchange, error) + + // ExchangeNameToIdMap calls [ProviderExchangesAPI.ListAll] and creates a map of results with [Exchange].Name as key and [Exchange].Id as value. + // + // Returns an error if there's more than one [Exchange] with the same .Name. + // + // Note: All [Exchange] instances are loaded into memory before creating a map. + // + // This method is generated by Databricks SDK Code Generator. + ExchangeNameToIdMap(ctx context.Context, request ListExchangesRequest) (map[string]string, error) + + // GetByName calls [ProviderExchangesAPI.ExchangeNameToIdMap] and returns a single [Exchange]. + // + // Returns an error if there's more than one [Exchange] with the same .Name. + // + // Note: All [Exchange] instances are loaded into memory before returning matching by name. + // + // This method is generated by Databricks SDK Code Generator. + GetByName(ctx context.Context, name string) (*Exchange, error) + + // List exchanges for listing. + // + // List exchanges associated with a listing + // + // This method is generated by Databricks SDK Code Generator. + ListExchangesForListing(ctx context.Context, request ListExchangesForListingRequest) listing.Iterator[ExchangeListing] + + // List exchanges for listing. + // + // List exchanges associated with a listing + // + // This method is generated by Databricks SDK Code Generator. + ListExchangesForListingAll(ctx context.Context, request ListExchangesForListingRequest) ([]ExchangeListing, error) + + // ExchangeListingExchangeNameToExchangeIdMap calls [ProviderExchangesAPI.ListExchangesForListingAll] and creates a map of results with [ExchangeListing].ExchangeName as key and [ExchangeListing].ExchangeId as value. + // + // Returns an error if there's more than one [ExchangeListing] with the same .ExchangeName. + // + // Note: All [ExchangeListing] instances are loaded into memory before creating a map. + // + // This method is generated by Databricks SDK Code Generator. + ExchangeListingExchangeNameToExchangeIdMap(ctx context.Context, request ListExchangesForListingRequest) (map[string]string, error) + + // GetByExchangeName calls [ProviderExchangesAPI.ExchangeListingExchangeNameToExchangeIdMap] and returns a single [ExchangeListing]. + // + // Returns an error if there's more than one [ExchangeListing] with the same .ExchangeName. + // + // Note: All [ExchangeListing] instances are loaded into memory before returning matching by name. + // + // This method is generated by Databricks SDK Code Generator. + GetByExchangeName(ctx context.Context, name string) (*ExchangeListing, error) + + // List listings for exchange. + // + // List listings associated with an exchange + // + // This method is generated by Databricks SDK Code Generator. + ListListingsForExchange(ctx context.Context, request ListListingsForExchangeRequest) listing.Iterator[ExchangeListing] + + // List listings for exchange. + // + // List listings associated with an exchange + // + // This method is generated by Databricks SDK Code Generator. + ListListingsForExchangeAll(ctx context.Context, request ListListingsForExchangeRequest) ([]ExchangeListing, error) + + // ExchangeListingListingNameToListingIdMap calls [ProviderExchangesAPI.ListListingsForExchangeAll] and creates a map of results with [ExchangeListing].ListingName as key and [ExchangeListing].ListingId as value. + // + // Returns an error if there's more than one [ExchangeListing] with the same .ListingName. + // + // Note: All [ExchangeListing] instances are loaded into memory before creating a map. + // + // This method is generated by Databricks SDK Code Generator. + ExchangeListingListingNameToListingIdMap(ctx context.Context, request ListListingsForExchangeRequest) (map[string]string, error) + + // GetByListingName calls [ProviderExchangesAPI.ExchangeListingListingNameToListingIdMap] and returns a single [ExchangeListing]. + // + // Returns an error if there's more than one [ExchangeListing] with the same .ListingName. + // + // Note: All [ExchangeListing] instances are loaded into memory before returning matching by name. + // + // This method is generated by Databricks SDK Code Generator. + GetByListingName(ctx context.Context, name string) (*ExchangeListing, error) + + // Update exchange. + // + // Update an exchange + Update(ctx context.Context, request UpdateExchangeRequest) (*UpdateExchangeResponse, error) +} + +func NewProviderExchanges(client *client.DatabricksClient) *ProviderExchangesAPI { + return &ProviderExchangesAPI{ + impl: &providerExchangesImpl{ + client: client, + }, + } +} + +// Marketplace exchanges allow providers to share their listings with a curated +// set of customers. +type ProviderExchangesAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ProviderExchangesService) + impl ProviderExchangesService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockProviderExchangesInterface instead. +func (a *ProviderExchangesAPI) WithImpl(impl ProviderExchangesService) ProviderExchangesInterface { + a.impl = impl + return a +} + +// Impl returns low-level ProviderExchanges API implementation +// Deprecated: use MockProviderExchangesInterface instead. +func (a *ProviderExchangesAPI) Impl() ProviderExchangesService { + return a.impl +} + +// Add an exchange for listing. +// +// Associate an exchange with a listing +func (a *ProviderExchangesAPI) AddListingToExchange(ctx context.Context, request AddExchangeForListingRequest) (*AddExchangeForListingResponse, error) { + return a.impl.AddListingToExchange(ctx, request) +} + +// Create an exchange. +// +// Create an exchange +func (a *ProviderExchangesAPI) Create(ctx context.Context, request CreateExchangeRequest) (*CreateExchangeResponse, error) { + return a.impl.Create(ctx, request) +} + +// Delete an exchange. +// +// This removes a listing from marketplace. +func (a *ProviderExchangesAPI) Delete(ctx context.Context, request DeleteExchangeRequest) error { + return a.impl.Delete(ctx, request) +} + +// Delete an exchange. +// +// This removes a listing from marketplace. +func (a *ProviderExchangesAPI) DeleteById(ctx context.Context, id string) error { + return a.impl.Delete(ctx, DeleteExchangeRequest{ + Id: id, + }) +} + +// Remove an exchange for listing. +// +// Disassociate an exchange with a listing +func (a *ProviderExchangesAPI) DeleteListingFromExchange(ctx context.Context, request RemoveExchangeForListingRequest) error { + return a.impl.DeleteListingFromExchange(ctx, request) +} + +// Remove an exchange for listing. +// +// Disassociate an exchange with a listing +func (a *ProviderExchangesAPI) DeleteListingFromExchangeById(ctx context.Context, id string) error { + return a.impl.DeleteListingFromExchange(ctx, RemoveExchangeForListingRequest{ + Id: id, + }) +} + +// Get an exchange. +// +// Get an exchange. +func (a *ProviderExchangesAPI) Get(ctx context.Context, request GetExchangeRequest) (*GetExchangeResponse, error) { + return a.impl.Get(ctx, request) +} + +// Get an exchange. +// +// Get an exchange. +func (a *ProviderExchangesAPI) GetById(ctx context.Context, id string) (*GetExchangeResponse, error) { + return a.impl.Get(ctx, GetExchangeRequest{ + Id: id, + }) +} + +// List exchanges. +// +// # List exchanges visible to provider +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) List(ctx context.Context, request ListExchangesRequest) listing.Iterator[Exchange] { + + getNextPage := func(ctx context.Context, req ListExchangesRequest) (*ListExchangesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListExchangesResponse) []Exchange { + return resp.Exchanges + } + getNextReq := func(resp *ListExchangesResponse) *ListExchangesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List exchanges. +// +// # List exchanges visible to provider +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) ListAll(ctx context.Context, request ListExchangesRequest) ([]Exchange, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[Exchange](ctx, iterator) +} + +// ExchangeNameToIdMap calls [ProviderExchangesAPI.ListAll] and creates a map of results with [Exchange].Name as key and [Exchange].Id as value. +// +// Returns an error if there's more than one [Exchange] with the same .Name. +// +// Note: All [Exchange] instances are loaded into memory before creating a map. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) ExchangeNameToIdMap(ctx context.Context, request ListExchangesRequest) (map[string]string, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") + mapping := map[string]string{} + result, err := a.ListAll(ctx, request) + if err != nil { + return nil, err + } + for _, v := range result { + key := v.Name + _, duplicate := mapping[key] + if duplicate { + return nil, fmt.Errorf("duplicate .Name: %s", key) + } + mapping[key] = v.Id + } + return mapping, nil +} + +// GetByName calls [ProviderExchangesAPI.ExchangeNameToIdMap] and returns a single [Exchange]. +// +// Returns an error if there's more than one [Exchange] with the same .Name. +// +// Note: All [Exchange] instances are loaded into memory before returning matching by name. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) GetByName(ctx context.Context, name string) (*Exchange, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") + result, err := a.ListAll(ctx, ListExchangesRequest{}) + if err != nil { + return nil, err + } + tmp := map[string][]Exchange{} + for _, v := range result { + key := v.Name + tmp[key] = append(tmp[key], v) + } + alternatives, ok := tmp[name] + if !ok || len(alternatives) == 0 { + return nil, fmt.Errorf("Exchange named '%s' does not exist", name) + } + if len(alternatives) > 1 { + return nil, fmt.Errorf("there are %d instances of Exchange named '%s'", len(alternatives), name) + } + return &alternatives[0], nil +} + +// List exchanges for listing. +// +// # List exchanges associated with a listing +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) ListExchangesForListing(ctx context.Context, request ListExchangesForListingRequest) listing.Iterator[ExchangeListing] { + + getNextPage := func(ctx context.Context, req ListExchangesForListingRequest) (*ListExchangesForListingResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.ListExchangesForListing(ctx, req) + } + getItems := func(resp *ListExchangesForListingResponse) []ExchangeListing { + return resp.ExchangeListing + } + getNextReq := func(resp *ListExchangesForListingResponse) *ListExchangesForListingRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List exchanges for listing. +// +// # List exchanges associated with a listing +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) ListExchangesForListingAll(ctx context.Context, request ListExchangesForListingRequest) ([]ExchangeListing, error) { + iterator := a.ListExchangesForListing(ctx, request) + return listing.ToSlice[ExchangeListing](ctx, iterator) +} + +// ExchangeListingExchangeNameToExchangeIdMap calls [ProviderExchangesAPI.ListExchangesForListingAll] and creates a map of results with [ExchangeListing].ExchangeName as key and [ExchangeListing].ExchangeId as value. +// +// Returns an error if there's more than one [ExchangeListing] with the same .ExchangeName. +// +// Note: All [ExchangeListing] instances are loaded into memory before creating a map. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) ExchangeListingExchangeNameToExchangeIdMap(ctx context.Context, request ListExchangesForListingRequest) (map[string]string, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") + mapping := map[string]string{} + result, err := a.ListExchangesForListingAll(ctx, request) + if err != nil { + return nil, err + } + for _, v := range result { + key := v.ExchangeName + _, duplicate := mapping[key] + if duplicate { + return nil, fmt.Errorf("duplicate .ExchangeName: %s", key) + } + mapping[key] = v.ExchangeId + } + return mapping, nil +} + +// GetByExchangeName calls [ProviderExchangesAPI.ExchangeListingExchangeNameToExchangeIdMap] and returns a single [ExchangeListing]. +// +// Returns an error if there's more than one [ExchangeListing] with the same .ExchangeName. +// +// Note: All [ExchangeListing] instances are loaded into memory before returning matching by name. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) GetByExchangeName(ctx context.Context, name string) (*ExchangeListing, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") + result, err := a.ListExchangesForListingAll(ctx, ListExchangesForListingRequest{}) + if err != nil { + return nil, err + } + tmp := map[string][]ExchangeListing{} + for _, v := range result { + key := v.ExchangeName + tmp[key] = append(tmp[key], v) + } + alternatives, ok := tmp[name] + if !ok || len(alternatives) == 0 { + return nil, fmt.Errorf("ExchangeListing named '%s' does not exist", name) + } + if len(alternatives) > 1 { + return nil, fmt.Errorf("there are %d instances of ExchangeListing named '%s'", len(alternatives), name) + } + return &alternatives[0], nil +} + +// List listings for exchange. +// +// # List listings associated with an exchange +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) ListListingsForExchange(ctx context.Context, request ListListingsForExchangeRequest) listing.Iterator[ExchangeListing] { + + getNextPage := func(ctx context.Context, req ListListingsForExchangeRequest) (*ListListingsForExchangeResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.ListListingsForExchange(ctx, req) + } + getItems := func(resp *ListListingsForExchangeResponse) []ExchangeListing { + return resp.ExchangeListings + } + getNextReq := func(resp *ListListingsForExchangeResponse) *ListListingsForExchangeRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List listings for exchange. +// +// # List listings associated with an exchange +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) ListListingsForExchangeAll(ctx context.Context, request ListListingsForExchangeRequest) ([]ExchangeListing, error) { + iterator := a.ListListingsForExchange(ctx, request) + return listing.ToSlice[ExchangeListing](ctx, iterator) +} + +// ExchangeListingListingNameToListingIdMap calls [ProviderExchangesAPI.ListListingsForExchangeAll] and creates a map of results with [ExchangeListing].ListingName as key and [ExchangeListing].ListingId as value. +// +// Returns an error if there's more than one [ExchangeListing] with the same .ListingName. +// +// Note: All [ExchangeListing] instances are loaded into memory before creating a map. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) ExchangeListingListingNameToListingIdMap(ctx context.Context, request ListListingsForExchangeRequest) (map[string]string, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") + mapping := map[string]string{} + result, err := a.ListListingsForExchangeAll(ctx, request) + if err != nil { + return nil, err + } + for _, v := range result { + key := v.ListingName + _, duplicate := mapping[key] + if duplicate { + return nil, fmt.Errorf("duplicate .ListingName: %s", key) + } + mapping[key] = v.ListingId + } + return mapping, nil +} + +// GetByListingName calls [ProviderExchangesAPI.ExchangeListingListingNameToListingIdMap] and returns a single [ExchangeListing]. +// +// Returns an error if there's more than one [ExchangeListing] with the same .ListingName. +// +// Note: All [ExchangeListing] instances are loaded into memory before returning matching by name. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderExchangesAPI) GetByListingName(ctx context.Context, name string) (*ExchangeListing, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") + result, err := a.ListListingsForExchangeAll(ctx, ListListingsForExchangeRequest{}) + if err != nil { + return nil, err + } + tmp := map[string][]ExchangeListing{} + for _, v := range result { + key := v.ListingName + tmp[key] = append(tmp[key], v) + } + alternatives, ok := tmp[name] + if !ok || len(alternatives) == 0 { + return nil, fmt.Errorf("ExchangeListing named '%s' does not exist", name) + } + if len(alternatives) > 1 { + return nil, fmt.Errorf("there are %d instances of ExchangeListing named '%s'", len(alternatives), name) + } + return &alternatives[0], nil +} + +// Update exchange. +// +// Update an exchange +func (a *ProviderExchangesAPI) Update(ctx context.Context, request UpdateExchangeRequest) (*UpdateExchangeResponse, error) { + return a.impl.Update(ctx, request) +} + +type ProviderFilesInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockProviderFilesInterface instead. + WithImpl(impl ProviderFilesService) ProviderFilesInterface + + // Impl returns low-level ProviderFiles API implementation + // Deprecated: use MockProviderFilesInterface instead. + Impl() ProviderFilesService + + // Create a file. + // + // Create a file. Currently, only provider icons and attached notebooks are + // supported. + Create(ctx context.Context, request CreateFileRequest) (*CreateFileResponse, error) + + // Delete a file. + // + // Delete a file + Delete(ctx context.Context, request DeleteFileRequest) error + + // Delete a file. + // + // Delete a file + DeleteByFileId(ctx context.Context, fileId string) error + + // Get a file. + // + // Get a file + Get(ctx context.Context, request GetFileRequest) (*GetFileResponse, error) + + // Get a file. + // + // Get a file + GetByFileId(ctx context.Context, fileId string) (*GetFileResponse, error) + + // List files. + // + // List files attached to a parent entity. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListFilesRequest) listing.Iterator[FileInfo] + + // List files. + // + // List files attached to a parent entity. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListFilesRequest) ([]FileInfo, error) + + // FileInfoDisplayNameToIdMap calls [ProviderFilesAPI.ListAll] and creates a map of results with [FileInfo].DisplayName as key and [FileInfo].Id as value. + // + // Returns an error if there's more than one [FileInfo] with the same .DisplayName. + // + // Note: All [FileInfo] instances are loaded into memory before creating a map. + // + // This method is generated by Databricks SDK Code Generator. + FileInfoDisplayNameToIdMap(ctx context.Context, request ListFilesRequest) (map[string]string, error) + + // GetByDisplayName calls [ProviderFilesAPI.FileInfoDisplayNameToIdMap] and returns a single [FileInfo]. + // + // Returns an error if there's more than one [FileInfo] with the same .DisplayName. + // + // Note: All [FileInfo] instances are loaded into memory before returning matching by name. + // + // This method is generated by Databricks SDK Code Generator. + GetByDisplayName(ctx context.Context, name string) (*FileInfo, error) +} + +func NewProviderFiles(client *client.DatabricksClient) *ProviderFilesAPI { + return &ProviderFilesAPI{ + impl: &providerFilesImpl{ + client: client, + }, + } +} + +// Marketplace offers a set of file APIs for various purposes such as preview +// notebooks and provider icons. +type ProviderFilesAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ProviderFilesService) + impl ProviderFilesService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockProviderFilesInterface instead. +func (a *ProviderFilesAPI) WithImpl(impl ProviderFilesService) ProviderFilesInterface { + a.impl = impl + return a +} + +// Impl returns low-level ProviderFiles API implementation +// Deprecated: use MockProviderFilesInterface instead. +func (a *ProviderFilesAPI) Impl() ProviderFilesService { + return a.impl +} + +// Create a file. +// +// Create a file. Currently, only provider icons and attached notebooks are +// supported. +func (a *ProviderFilesAPI) Create(ctx context.Context, request CreateFileRequest) (*CreateFileResponse, error) { + return a.impl.Create(ctx, request) +} + +// Delete a file. +// +// Delete a file +func (a *ProviderFilesAPI) Delete(ctx context.Context, request DeleteFileRequest) error { + return a.impl.Delete(ctx, request) +} + +// Delete a file. +// +// Delete a file +func (a *ProviderFilesAPI) DeleteByFileId(ctx context.Context, fileId string) error { + return a.impl.Delete(ctx, DeleteFileRequest{ + FileId: fileId, + }) +} + +// Get a file. +// +// Get a file +func (a *ProviderFilesAPI) Get(ctx context.Context, request GetFileRequest) (*GetFileResponse, error) { + return a.impl.Get(ctx, request) +} + +// Get a file. +// +// Get a file +func (a *ProviderFilesAPI) GetByFileId(ctx context.Context, fileId string) (*GetFileResponse, error) { + return a.impl.Get(ctx, GetFileRequest{ + FileId: fileId, + }) +} + +// List files. +// +// List files attached to a parent entity. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderFilesAPI) List(ctx context.Context, request ListFilesRequest) listing.Iterator[FileInfo] { + + getNextPage := func(ctx context.Context, req ListFilesRequest) (*ListFilesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListFilesResponse) []FileInfo { + return resp.FileInfos + } + getNextReq := func(resp *ListFilesResponse) *ListFilesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List files. +// +// List files attached to a parent entity. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderFilesAPI) ListAll(ctx context.Context, request ListFilesRequest) ([]FileInfo, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[FileInfo](ctx, iterator) +} + +// FileInfoDisplayNameToIdMap calls [ProviderFilesAPI.ListAll] and creates a map of results with [FileInfo].DisplayName as key and [FileInfo].Id as value. +// +// Returns an error if there's more than one [FileInfo] with the same .DisplayName. +// +// Note: All [FileInfo] instances are loaded into memory before creating a map. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderFilesAPI) FileInfoDisplayNameToIdMap(ctx context.Context, request ListFilesRequest) (map[string]string, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") + mapping := map[string]string{} + result, err := a.ListAll(ctx, request) + if err != nil { + return nil, err + } + for _, v := range result { + key := v.DisplayName + _, duplicate := mapping[key] + if duplicate { + return nil, fmt.Errorf("duplicate .DisplayName: %s", key) + } + mapping[key] = v.Id + } + return mapping, nil +} + +// GetByDisplayName calls [ProviderFilesAPI.FileInfoDisplayNameToIdMap] and returns a single [FileInfo]. +// +// Returns an error if there's more than one [FileInfo] with the same .DisplayName. +// +// Note: All [FileInfo] instances are loaded into memory before returning matching by name. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderFilesAPI) GetByDisplayName(ctx context.Context, name string) (*FileInfo, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") + result, err := a.ListAll(ctx, ListFilesRequest{}) + if err != nil { + return nil, err + } + tmp := map[string][]FileInfo{} + for _, v := range result { + key := v.DisplayName + tmp[key] = append(tmp[key], v) + } + alternatives, ok := tmp[name] + if !ok || len(alternatives) == 0 { + return nil, fmt.Errorf("FileInfo named '%s' does not exist", name) + } + if len(alternatives) > 1 { + return nil, fmt.Errorf("there are %d instances of FileInfo named '%s'", len(alternatives), name) + } + return &alternatives[0], nil +} + +type ProviderListingsInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockProviderListingsInterface instead. + WithImpl(impl ProviderListingsService) ProviderListingsInterface + + // Impl returns low-level ProviderListings API implementation + // Deprecated: use MockProviderListingsInterface instead. + Impl() ProviderListingsService + + // Create a listing. + // + // Create a new listing + Create(ctx context.Context, request CreateListingRequest) (*CreateListingResponse, error) + + // Delete a listing. + // + // Delete a listing + Delete(ctx context.Context, request DeleteListingRequest) error + + // Delete a listing. + // + // Delete a listing + DeleteById(ctx context.Context, id string) error + + // Get a listing. + // + // Get a listing + Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) + + // Get a listing. + // + // Get a listing + GetById(ctx context.Context, id string) (*GetListingResponse, error) + + // List listings. + // + // List listings owned by this provider + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request GetListingsRequest) listing.Iterator[Listing] + + // List listings. + // + // List listings owned by this provider + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request GetListingsRequest) ([]Listing, error) + + // ListingSummaryNameToIdMap calls [ProviderListingsAPI.ListAll] and creates a map of results with [Listing].Summary.Name as key and [Listing].Id as value. + // + // Returns an error if there's more than one [Listing] with the same .Summary.Name. + // + // Note: All [Listing] instances are loaded into memory before creating a map. + // + // This method is generated by Databricks SDK Code Generator. + ListingSummaryNameToIdMap(ctx context.Context, request GetListingsRequest) (map[string]string, error) + + // GetBySummaryName calls [ProviderListingsAPI.ListingSummaryNameToIdMap] and returns a single [Listing]. + // + // Returns an error if there's more than one [Listing] with the same .Summary.Name. + // + // Note: All [Listing] instances are loaded into memory before returning matching by name. + // + // This method is generated by Databricks SDK Code Generator. + GetBySummaryName(ctx context.Context, name string) (*Listing, error) + + // Update listing. + // + // Update a listing + Update(ctx context.Context, request UpdateListingRequest) (*UpdateListingResponse, error) +} + +func NewProviderListings(client *client.DatabricksClient) *ProviderListingsAPI { + return &ProviderListingsAPI{ + impl: &providerListingsImpl{ + client: client, + }, + } +} + +// Listings are the core entities in the Marketplace. They represent the +// products that are available for consumption. +type ProviderListingsAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ProviderListingsService) + impl ProviderListingsService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockProviderListingsInterface instead. +func (a *ProviderListingsAPI) WithImpl(impl ProviderListingsService) ProviderListingsInterface { + a.impl = impl + return a +} + +// Impl returns low-level ProviderListings API implementation +// Deprecated: use MockProviderListingsInterface instead. +func (a *ProviderListingsAPI) Impl() ProviderListingsService { + return a.impl +} + +// Create a listing. +// +// Create a new listing +func (a *ProviderListingsAPI) Create(ctx context.Context, request CreateListingRequest) (*CreateListingResponse, error) { + return a.impl.Create(ctx, request) +} + +// Delete a listing. +// +// Delete a listing +func (a *ProviderListingsAPI) Delete(ctx context.Context, request DeleteListingRequest) error { + return a.impl.Delete(ctx, request) +} + +// Delete a listing. +// +// Delete a listing +func (a *ProviderListingsAPI) DeleteById(ctx context.Context, id string) error { + return a.impl.Delete(ctx, DeleteListingRequest{ + Id: id, + }) +} + +// Get a listing. +// +// Get a listing +func (a *ProviderListingsAPI) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) { + return a.impl.Get(ctx, request) +} + +// Get a listing. +// +// Get a listing +func (a *ProviderListingsAPI) GetById(ctx context.Context, id string) (*GetListingResponse, error) { + return a.impl.Get(ctx, GetListingRequest{ + Id: id, + }) +} + +// List listings. +// +// # List listings owned by this provider +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderListingsAPI) List(ctx context.Context, request GetListingsRequest) listing.Iterator[Listing] { + + getNextPage := func(ctx context.Context, req GetListingsRequest) (*GetListingsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *GetListingsResponse) []Listing { + return resp.Listings + } + getNextReq := func(resp *GetListingsResponse) *GetListingsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List listings. +// +// # List listings owned by this provider +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderListingsAPI) ListAll(ctx context.Context, request GetListingsRequest) ([]Listing, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[Listing](ctx, iterator) +} + +// ListingSummaryNameToIdMap calls [ProviderListingsAPI.ListAll] and creates a map of results with [Listing].Summary.Name as key and [Listing].Id as value. +// +// Returns an error if there's more than one [Listing] with the same .Summary.Name. +// +// Note: All [Listing] instances are loaded into memory before creating a map. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderListingsAPI) ListingSummaryNameToIdMap(ctx context.Context, request GetListingsRequest) (map[string]string, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") + mapping := map[string]string{} + result, err := a.ListAll(ctx, request) + if err != nil { + return nil, err + } + for _, v := range result { + key := v.Summary.Name + _, duplicate := mapping[key] + if duplicate { + return nil, fmt.Errorf("duplicate .Summary.Name: %s", key) + } + mapping[key] = v.Id + } + return mapping, nil +} + +// GetBySummaryName calls [ProviderListingsAPI.ListingSummaryNameToIdMap] and returns a single [Listing]. +// +// Returns an error if there's more than one [Listing] with the same .Summary.Name. +// +// Note: All [Listing] instances are loaded into memory before returning matching by name. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderListingsAPI) GetBySummaryName(ctx context.Context, name string) (*Listing, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") + result, err := a.ListAll(ctx, GetListingsRequest{}) + if err != nil { + return nil, err + } + tmp := map[string][]Listing{} + for _, v := range result { + key := v.Summary.Name + tmp[key] = append(tmp[key], v) + } + alternatives, ok := tmp[name] + if !ok || len(alternatives) == 0 { + return nil, fmt.Errorf("Listing named '%s' does not exist", name) + } + if len(alternatives) > 1 { + return nil, fmt.Errorf("there are %d instances of Listing named '%s'", len(alternatives), name) + } + return &alternatives[0], nil +} + +// Update listing. +// +// Update a listing +func (a *ProviderListingsAPI) Update(ctx context.Context, request UpdateListingRequest) (*UpdateListingResponse, error) { + return a.impl.Update(ctx, request) +} + +type ProviderPersonalizationRequestsInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockProviderPersonalizationRequestsInterface instead. + WithImpl(impl ProviderPersonalizationRequestsService) ProviderPersonalizationRequestsInterface + + // Impl returns low-level ProviderPersonalizationRequests API implementation + // Deprecated: use MockProviderPersonalizationRequestsInterface instead. + Impl() ProviderPersonalizationRequestsService + + // All personalization requests across all listings. + // + // List personalization requests to this provider. This will return all + // personalization requests, regardless of which listing they are for. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListAllPersonalizationRequestsRequest) listing.Iterator[PersonalizationRequest] + + // All personalization requests across all listings. + // + // List personalization requests to this provider. This will return all + // personalization requests, regardless of which listing they are for. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListAllPersonalizationRequestsRequest) ([]PersonalizationRequest, error) + + // Update personalization request status. + // + // Update personalization request. This method only permits updating the status + // of the request. + Update(ctx context.Context, request UpdatePersonalizationRequestRequest) (*UpdatePersonalizationRequestResponse, error) +} + +func NewProviderPersonalizationRequests(client *client.DatabricksClient) *ProviderPersonalizationRequestsAPI { + return &ProviderPersonalizationRequestsAPI{ + impl: &providerPersonalizationRequestsImpl{ + client: client, + }, + } +} + +// Personalization requests are an alternate to instantly available listings. +// Control the lifecycle of personalized solutions. +type ProviderPersonalizationRequestsAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ProviderPersonalizationRequestsService) + impl ProviderPersonalizationRequestsService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockProviderPersonalizationRequestsInterface instead. +func (a *ProviderPersonalizationRequestsAPI) WithImpl(impl ProviderPersonalizationRequestsService) ProviderPersonalizationRequestsInterface { + a.impl = impl + return a +} + +// Impl returns low-level ProviderPersonalizationRequests API implementation +// Deprecated: use MockProviderPersonalizationRequestsInterface instead. +func (a *ProviderPersonalizationRequestsAPI) Impl() ProviderPersonalizationRequestsService { + return a.impl +} + +// All personalization requests across all listings. +// +// List personalization requests to this provider. This will return all +// personalization requests, regardless of which listing they are for. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderPersonalizationRequestsAPI) List(ctx context.Context, request ListAllPersonalizationRequestsRequest) listing.Iterator[PersonalizationRequest] { + + getNextPage := func(ctx context.Context, req ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListAllPersonalizationRequestsResponse) []PersonalizationRequest { + return resp.PersonalizationRequests + } + getNextReq := func(resp *ListAllPersonalizationRequestsResponse) *ListAllPersonalizationRequestsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// All personalization requests across all listings. +// +// List personalization requests to this provider. This will return all +// personalization requests, regardless of which listing they are for. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderPersonalizationRequestsAPI) ListAll(ctx context.Context, request ListAllPersonalizationRequestsRequest) ([]PersonalizationRequest, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[PersonalizationRequest](ctx, iterator) +} + +// Update personalization request status. +// +// Update personalization request. This method only permits updating the status +// of the request. +func (a *ProviderPersonalizationRequestsAPI) Update(ctx context.Context, request UpdatePersonalizationRequestRequest) (*UpdatePersonalizationRequestResponse, error) { + return a.impl.Update(ctx, request) +} + +type ProviderProviderAnalyticsDashboardsInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockProviderProviderAnalyticsDashboardsInterface instead. + WithImpl(impl ProviderProviderAnalyticsDashboardsService) ProviderProviderAnalyticsDashboardsInterface + + // Impl returns low-level ProviderProviderAnalyticsDashboards API implementation + // Deprecated: use MockProviderProviderAnalyticsDashboardsInterface instead. + Impl() ProviderProviderAnalyticsDashboardsService + + // Create provider analytics dashboard. + // + // Create provider analytics dashboard. Returns Marketplace specific `id`. Not + // to be confused with the Lakeview dashboard id. + Create(ctx context.Context) (*ProviderAnalyticsDashboard, error) + + // Get provider analytics dashboard. + // + // Get provider analytics dashboard. + Get(ctx context.Context) (*ListProviderAnalyticsDashboardResponse, error) + + // Get latest version of provider analytics dashboard. + // + // Get latest version of provider analytics dashboard. + GetLatestVersion(ctx context.Context) (*GetLatestVersionProviderAnalyticsDashboardResponse, error) + + // Update provider analytics dashboard. + // + // Update provider analytics dashboard. + Update(ctx context.Context, request UpdateProviderAnalyticsDashboardRequest) (*UpdateProviderAnalyticsDashboardResponse, error) +} + +func NewProviderProviderAnalyticsDashboards(client *client.DatabricksClient) *ProviderProviderAnalyticsDashboardsAPI { + return &ProviderProviderAnalyticsDashboardsAPI{ + impl: &providerProviderAnalyticsDashboardsImpl{ + client: client, + }, + } +} + +// Manage templated analytics solution for providers. +type ProviderProviderAnalyticsDashboardsAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ProviderProviderAnalyticsDashboardsService) + impl ProviderProviderAnalyticsDashboardsService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockProviderProviderAnalyticsDashboardsInterface instead. +func (a *ProviderProviderAnalyticsDashboardsAPI) WithImpl(impl ProviderProviderAnalyticsDashboardsService) ProviderProviderAnalyticsDashboardsInterface { + a.impl = impl + return a +} + +// Impl returns low-level ProviderProviderAnalyticsDashboards API implementation +// Deprecated: use MockProviderProviderAnalyticsDashboardsInterface instead. +func (a *ProviderProviderAnalyticsDashboardsAPI) Impl() ProviderProviderAnalyticsDashboardsService { + return a.impl +} + +// Create provider analytics dashboard. +// +// Create provider analytics dashboard. Returns Marketplace specific `id`. Not +// to be confused with the Lakeview dashboard id. +func (a *ProviderProviderAnalyticsDashboardsAPI) Create(ctx context.Context) (*ProviderAnalyticsDashboard, error) { + return a.impl.Create(ctx) +} + +// Get provider analytics dashboard. +// +// Get provider analytics dashboard. +func (a *ProviderProviderAnalyticsDashboardsAPI) Get(ctx context.Context) (*ListProviderAnalyticsDashboardResponse, error) { + return a.impl.Get(ctx) +} + +// Get latest version of provider analytics dashboard. +// +// Get latest version of provider analytics dashboard. +func (a *ProviderProviderAnalyticsDashboardsAPI) GetLatestVersion(ctx context.Context) (*GetLatestVersionProviderAnalyticsDashboardResponse, error) { + return a.impl.GetLatestVersion(ctx) +} + +// Update provider analytics dashboard. +// +// Update provider analytics dashboard. +func (a *ProviderProviderAnalyticsDashboardsAPI) Update(ctx context.Context, request UpdateProviderAnalyticsDashboardRequest) (*UpdateProviderAnalyticsDashboardResponse, error) { + return a.impl.Update(ctx, request) +} + +type ProviderProvidersInterface interface { + // WithImpl could be used to override low-level API implementations for unit + // testing purposes with [github.com/golang/mock] or other mocking frameworks. + // Deprecated: use MockProviderProvidersInterface instead. + WithImpl(impl ProviderProvidersService) ProviderProvidersInterface + + // Impl returns low-level ProviderProviders API implementation + // Deprecated: use MockProviderProvidersInterface instead. + Impl() ProviderProvidersService + + // Create a provider. + // + // Create a provider + Create(ctx context.Context, request CreateProviderRequest) (*CreateProviderResponse, error) + + // Delete provider. + // + // Delete provider + Delete(ctx context.Context, request DeleteProviderRequest) error + + // Delete provider. + // + // Delete provider + DeleteById(ctx context.Context, id string) error + + // Get provider. + // + // Get provider profile + Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) + + // Get provider. + // + // Get provider profile + GetById(ctx context.Context, id string) (*GetProviderResponse, error) + + // List providers. + // + // List provider profiles for account. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListProvidersRequest) listing.Iterator[ProviderInfo] + + // List providers. + // + // List provider profiles for account. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListProvidersRequest) ([]ProviderInfo, error) + + // ProviderInfoNameToIdMap calls [ProviderProvidersAPI.ListAll] and creates a map of results with [ProviderInfo].Name as key and [ProviderInfo].Id as value. + // + // Returns an error if there's more than one [ProviderInfo] with the same .Name. + // + // Note: All [ProviderInfo] instances are loaded into memory before creating a map. + // + // This method is generated by Databricks SDK Code Generator. + ProviderInfoNameToIdMap(ctx context.Context, request ListProvidersRequest) (map[string]string, error) + + // GetByName calls [ProviderProvidersAPI.ProviderInfoNameToIdMap] and returns a single [ProviderInfo]. + // + // Returns an error if there's more than one [ProviderInfo] with the same .Name. + // + // Note: All [ProviderInfo] instances are loaded into memory before returning matching by name. + // + // This method is generated by Databricks SDK Code Generator. + GetByName(ctx context.Context, name string) (*ProviderInfo, error) + + // Update provider. + // + // Update provider profile + Update(ctx context.Context, request UpdateProviderRequest) (*UpdateProviderResponse, error) +} + +func NewProviderProviders(client *client.DatabricksClient) *ProviderProvidersAPI { + return &ProviderProvidersAPI{ + impl: &providerProvidersImpl{ + client: client, + }, + } +} + +// Providers are entities that manage assets in Marketplace. +type ProviderProvidersAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(ProviderProvidersService) + impl ProviderProvidersService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +// Deprecated: use MockProviderProvidersInterface instead. +func (a *ProviderProvidersAPI) WithImpl(impl ProviderProvidersService) ProviderProvidersInterface { + a.impl = impl + return a +} + +// Impl returns low-level ProviderProviders API implementation +// Deprecated: use MockProviderProvidersInterface instead. +func (a *ProviderProvidersAPI) Impl() ProviderProvidersService { + return a.impl +} + +// Create a provider. +// +// Create a provider +func (a *ProviderProvidersAPI) Create(ctx context.Context, request CreateProviderRequest) (*CreateProviderResponse, error) { + return a.impl.Create(ctx, request) +} + +// Delete provider. +// +// Delete provider +func (a *ProviderProvidersAPI) Delete(ctx context.Context, request DeleteProviderRequest) error { + return a.impl.Delete(ctx, request) +} + +// Delete provider. +// +// Delete provider +func (a *ProviderProvidersAPI) DeleteById(ctx context.Context, id string) error { + return a.impl.Delete(ctx, DeleteProviderRequest{ + Id: id, + }) +} + +// Get provider. +// +// Get provider profile +func (a *ProviderProvidersAPI) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) { + return a.impl.Get(ctx, request) +} + +// Get provider. +// +// Get provider profile +func (a *ProviderProvidersAPI) GetById(ctx context.Context, id string) (*GetProviderResponse, error) { + return a.impl.Get(ctx, GetProviderRequest{ + Id: id, + }) +} + +// List providers. +// +// List provider profiles for account. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderProvidersAPI) List(ctx context.Context, request ListProvidersRequest) listing.Iterator[ProviderInfo] { + + getNextPage := func(ctx context.Context, req ListProvidersRequest) (*ListProvidersResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) + } + getItems := func(resp *ListProvidersResponse) []ProviderInfo { + return resp.Providers + } + getNextReq := func(resp *ListProvidersResponse) *ListProvidersRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List providers. +// +// List provider profiles for account. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderProvidersAPI) ListAll(ctx context.Context, request ListProvidersRequest) ([]ProviderInfo, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[ProviderInfo](ctx, iterator) +} + +// ProviderInfoNameToIdMap calls [ProviderProvidersAPI.ListAll] and creates a map of results with [ProviderInfo].Name as key and [ProviderInfo].Id as value. +// +// Returns an error if there's more than one [ProviderInfo] with the same .Name. +// +// Note: All [ProviderInfo] instances are loaded into memory before creating a map. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderProvidersAPI) ProviderInfoNameToIdMap(ctx context.Context, request ListProvidersRequest) (map[string]string, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") + mapping := map[string]string{} + result, err := a.ListAll(ctx, request) + if err != nil { + return nil, err + } + for _, v := range result { + key := v.Name + _, duplicate := mapping[key] + if duplicate { + return nil, fmt.Errorf("duplicate .Name: %s", key) + } + mapping[key] = v.Id + } + return mapping, nil +} + +// GetByName calls [ProviderProvidersAPI.ProviderInfoNameToIdMap] and returns a single [ProviderInfo]. +// +// Returns an error if there's more than one [ProviderInfo] with the same .Name. +// +// Note: All [ProviderInfo] instances are loaded into memory before returning matching by name. +// +// This method is generated by Databricks SDK Code Generator. +func (a *ProviderProvidersAPI) GetByName(ctx context.Context, name string) (*ProviderInfo, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") + result, err := a.ListAll(ctx, ListProvidersRequest{}) + if err != nil { + return nil, err + } + tmp := map[string][]ProviderInfo{} + for _, v := range result { + key := v.Name + tmp[key] = append(tmp[key], v) + } + alternatives, ok := tmp[name] + if !ok || len(alternatives) == 0 { + return nil, fmt.Errorf("ProviderInfo named '%s' does not exist", name) + } + if len(alternatives) > 1 { + return nil, fmt.Errorf("there are %d instances of ProviderInfo named '%s'", len(alternatives), name) + } + return &alternatives[0], nil +} + +// Update provider. +// +// Update provider profile +func (a *ProviderProvidersAPI) Update(ctx context.Context, request UpdateProviderRequest) (*UpdateProviderResponse, error) { + return a.impl.Update(ctx, request) +} diff --git a/service/marketplace/impl.go b/service/marketplace/impl.go new file mode 100755 index 000000000..a9c85828e --- /dev/null +++ b/service/marketplace/impl.go @@ -0,0 +1,518 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package marketplace + +import ( + "context" + "fmt" + "net/http" + + "github.com/databricks/databricks-sdk-go/client" +) + +// unexported type that holds implementations of just ConsumerFulfillments API methods +type consumerFulfillmentsImpl struct { + client *client.DatabricksClient +} + +func (a *consumerFulfillmentsImpl) Get(ctx context.Context, request GetListingContentMetadataRequest) (*GetListingContentMetadataResponse, error) { + var getListingContentMetadataResponse GetListingContentMetadataResponse + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/content", request.ListingId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingContentMetadataResponse) + return &getListingContentMetadataResponse, err +} + +func (a *consumerFulfillmentsImpl) List(ctx context.Context, request ListFulfillmentsRequest) (*ListFulfillmentsResponse, error) { + var listFulfillmentsResponse ListFulfillmentsResponse + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/fulfillments", request.ListingId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listFulfillmentsResponse) + return &listFulfillmentsResponse, err +} + +// unexported type that holds implementations of just ConsumerInstallations API methods +type consumerInstallationsImpl struct { + client *client.DatabricksClient +} + +func (a *consumerInstallationsImpl) Create(ctx context.Context, request CreateInstallationRequest) (*Installation, error) { + var installation Installation + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", request.ListingId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &installation) + return &installation, err +} + +func (a *consumerInstallationsImpl) Delete(ctx context.Context, request DeleteInstallationRequest) error { + var deleteInstallationResponse DeleteInstallationResponse + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", request.ListingId, request.InstallationId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteInstallationResponse) + return err +} + +func (a *consumerInstallationsImpl) List(ctx context.Context, request ListAllInstallationsRequest) (*ListAllInstallationsResponse, error) { + var listAllInstallationsResponse ListAllInstallationsResponse + path := "/api/2.1/marketplace-consumer/installations" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAllInstallationsResponse) + return &listAllInstallationsResponse, err +} + +func (a *consumerInstallationsImpl) ListListingInstallations(ctx context.Context, request ListInstallationsRequest) (*ListInstallationsResponse, error) { + var listInstallationsResponse ListInstallationsResponse + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", request.ListingId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listInstallationsResponse) + return &listInstallationsResponse, err +} + +func (a *consumerInstallationsImpl) Update(ctx context.Context, request UpdateInstallationRequest) (*UpdateInstallationResponse, error) { + var updateInstallationResponse UpdateInstallationResponse + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", request.ListingId, request.InstallationId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateInstallationResponse) + return &updateInstallationResponse, err +} + +// unexported type that holds implementations of just ConsumerListings API methods +type consumerListingsImpl struct { + client *client.DatabricksClient +} + +func (a *consumerListingsImpl) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) { + var getListingResponse GetListingResponse + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingResponse) + return &getListingResponse, err +} + +func (a *consumerListingsImpl) List(ctx context.Context, request ListListingsRequest) (*ListListingsResponse, error) { + var listListingsResponse ListListingsResponse + path := "/api/2.1/marketplace-consumer/listings" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listListingsResponse) + return &listListingsResponse, err +} + +func (a *consumerListingsImpl) Search(ctx context.Context, request SearchListingsRequest) (*SearchListingsResponse, error) { + var searchListingsResponse SearchListingsResponse + path := "/api/2.1/marketplace-consumer/search-listings" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &searchListingsResponse) + return &searchListingsResponse, err +} + +// unexported type that holds implementations of just ConsumerPersonalizationRequests API methods +type consumerPersonalizationRequestsImpl struct { + client *client.DatabricksClient +} + +func (a *consumerPersonalizationRequestsImpl) Create(ctx context.Context, request CreatePersonalizationRequest) (*CreatePersonalizationRequestResponse, error) { + var createPersonalizationRequestResponse CreatePersonalizationRequestResponse + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", request.ListingId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createPersonalizationRequestResponse) + return &createPersonalizationRequestResponse, err +} + +func (a *consumerPersonalizationRequestsImpl) Get(ctx context.Context, request GetPersonalizationRequestRequest) (*GetPersonalizationRequestResponse, error) { + var getPersonalizationRequestResponse GetPersonalizationRequestResponse + path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", request.ListingId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPersonalizationRequestResponse) + return &getPersonalizationRequestResponse, err +} + +func (a *consumerPersonalizationRequestsImpl) List(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) { + var listAllPersonalizationRequestsResponse ListAllPersonalizationRequestsResponse + path := "/api/2.1/marketplace-consumer/personalization-requests" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAllPersonalizationRequestsResponse) + return &listAllPersonalizationRequestsResponse, err +} + +// unexported type that holds implementations of just ConsumerProviders API methods +type consumerProvidersImpl struct { + client *client.DatabricksClient +} + +func (a *consumerProvidersImpl) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) { + var getProviderResponse GetProviderResponse + path := fmt.Sprintf("/api/2.1/marketplace-consumer/providers/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getProviderResponse) + return &getProviderResponse, err +} + +func (a *consumerProvidersImpl) List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) { + var listProvidersResponse ListProvidersResponse + path := "/api/2.1/marketplace-consumer/providers" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listProvidersResponse) + return &listProvidersResponse, err +} + +// unexported type that holds implementations of just ProviderExchangeFilters API methods +type providerExchangeFiltersImpl struct { + client *client.DatabricksClient +} + +func (a *providerExchangeFiltersImpl) Create(ctx context.Context, request CreateExchangeFilterRequest) (*CreateExchangeFilterResponse, error) { + var createExchangeFilterResponse CreateExchangeFilterResponse + path := "/api/2.0/marketplace-exchange/filters" + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createExchangeFilterResponse) + return &createExchangeFilterResponse, err +} + +func (a *providerExchangeFiltersImpl) Delete(ctx context.Context, request DeleteExchangeFilterRequest) error { + var deleteExchangeFilterResponse DeleteExchangeFilterResponse + path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteExchangeFilterResponse) + return err +} + +func (a *providerExchangeFiltersImpl) List(ctx context.Context, request ListExchangeFiltersRequest) (*ListExchangeFiltersResponse, error) { + var listExchangeFiltersResponse ListExchangeFiltersResponse + path := "/api/2.0/marketplace-exchange/filters" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExchangeFiltersResponse) + return &listExchangeFiltersResponse, err +} + +func (a *providerExchangeFiltersImpl) Update(ctx context.Context, request UpdateExchangeFilterRequest) (*UpdateExchangeFilterResponse, error) { + var updateExchangeFilterResponse UpdateExchangeFilterResponse + path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateExchangeFilterResponse) + return &updateExchangeFilterResponse, err +} + +// unexported type that holds implementations of just ProviderExchanges API methods +type providerExchangesImpl struct { + client *client.DatabricksClient +} + +func (a *providerExchangesImpl) AddListingToExchange(ctx context.Context, request AddExchangeForListingRequest) (*AddExchangeForListingResponse, error) { + var addExchangeForListingResponse AddExchangeForListingResponse + path := "/api/2.0/marketplace-exchange/exchanges-for-listing" + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &addExchangeForListingResponse) + return &addExchangeForListingResponse, err +} + +func (a *providerExchangesImpl) Create(ctx context.Context, request CreateExchangeRequest) (*CreateExchangeResponse, error) { + var createExchangeResponse CreateExchangeResponse + path := "/api/2.0/marketplace-exchange/exchanges" + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createExchangeResponse) + return &createExchangeResponse, err +} + +func (a *providerExchangesImpl) Delete(ctx context.Context, request DeleteExchangeRequest) error { + var deleteExchangeResponse DeleteExchangeResponse + path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteExchangeResponse) + return err +} + +func (a *providerExchangesImpl) DeleteListingFromExchange(ctx context.Context, request RemoveExchangeForListingRequest) error { + var removeExchangeForListingResponse RemoveExchangeForListingResponse + path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges-for-listing/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &removeExchangeForListingResponse) + return err +} + +func (a *providerExchangesImpl) Get(ctx context.Context, request GetExchangeRequest) (*GetExchangeResponse, error) { + var getExchangeResponse GetExchangeResponse + path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getExchangeResponse) + return &getExchangeResponse, err +} + +func (a *providerExchangesImpl) List(ctx context.Context, request ListExchangesRequest) (*ListExchangesResponse, error) { + var listExchangesResponse ListExchangesResponse + path := "/api/2.0/marketplace-exchange/exchanges" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExchangesResponse) + return &listExchangesResponse, err +} + +func (a *providerExchangesImpl) ListExchangesForListing(ctx context.Context, request ListExchangesForListingRequest) (*ListExchangesForListingResponse, error) { + var listExchangesForListingResponse ListExchangesForListingResponse + path := "/api/2.0/marketplace-exchange/exchanges-for-listing" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExchangesForListingResponse) + return &listExchangesForListingResponse, err +} + +func (a *providerExchangesImpl) ListListingsForExchange(ctx context.Context, request ListListingsForExchangeRequest) (*ListListingsForExchangeResponse, error) { + var listListingsForExchangeResponse ListListingsForExchangeResponse + path := "/api/2.0/marketplace-exchange/listings-for-exchange" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listListingsForExchangeResponse) + return &listListingsForExchangeResponse, err +} + +func (a *providerExchangesImpl) Update(ctx context.Context, request UpdateExchangeRequest) (*UpdateExchangeResponse, error) { + var updateExchangeResponse UpdateExchangeResponse + path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateExchangeResponse) + return &updateExchangeResponse, err +} + +// unexported type that holds implementations of just ProviderFiles API methods +type providerFilesImpl struct { + client *client.DatabricksClient +} + +func (a *providerFilesImpl) Create(ctx context.Context, request CreateFileRequest) (*CreateFileResponse, error) { + var createFileResponse CreateFileResponse + path := "/api/2.0/marketplace-provider/files" + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createFileResponse) + return &createFileResponse, err +} + +func (a *providerFilesImpl) Delete(ctx context.Context, request DeleteFileRequest) error { + var deleteFileResponse DeleteFileResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", request.FileId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteFileResponse) + return err +} + +func (a *providerFilesImpl) Get(ctx context.Context, request GetFileRequest) (*GetFileResponse, error) { + var getFileResponse GetFileResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", request.FileId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getFileResponse) + return &getFileResponse, err +} + +func (a *providerFilesImpl) List(ctx context.Context, request ListFilesRequest) (*ListFilesResponse, error) { + var listFilesResponse ListFilesResponse + path := "/api/2.0/marketplace-provider/files" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listFilesResponse) + return &listFilesResponse, err +} + +// unexported type that holds implementations of just ProviderListings API methods +type providerListingsImpl struct { + client *client.DatabricksClient +} + +func (a *providerListingsImpl) Create(ctx context.Context, request CreateListingRequest) (*CreateListingResponse, error) { + var createListingResponse CreateListingResponse + path := "/api/2.0/marketplace-provider/listing" + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createListingResponse) + return &createListingResponse, err +} + +func (a *providerListingsImpl) Delete(ctx context.Context, request DeleteListingRequest) error { + var deleteListingResponse DeleteListingResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteListingResponse) + return err +} + +func (a *providerListingsImpl) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) { + var getListingResponse GetListingResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingResponse) + return &getListingResponse, err +} + +func (a *providerListingsImpl) List(ctx context.Context, request GetListingsRequest) (*GetListingsResponse, error) { + var getListingsResponse GetListingsResponse + path := "/api/2.0/marketplace-provider/listings" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingsResponse) + return &getListingsResponse, err +} + +func (a *providerListingsImpl) Update(ctx context.Context, request UpdateListingRequest) (*UpdateListingResponse, error) { + var updateListingResponse UpdateListingResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateListingResponse) + return &updateListingResponse, err +} + +// unexported type that holds implementations of just ProviderPersonalizationRequests API methods +type providerPersonalizationRequestsImpl struct { + client *client.DatabricksClient +} + +func (a *providerPersonalizationRequestsImpl) List(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) { + var listAllPersonalizationRequestsResponse ListAllPersonalizationRequestsResponse + path := "/api/2.0/marketplace-provider/personalization-requests" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAllPersonalizationRequestsResponse) + return &listAllPersonalizationRequestsResponse, err +} + +func (a *providerPersonalizationRequestsImpl) Update(ctx context.Context, request UpdatePersonalizationRequestRequest) (*UpdatePersonalizationRequestResponse, error) { + var updatePersonalizationRequestResponse UpdatePersonalizationRequestResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v/personalization-requests/%v/request-status", request.ListingId, request.RequestId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updatePersonalizationRequestResponse) + return &updatePersonalizationRequestResponse, err +} + +// unexported type that holds implementations of just ProviderProviderAnalyticsDashboards API methods +type providerProviderAnalyticsDashboardsImpl struct { + client *client.DatabricksClient +} + +func (a *providerProviderAnalyticsDashboardsImpl) Create(ctx context.Context) (*ProviderAnalyticsDashboard, error) { + var providerAnalyticsDashboard ProviderAnalyticsDashboard + path := "/api/2.0/marketplace-provider/analytics_dashboard" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &providerAnalyticsDashboard) + return &providerAnalyticsDashboard, err +} + +func (a *providerProviderAnalyticsDashboardsImpl) Get(ctx context.Context) (*ListProviderAnalyticsDashboardResponse, error) { + var listProviderAnalyticsDashboardResponse ListProviderAnalyticsDashboardResponse + path := "/api/2.0/marketplace-provider/analytics_dashboard" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listProviderAnalyticsDashboardResponse) + return &listProviderAnalyticsDashboardResponse, err +} + +func (a *providerProviderAnalyticsDashboardsImpl) GetLatestVersion(ctx context.Context) (*GetLatestVersionProviderAnalyticsDashboardResponse, error) { + var getLatestVersionProviderAnalyticsDashboardResponse GetLatestVersionProviderAnalyticsDashboardResponse + path := "/api/2.0/marketplace-provider/analytics_dashboard/latest" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &getLatestVersionProviderAnalyticsDashboardResponse) + return &getLatestVersionProviderAnalyticsDashboardResponse, err +} + +func (a *providerProviderAnalyticsDashboardsImpl) Update(ctx context.Context, request UpdateProviderAnalyticsDashboardRequest) (*UpdateProviderAnalyticsDashboardResponse, error) { + var updateProviderAnalyticsDashboardResponse UpdateProviderAnalyticsDashboardResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/analytics_dashboard/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateProviderAnalyticsDashboardResponse) + return &updateProviderAnalyticsDashboardResponse, err +} + +// unexported type that holds implementations of just ProviderProviders API methods +type providerProvidersImpl struct { + client *client.DatabricksClient +} + +func (a *providerProvidersImpl) Create(ctx context.Context, request CreateProviderRequest) (*CreateProviderResponse, error) { + var createProviderResponse CreateProviderResponse + path := "/api/2.0/marketplace-provider/provider" + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createProviderResponse) + return &createProviderResponse, err +} + +func (a *providerProvidersImpl) Delete(ctx context.Context, request DeleteProviderRequest) error { + var deleteProviderResponse DeleteProviderResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteProviderResponse) + return err +} + +func (a *providerProvidersImpl) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) { + var getProviderResponse GetProviderResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getProviderResponse) + return &getProviderResponse, err +} + +func (a *providerProvidersImpl) List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) { + var listProvidersResponse ListProvidersResponse + path := "/api/2.0/marketplace-provider/providers" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listProvidersResponse) + return &listProvidersResponse, err +} + +func (a *providerProvidersImpl) Update(ctx context.Context, request UpdateProviderRequest) (*UpdateProviderResponse, error) { + var updateProviderResponse UpdateProviderResponse + path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateProviderResponse) + return &updateProviderResponse, err +} diff --git a/service/marketplace/interface.go b/service/marketplace/interface.go new file mode 100755 index 000000000..51263c1e9 --- /dev/null +++ b/service/marketplace/interface.go @@ -0,0 +1,355 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package marketplace + +import ( + "context" +) + +// Fulfillments are entities that allow consumers to preview installations. +type ConsumerFulfillmentsService interface { + + // Get listing content metadata. + // + // Get a high level preview of the metadata of listing installable content. + // + // Use GetAll() to get all SharedDataObject instances, which will iterate over every result page. + Get(ctx context.Context, request GetListingContentMetadataRequest) (*GetListingContentMetadataResponse, error) + + // List all listing fulfillments. + // + // Get all listings fulfillments associated with a listing. A _fulfillment_ + // is a potential installation. Standard installations contain metadata + // about the attached share or git repo. Only one of these fields will be + // present. Personalized installations contain metadata about the attached + // share or git repo, as well as the Delta Sharing recipient type. + // + // Use ListAll() to get all ListingFulfillment instances, which will iterate over every result page. + List(ctx context.Context, request ListFulfillmentsRequest) (*ListFulfillmentsResponse, error) +} + +// Installations are entities that allow consumers to interact with Databricks +// Marketplace listings. +type ConsumerInstallationsService interface { + + // Install from a listing. + // + // Install payload associated with a Databricks Marketplace listing. + Create(ctx context.Context, request CreateInstallationRequest) (*Installation, error) + + // Uninstall from a listing. + // + // Uninstall an installation associated with a Databricks Marketplace + // listing. + Delete(ctx context.Context, request DeleteInstallationRequest) error + + // List all installations. + // + // List all installations across all listings. + // + // Use ListAll() to get all InstallationDetail instances, which will iterate over every result page. + List(ctx context.Context, request ListAllInstallationsRequest) (*ListAllInstallationsResponse, error) + + // List installations for a listing. + // + // List all installations for a particular listing. + // + // Use ListListingInstallationsAll() to get all InstallationDetail instances, which will iterate over every result page. + ListListingInstallations(ctx context.Context, request ListInstallationsRequest) (*ListInstallationsResponse, error) + + // Update an installation. + // + // This is a update API that will update the part of the fields defined in + // the installation table as well as interact with external services + // according to the fields not included in the installation table 1. the + // token will be rotate if the rotateToken flag is true 2. the token will be + // forcibly rotate if the rotateToken flag is true and the tokenInfo field + // is empty + Update(ctx context.Context, request UpdateInstallationRequest) (*UpdateInstallationResponse, error) +} + +// Listings are the core entities in the Marketplace. They represent the +// products that are available for consumption. +type ConsumerListingsService interface { + + // Get listing. + // + // Get a published listing in the Databricks Marketplace that the consumer + // has access to. + Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) + + // List listings. + // + // List all published listings in the Databricks Marketplace that the + // consumer has access to. + // + // Use ListAll() to get all Listing instances, which will iterate over every result page. + List(ctx context.Context, request ListListingsRequest) (*ListListingsResponse, error) + + // Search listings. + // + // Search published listings in the Databricks Marketplace that the consumer + // has access to. This query supports a variety of different search + // parameters and performs fuzzy matching. + // + // Use SearchAll() to get all Listing instances, which will iterate over every result page. + Search(ctx context.Context, request SearchListingsRequest) (*SearchListingsResponse, error) +} + +// Personalization Requests allow customers to interact with the individualized +// Marketplace listing flow. +type ConsumerPersonalizationRequestsService interface { + + // Create a personalization request. + // + // Create a personalization request for a listing. + Create(ctx context.Context, request CreatePersonalizationRequest) (*CreatePersonalizationRequestResponse, error) + + // Get the personalization request for a listing. + // + // Get the personalization request for a listing. Each consumer can make at + // *most* one personalization request for a listing. + Get(ctx context.Context, request GetPersonalizationRequestRequest) (*GetPersonalizationRequestResponse, error) + + // List all personalization requests. + // + // List personalization requests for a consumer across all listings. + // + // Use ListAll() to get all PersonalizationRequest instances, which will iterate over every result page. + List(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) +} + +// Providers are the entities that publish listings to the Marketplace. +type ConsumerProvidersService interface { + + // Get a provider. + // + // Get a provider in the Databricks Marketplace with at least one visible + // listing. + Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) + + // List providers. + // + // List all providers in the Databricks Marketplace with at least one + // visible listing. + // + // Use ListAll() to get all ProviderInfo instances, which will iterate over every result page. + List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) +} + +// Marketplace exchanges filters curate which groups can access an exchange. +type ProviderExchangeFiltersService interface { + + // Create a new exchange filter. + // + // Add an exchange filter. + Create(ctx context.Context, request CreateExchangeFilterRequest) (*CreateExchangeFilterResponse, error) + + // Delete an exchange filter. + // + // Delete an exchange filter + Delete(ctx context.Context, request DeleteExchangeFilterRequest) error + + // List exchange filters. + // + // List exchange filter + // + // Use ListAll() to get all ExchangeFilter instances, which will iterate over every result page. + List(ctx context.Context, request ListExchangeFiltersRequest) (*ListExchangeFiltersResponse, error) + + // Update exchange filter. + // + // Update an exchange filter. + Update(ctx context.Context, request UpdateExchangeFilterRequest) (*UpdateExchangeFilterResponse, error) +} + +// Marketplace exchanges allow providers to share their listings with a curated +// set of customers. +type ProviderExchangesService interface { + + // Add an exchange for listing. + // + // Associate an exchange with a listing + AddListingToExchange(ctx context.Context, request AddExchangeForListingRequest) (*AddExchangeForListingResponse, error) + + // Create an exchange. + // + // Create an exchange + Create(ctx context.Context, request CreateExchangeRequest) (*CreateExchangeResponse, error) + + // Delete an exchange. + // + // This removes a listing from marketplace. + Delete(ctx context.Context, request DeleteExchangeRequest) error + + // Remove an exchange for listing. + // + // Disassociate an exchange with a listing + DeleteListingFromExchange(ctx context.Context, request RemoveExchangeForListingRequest) error + + // Get an exchange. + // + // Get an exchange. + Get(ctx context.Context, request GetExchangeRequest) (*GetExchangeResponse, error) + + // List exchanges. + // + // List exchanges visible to provider + // + // Use ListAll() to get all Exchange instances, which will iterate over every result page. + List(ctx context.Context, request ListExchangesRequest) (*ListExchangesResponse, error) + + // List exchanges for listing. + // + // List exchanges associated with a listing + // + // Use ListExchangesForListingAll() to get all ExchangeListing instances, which will iterate over every result page. + ListExchangesForListing(ctx context.Context, request ListExchangesForListingRequest) (*ListExchangesForListingResponse, error) + + // List listings for exchange. + // + // List listings associated with an exchange + // + // Use ListListingsForExchangeAll() to get all ExchangeListing instances, which will iterate over every result page. + ListListingsForExchange(ctx context.Context, request ListListingsForExchangeRequest) (*ListListingsForExchangeResponse, error) + + // Update exchange. + // + // Update an exchange + Update(ctx context.Context, request UpdateExchangeRequest) (*UpdateExchangeResponse, error) +} + +// Marketplace offers a set of file APIs for various purposes such as preview +// notebooks and provider icons. +type ProviderFilesService interface { + + // Create a file. + // + // Create a file. Currently, only provider icons and attached notebooks are + // supported. + Create(ctx context.Context, request CreateFileRequest) (*CreateFileResponse, error) + + // Delete a file. + // + // Delete a file + Delete(ctx context.Context, request DeleteFileRequest) error + + // Get a file. + // + // Get a file + Get(ctx context.Context, request GetFileRequest) (*GetFileResponse, error) + + // List files. + // + // List files attached to a parent entity. + // + // Use ListAll() to get all FileInfo instances, which will iterate over every result page. + List(ctx context.Context, request ListFilesRequest) (*ListFilesResponse, error) +} + +// Listings are the core entities in the Marketplace. They represent the +// products that are available for consumption. +type ProviderListingsService interface { + + // Create a listing. + // + // Create a new listing + Create(ctx context.Context, request CreateListingRequest) (*CreateListingResponse, error) + + // Delete a listing. + // + // Delete a listing + Delete(ctx context.Context, request DeleteListingRequest) error + + // Get a listing. + // + // Get a listing + Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) + + // List listings. + // + // List listings owned by this provider + // + // Use ListAll() to get all Listing instances, which will iterate over every result page. + List(ctx context.Context, request GetListingsRequest) (*GetListingsResponse, error) + + // Update listing. + // + // Update a listing + Update(ctx context.Context, request UpdateListingRequest) (*UpdateListingResponse, error) +} + +// Personalization requests are an alternate to instantly available listings. +// Control the lifecycle of personalized solutions. +type ProviderPersonalizationRequestsService interface { + + // All personalization requests across all listings. + // + // List personalization requests to this provider. This will return all + // personalization requests, regardless of which listing they are for. + // + // Use ListAll() to get all PersonalizationRequest instances, which will iterate over every result page. + List(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) + + // Update personalization request status. + // + // Update personalization request. This method only permits updating the + // status of the request. + Update(ctx context.Context, request UpdatePersonalizationRequestRequest) (*UpdatePersonalizationRequestResponse, error) +} + +// Manage templated analytics solution for providers. +type ProviderProviderAnalyticsDashboardsService interface { + + // Create provider analytics dashboard. + // + // Create provider analytics dashboard. Returns Marketplace specific `id`. + // Not to be confused with the Lakeview dashboard id. + Create(ctx context.Context) (*ProviderAnalyticsDashboard, error) + + // Get provider analytics dashboard. + // + // Get provider analytics dashboard. + Get(ctx context.Context) (*ListProviderAnalyticsDashboardResponse, error) + + // Get latest version of provider analytics dashboard. + // + // Get latest version of provider analytics dashboard. + GetLatestVersion(ctx context.Context) (*GetLatestVersionProviderAnalyticsDashboardResponse, error) + + // Update provider analytics dashboard. + // + // Update provider analytics dashboard. + Update(ctx context.Context, request UpdateProviderAnalyticsDashboardRequest) (*UpdateProviderAnalyticsDashboardResponse, error) +} + +// Providers are entities that manage assets in Marketplace. +type ProviderProvidersService interface { + + // Create a provider. + // + // Create a provider + Create(ctx context.Context, request CreateProviderRequest) (*CreateProviderResponse, error) + + // Delete provider. + // + // Delete provider + Delete(ctx context.Context, request DeleteProviderRequest) error + + // Get provider. + // + // Get provider profile + Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) + + // List providers. + // + // List provider profiles for account. + // + // Use ListAll() to get all ProviderInfo instances, which will iterate over every result page. + List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) + + // Update provider. + // + // Update provider profile + Update(ctx context.Context, request UpdateProviderRequest) (*UpdateProviderResponse, error) +} diff --git a/service/marketplace/model.go b/service/marketplace/model.go new file mode 100755 index 000000000..68b605d95 --- /dev/null +++ b/service/marketplace/model.go @@ -0,0 +1,2175 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package marketplace + +import ( + "fmt" + + "github.com/databricks/databricks-sdk-go/marshal" +) + +type AddExchangeForListingRequest struct { + ExchangeId string `json:"exchange_id"` + + ListingId string `json:"listing_id"` +} + +type AddExchangeForListingResponse struct { + ExchangeForListing *ExchangeListing `json:"exchange_for_listing,omitempty"` +} + +type AssetType string + +const AssetTypeAssetTypeDataTable AssetType = `ASSET_TYPE_DATA_TABLE` + +const AssetTypeAssetTypeGitRepo AssetType = `ASSET_TYPE_GIT_REPO` + +const AssetTypeAssetTypeMedia AssetType = `ASSET_TYPE_MEDIA` + +const AssetTypeAssetTypeModel AssetType = `ASSET_TYPE_MODEL` + +const AssetTypeAssetTypeNotebook AssetType = `ASSET_TYPE_NOTEBOOK` + +const AssetTypeAssetTypeUnspecified AssetType = `ASSET_TYPE_UNSPECIFIED` + +// String representation for [fmt.Print] +func (f *AssetType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *AssetType) Set(v string) error { + switch v { + case `ASSET_TYPE_DATA_TABLE`, `ASSET_TYPE_GIT_REPO`, `ASSET_TYPE_MEDIA`, `ASSET_TYPE_MODEL`, `ASSET_TYPE_NOTEBOOK`, `ASSET_TYPE_UNSPECIFIED`: + *f = AssetType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "ASSET_TYPE_DATA_TABLE", "ASSET_TYPE_GIT_REPO", "ASSET_TYPE_MEDIA", "ASSET_TYPE_MODEL", "ASSET_TYPE_NOTEBOOK", "ASSET_TYPE_UNSPECIFIED"`, v) + } +} + +// Type always returns AssetType to satisfy [pflag.Value] interface +func (f *AssetType) Type() string { + return "AssetType" +} + +type Category string + +const CategoryAdvertisingAndMarketing Category = `ADVERTISING_AND_MARKETING` + +const CategoryClimateAndEnvironment Category = `CLIMATE_AND_ENVIRONMENT` + +const CategoryCommerce Category = `COMMERCE` + +const CategoryDemographics Category = `DEMOGRAPHICS` + +const CategoryEconomics Category = `ECONOMICS` + +const CategoryEducation Category = `EDUCATION` + +const CategoryEnergy Category = `ENERGY` + +const CategoryFinancial Category = `FINANCIAL` + +const CategoryGaming Category = `GAMING` + +const CategoryGeospatial Category = `GEOSPATIAL` + +const CategoryHealth Category = `HEALTH` + +const CategoryLookupTables Category = `LOOKUP_TABLES` + +const CategoryManufacturing Category = `MANUFACTURING` + +const CategoryMedia Category = `MEDIA` + +const CategoryOther Category = `OTHER` + +const CategoryPublicSector Category = `PUBLIC_SECTOR` + +const CategoryRetail Category = `RETAIL` + +const CategoryScienceAndResearch Category = `SCIENCE_AND_RESEARCH` + +const CategorySecurity Category = `SECURITY` + +const CategorySports Category = `SPORTS` + +const CategoryTransportationAndLogistics Category = `TRANSPORTATION_AND_LOGISTICS` + +const CategoryTravelAndTourism Category = `TRAVEL_AND_TOURISM` + +// String representation for [fmt.Print] +func (f *Category) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *Category) Set(v string) error { + switch v { + case `ADVERTISING_AND_MARKETING`, `CLIMATE_AND_ENVIRONMENT`, `COMMERCE`, `DEMOGRAPHICS`, `ECONOMICS`, `EDUCATION`, `ENERGY`, `FINANCIAL`, `GAMING`, `GEOSPATIAL`, `HEALTH`, `LOOKUP_TABLES`, `MANUFACTURING`, `MEDIA`, `OTHER`, `PUBLIC_SECTOR`, `RETAIL`, `SCIENCE_AND_RESEARCH`, `SECURITY`, `SPORTS`, `TRANSPORTATION_AND_LOGISTICS`, `TRAVEL_AND_TOURISM`: + *f = Category(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "ADVERTISING_AND_MARKETING", "CLIMATE_AND_ENVIRONMENT", "COMMERCE", "DEMOGRAPHICS", "ECONOMICS", "EDUCATION", "ENERGY", "FINANCIAL", "GAMING", "GEOSPATIAL", "HEALTH", "LOOKUP_TABLES", "MANUFACTURING", "MEDIA", "OTHER", "PUBLIC_SECTOR", "RETAIL", "SCIENCE_AND_RESEARCH", "SECURITY", "SPORTS", "TRANSPORTATION_AND_LOGISTICS", "TRAVEL_AND_TOURISM"`, v) + } +} + +// Type always returns Category to satisfy [pflag.Value] interface +func (f *Category) Type() string { + return "Category" +} + +type ConsumerTerms struct { + Version string `json:"version"` +} + +// contact info for the consumer requesting data or performing a listing +// installation +type ContactInfo struct { + Company string `json:"company,omitempty"` + + Email string `json:"email,omitempty"` + + FirstName string `json:"first_name,omitempty"` + + LastName string `json:"last_name,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ContactInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ContactInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type Cost string + +const CostFree Cost = `FREE` + +const CostPaid Cost = `PAID` + +// String representation for [fmt.Print] +func (f *Cost) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *Cost) Set(v string) error { + switch v { + case `FREE`, `PAID`: + *f = Cost(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FREE", "PAID"`, v) + } +} + +// Type always returns Cost to satisfy [pflag.Value] interface +func (f *Cost) Type() string { + return "Cost" +} + +type CreateExchangeFilterRequest struct { + Filter ExchangeFilter `json:"filter"` +} + +type CreateExchangeFilterResponse struct { + FilterId string `json:"filter_id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreateExchangeFilterResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateExchangeFilterResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateExchangeRequest struct { + Exchange Exchange `json:"exchange"` +} + +type CreateExchangeResponse struct { + ExchangeId string `json:"exchange_id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreateExchangeResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateExchangeResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateFileRequest struct { + DisplayName string `json:"display_name,omitempty"` + + FileParent FileParent `json:"file_parent"` + + MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type"` + + MimeType string `json:"mime_type"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreateFileRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateFileRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateFileResponse struct { + FileInfo *FileInfo `json:"file_info,omitempty"` + // Pre-signed POST URL to blob storage + UploadUrl string `json:"upload_url,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreateFileResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateFileResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateInstallationRequest struct { + AcceptedConsumerTerms *ConsumerTerms `json:"accepted_consumer_terms,omitempty"` + + CatalogName string `json:"catalog_name,omitempty"` + + ListingId string `json:"-" url:"-"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + // for git repo installations + RepoDetail *RepoInstallation `json:"repo_detail,omitempty"` + + ShareName string `json:"share_name,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreateInstallationRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateInstallationRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateListingRequest struct { + Listing Listing `json:"listing"` +} + +type CreateListingResponse struct { + ListingId string `json:"listing_id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreateListingResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateListingResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Data request messages also creates a lead (maybe) +type CreatePersonalizationRequest struct { + AcceptedConsumerTerms ConsumerTerms `json:"accepted_consumer_terms"` + + Comment string `json:"comment,omitempty"` + + Company string `json:"company,omitempty"` + + FirstName string `json:"first_name,omitempty"` + + IntendedUse string `json:"intended_use"` + + IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` + + LastName string `json:"last_name,omitempty"` + + ListingId string `json:"-" url:"-"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreatePersonalizationRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreatePersonalizationRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreatePersonalizationRequestResponse struct { + Id string `json:"id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreatePersonalizationRequestResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreatePersonalizationRequestResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateProviderRequest struct { + Provider ProviderInfo `json:"provider"` +} + +type CreateProviderResponse struct { + Id string `json:"id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreateProviderResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateProviderResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DataRefresh string + +const DataRefreshDaily DataRefresh = `DAILY` + +const DataRefreshHourly DataRefresh = `HOURLY` + +const DataRefreshMinute DataRefresh = `MINUTE` + +const DataRefreshMonthly DataRefresh = `MONTHLY` + +const DataRefreshNone DataRefresh = `NONE` + +const DataRefreshQuarterly DataRefresh = `QUARTERLY` + +const DataRefreshSecond DataRefresh = `SECOND` + +const DataRefreshWeekly DataRefresh = `WEEKLY` + +const DataRefreshYearly DataRefresh = `YEARLY` + +// String representation for [fmt.Print] +func (f *DataRefresh) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DataRefresh) Set(v string) error { + switch v { + case `DAILY`, `HOURLY`, `MINUTE`, `MONTHLY`, `NONE`, `QUARTERLY`, `SECOND`, `WEEKLY`, `YEARLY`: + *f = DataRefresh(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DAILY", "HOURLY", "MINUTE", "MONTHLY", "NONE", "QUARTERLY", "SECOND", "WEEKLY", "YEARLY"`, v) + } +} + +// Type always returns DataRefresh to satisfy [pflag.Value] interface +func (f *DataRefresh) Type() string { + return "DataRefresh" +} + +type DataRefreshInfo struct { + Interval int64 `json:"interval"` + + Unit DataRefresh `json:"unit"` +} + +// Delete an exchange filter +type DeleteExchangeFilterRequest struct { + Id string `json:"-" url:"-"` +} + +type DeleteExchangeFilterResponse struct { +} + +// Delete an exchange +type DeleteExchangeRequest struct { + Id string `json:"-" url:"-"` +} + +type DeleteExchangeResponse struct { +} + +// Delete a file +type DeleteFileRequest struct { + FileId string `json:"-" url:"-"` +} + +type DeleteFileResponse struct { +} + +// Uninstall from a listing +type DeleteInstallationRequest struct { + InstallationId string `json:"-" url:"-"` + + ListingId string `json:"-" url:"-"` +} + +type DeleteInstallationResponse struct { +} + +// Delete a listing +type DeleteListingRequest struct { + Id string `json:"-" url:"-"` +} + +type DeleteListingResponse struct { +} + +// Delete provider +type DeleteProviderRequest struct { + Id string `json:"-" url:"-"` +} + +type DeleteProviderResponse struct { +} + +type DeltaSharingRecipientType string + +const DeltaSharingRecipientTypeDeltaSharingRecipientTypeDatabricks DeltaSharingRecipientType = `DELTA_SHARING_RECIPIENT_TYPE_DATABRICKS` + +const DeltaSharingRecipientTypeDeltaSharingRecipientTypeOpen DeltaSharingRecipientType = `DELTA_SHARING_RECIPIENT_TYPE_OPEN` + +// String representation for [fmt.Print] +func (f *DeltaSharingRecipientType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DeltaSharingRecipientType) Set(v string) error { + switch v { + case `DELTA_SHARING_RECIPIENT_TYPE_DATABRICKS`, `DELTA_SHARING_RECIPIENT_TYPE_OPEN`: + *f = DeltaSharingRecipientType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DELTA_SHARING_RECIPIENT_TYPE_DATABRICKS", "DELTA_SHARING_RECIPIENT_TYPE_OPEN"`, v) + } +} + +// Type always returns DeltaSharingRecipientType to satisfy [pflag.Value] interface +func (f *DeltaSharingRecipientType) Type() string { + return "DeltaSharingRecipientType" +} + +type Exchange struct { + Comment string `json:"comment,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + Filters []ExchangeFilter `json:"filters,omitempty"` + + Id string `json:"id,omitempty"` + + LinkedListings []ExchangeListing `json:"linked_listings,omitempty"` + + Name string `json:"name"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *Exchange) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Exchange) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ExchangeFilter struct { + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + ExchangeId string `json:"exchange_id"` + + FilterType ExchangeFilterType `json:"filter_type"` + + FilterValue string `json:"filter_value"` + + Id string `json:"id,omitempty"` + + Name string `json:"name,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ExchangeFilter) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExchangeFilter) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ExchangeFilterType string + +const ExchangeFilterTypeGlobalMetastoreId ExchangeFilterType = `GLOBAL_METASTORE_ID` + +// String representation for [fmt.Print] +func (f *ExchangeFilterType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ExchangeFilterType) Set(v string) error { + switch v { + case `GLOBAL_METASTORE_ID`: + *f = ExchangeFilterType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "GLOBAL_METASTORE_ID"`, v) + } +} + +// Type always returns ExchangeFilterType to satisfy [pflag.Value] interface +func (f *ExchangeFilterType) Type() string { + return "ExchangeFilterType" +} + +type ExchangeListing struct { + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + ExchangeId string `json:"exchange_id,omitempty"` + + ExchangeName string `json:"exchange_name,omitempty"` + + Id string `json:"id,omitempty"` + + ListingId string `json:"listing_id,omitempty"` + + ListingName string `json:"listing_name,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ExchangeListing) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExchangeListing) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type FileInfo struct { + CreatedAt int64 `json:"created_at,omitempty"` + // Name displayed to users for applicable files, e.g. embedded notebooks + DisplayName string `json:"display_name,omitempty"` + + DownloadLink string `json:"download_link,omitempty"` + + FileParent *FileParent `json:"file_parent,omitempty"` + + Id string `json:"id,omitempty"` + + MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type,omitempty"` + + MimeType string `json:"mime_type,omitempty"` + + Status FileStatus `json:"status,omitempty"` + // Populated if status is in a failed state with more information on reason + // for the failure. + StatusMessage string `json:"status_message,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *FileInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FileInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type FileParent struct { + FileParentType FileParentType `json:"file_parent_type,omitempty"` + // TODO make the following fields required + ParentId string `json:"parent_id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *FileParent) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FileParent) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type FileParentType string + +const FileParentTypeListing FileParentType = `LISTING` + +const FileParentTypeProvider FileParentType = `PROVIDER` + +// String representation for [fmt.Print] +func (f *FileParentType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *FileParentType) Set(v string) error { + switch v { + case `LISTING`, `PROVIDER`: + *f = FileParentType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "LISTING", "PROVIDER"`, v) + } +} + +// Type always returns FileParentType to satisfy [pflag.Value] interface +func (f *FileParentType) Type() string { + return "FileParentType" +} + +type FileStatus string + +const FileStatusFileStatusPublished FileStatus = `FILE_STATUS_PUBLISHED` + +const FileStatusFileStatusSanitizationFailed FileStatus = `FILE_STATUS_SANITIZATION_FAILED` + +const FileStatusFileStatusSanitizing FileStatus = `FILE_STATUS_SANITIZING` + +const FileStatusFileStatusStaging FileStatus = `FILE_STATUS_STAGING` + +// String representation for [fmt.Print] +func (f *FileStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *FileStatus) Set(v string) error { + switch v { + case `FILE_STATUS_PUBLISHED`, `FILE_STATUS_SANITIZATION_FAILED`, `FILE_STATUS_SANITIZING`, `FILE_STATUS_STAGING`: + *f = FileStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FILE_STATUS_PUBLISHED", "FILE_STATUS_SANITIZATION_FAILED", "FILE_STATUS_SANITIZING", "FILE_STATUS_STAGING"`, v) + } +} + +// Type always returns FileStatus to satisfy [pflag.Value] interface +func (f *FileStatus) Type() string { + return "FileStatus" +} + +type FilterType string + +const FilterTypeMetastore FilterType = `METASTORE` + +// String representation for [fmt.Print] +func (f *FilterType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *FilterType) Set(v string) error { + switch v { + case `METASTORE`: + *f = FilterType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "METASTORE"`, v) + } +} + +// Type always returns FilterType to satisfy [pflag.Value] interface +func (f *FilterType) Type() string { + return "FilterType" +} + +type FulfillmentType string + +const FulfillmentTypeInstall FulfillmentType = `INSTALL` + +const FulfillmentTypeRequestAccess FulfillmentType = `REQUEST_ACCESS` + +// String representation for [fmt.Print] +func (f *FulfillmentType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *FulfillmentType) Set(v string) error { + switch v { + case `INSTALL`, `REQUEST_ACCESS`: + *f = FulfillmentType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "INSTALL", "REQUEST_ACCESS"`, v) + } +} + +// Type always returns FulfillmentType to satisfy [pflag.Value] interface +func (f *FulfillmentType) Type() string { + return "FulfillmentType" +} + +// Get an exchange +type GetExchangeRequest struct { + Id string `json:"-" url:"-"` +} + +type GetExchangeResponse struct { + Exchange *Exchange `json:"exchange,omitempty"` +} + +// Get a file +type GetFileRequest struct { + FileId string `json:"-" url:"-"` +} + +type GetFileResponse struct { + FileInfo *FileInfo `json:"file_info,omitempty"` +} + +type GetLatestVersionProviderAnalyticsDashboardResponse struct { + // version here is latest logical version of the dashboard template + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *GetLatestVersionProviderAnalyticsDashboardResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetLatestVersionProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Get listing content metadata +type GetListingContentMetadataRequest struct { + ListingId string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *GetListingContentMetadataRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetListingContentMetadataRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type GetListingContentMetadataResponse struct { + NextPageToken string `json:"next_page_token,omitempty"` + + SharedDataObjects []SharedDataObject `json:"shared_data_objects,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *GetListingContentMetadataResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetListingContentMetadataResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Get listing +type GetListingRequest struct { + Id string `json:"-" url:"-"` +} + +type GetListingResponse struct { + Listing *Listing `json:"listing,omitempty"` +} + +// List listings +type GetListingsRequest struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *GetListingsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetListingsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type GetListingsResponse struct { + Listings []Listing `json:"listings,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *GetListingsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetListingsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Get the personalization request for a listing +type GetPersonalizationRequestRequest struct { + ListingId string `json:"-" url:"-"` +} + +type GetPersonalizationRequestResponse struct { + PersonalizationRequests []PersonalizationRequest `json:"personalization_requests,omitempty"` +} + +// Get a provider +type GetProviderRequest struct { + Id string `json:"-" url:"-"` +} + +type GetProviderResponse struct { + Provider *ProviderInfo `json:"provider,omitempty"` +} + +type Installation struct { + Installation *InstallationDetail `json:"installation,omitempty"` +} + +type InstallationDetail struct { + CatalogName string `json:"catalog_name,omitempty"` + + ErrorMessage string `json:"error_message,omitempty"` + + Id string `json:"id,omitempty"` + + InstalledOn int64 `json:"installed_on,omitempty"` + + ListingId string `json:"listing_id,omitempty"` + + ListingName string `json:"listing_name,omitempty"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + + RepoName string `json:"repo_name,omitempty"` + + RepoPath string `json:"repo_path,omitempty"` + + ShareName string `json:"share_name,omitempty"` + + Status InstallationStatus `json:"status,omitempty"` + + TokenDetail *TokenDetail `json:"token_detail,omitempty"` + + Tokens []TokenInfo `json:"tokens,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *InstallationDetail) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s InstallationDetail) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type InstallationStatus string + +const InstallationStatusFailed InstallationStatus = `FAILED` + +const InstallationStatusInstalled InstallationStatus = `INSTALLED` + +// String representation for [fmt.Print] +func (f *InstallationStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *InstallationStatus) Set(v string) error { + switch v { + case `FAILED`, `INSTALLED`: + *f = InstallationStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FAILED", "INSTALLED"`, v) + } +} + +// Type always returns InstallationStatus to satisfy [pflag.Value] interface +func (f *InstallationStatus) Type() string { + return "InstallationStatus" +} + +// List all installations +type ListAllInstallationsRequest struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListAllInstallationsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListAllInstallationsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListAllInstallationsResponse struct { + Installations []InstallationDetail `json:"installations,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListAllInstallationsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListAllInstallationsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List all personalization requests +type ListAllPersonalizationRequestsRequest struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListAllPersonalizationRequestsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListAllPersonalizationRequestsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListAllPersonalizationRequestsResponse struct { + NextPageToken string `json:"next_page_token,omitempty"` + + PersonalizationRequests []PersonalizationRequest `json:"personalization_requests,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListAllPersonalizationRequestsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListAllPersonalizationRequestsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List exchange filters +type ListExchangeFiltersRequest struct { + ExchangeId string `json:"-" url:"exchange_id"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListExchangeFiltersRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListExchangeFiltersRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListExchangeFiltersResponse struct { + Filters []ExchangeFilter `json:"filters,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListExchangeFiltersResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListExchangeFiltersResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List exchanges for listing +type ListExchangesForListingRequest struct { + ListingId string `json:"-" url:"listing_id"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListExchangesForListingRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListExchangesForListingRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListExchangesForListingResponse struct { + ExchangeListing []ExchangeListing `json:"exchange_listing,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListExchangesForListingResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListExchangesForListingResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List exchanges +type ListExchangesRequest struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListExchangesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListExchangesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListExchangesResponse struct { + Exchanges []Exchange `json:"exchanges,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListExchangesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListExchangesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List files +type ListFilesRequest struct { + FileParent FileParent `json:"-" url:"file_parent"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListFilesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListFilesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListFilesResponse struct { + FileInfos []FileInfo `json:"file_infos,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListFilesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListFilesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List all listing fulfillments +type ListFulfillmentsRequest struct { + ListingId string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListFulfillmentsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListFulfillmentsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListFulfillmentsResponse struct { + Fulfillments []ListingFulfillment `json:"fulfillments,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListFulfillmentsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListFulfillmentsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List installations for a listing +type ListInstallationsRequest struct { + ListingId string `json:"-" url:"-"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListInstallationsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListInstallationsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListInstallationsResponse struct { + Installations []InstallationDetail `json:"installations,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListInstallationsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListInstallationsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List listings for exchange +type ListListingsForExchangeRequest struct { + ExchangeId string `json:"-" url:"exchange_id"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListListingsForExchangeRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListListingsForExchangeRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListListingsForExchangeResponse struct { + ExchangeListings []ExchangeListing `json:"exchange_listings,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListListingsForExchangeResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListListingsForExchangeResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List listings +type ListListingsRequest struct { + // Matches any of the following asset types + Assets []AssetType `json:"-" url:"assets,omitempty"` + // Matches any of the following categories + Categories []Category `json:"-" url:"categories,omitempty"` + // Filters each listing based on if it is free. + IsFree bool `json:"-" url:"is_free,omitempty"` + // Filters each listing based on if it is a private exchange. + IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` + // Filters each listing based on whether it is a staff pick. + IsStaffPick bool `json:"-" url:"is_staff_pick,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + // Matches any of the following provider ids + ProviderIds []string `json:"-" url:"provider_ids,omitempty"` + // Criteria for sorting the resulting set of listings. + SortBySpec *SortBySpec `json:"-" url:"sort_by_spec,omitempty"` + // Matches any of the following tags + Tags []ListingTag `json:"-" url:"tags,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListListingsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListListingsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListListingsResponse struct { + Listings []Listing `json:"listings,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListListingsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListListingsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListProviderAnalyticsDashboardResponse struct { + // dashboard_id will be used to open Lakeview dashboard. + DashboardId string `json:"dashboard_id"` + + Id string `json:"id"` + + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListProviderAnalyticsDashboardResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List providers +type ListProvidersRequest struct { + IsFeatured bool `json:"-" url:"is_featured,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListProvidersRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListProvidersRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListProvidersResponse struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Providers []ProviderInfo `json:"providers,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListProvidersResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListProvidersResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type Listing struct { + Detail *ListingDetail `json:"detail,omitempty"` + + Id string `json:"id,omitempty"` + // Next Number: 26 + Summary ListingSummary `json:"summary"` + + ForceSendFields []string `json:"-"` +} + +func (s *Listing) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Listing) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListingDetail struct { + // Type of assets included in the listing. eg. GIT_REPO, DATA_TABLE, MODEL, + // NOTEBOOK + Assets []AssetType `json:"assets,omitempty"` + // The ending date timestamp for when the data spans + CollectionDateEnd int64 `json:"collection_date_end,omitempty"` + // The starting date timestamp for when the data spans + CollectionDateStart int64 `json:"collection_date_start,omitempty"` + // Smallest unit of time in the dataset + CollectionGranularity *DataRefreshInfo `json:"collection_granularity,omitempty"` + // Whether the dataset is free or paid + Cost Cost `json:"cost,omitempty"` + // Where/how the data is sourced + DataSource string `json:"data_source,omitempty"` + + Description string `json:"description,omitempty"` + + DocumentationLink string `json:"documentation_link,omitempty"` + + EmbeddedNotebookFileInfos []FileInfo `json:"embedded_notebook_file_infos,omitempty"` + + FileIds []string `json:"file_ids,omitempty"` + // Which geo region the listing data is collected from + GeographicalCoverage string `json:"geographical_coverage,omitempty"` + // ID 20, 21 removed don't use License of the data asset - Required for + // listings with model based assets + License string `json:"license,omitempty"` + // What the pricing model is (e.g. paid, subscription, paid upfront); should + // only be present if cost is paid TODO: Not used yet, should deprecate if + // we will never use it + PricingModel string `json:"pricing_model,omitempty"` + + PrivacyPolicyLink string `json:"privacy_policy_link,omitempty"` + // size of the dataset in GB + Size float64 `json:"size,omitempty"` + + SupportLink string `json:"support_link,omitempty"` + // Listing tags - Simple key value pair to annotate listings. When should I + // use tags vs dedicated fields? Using tags avoids the need to add new + // columns in the database for new annotations. However, this should be used + // sparingly since tags are stored as key value pair. Use tags only: 1. If + // the field is optional and won't need to have NOT NULL integrity check 2. + // The value is fairly fixed, static and low cardinality (eg. enums). 3. The + // value won't be used in filters or joins with other tables. + Tags []ListingTag `json:"tags,omitempty"` + + TermsOfService string `json:"terms_of_service,omitempty"` + // How often data is updated + UpdateFrequency *DataRefreshInfo `json:"update_frequency,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListingDetail) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListingDetail) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListingFulfillment struct { + FulfillmentType FulfillmentType `json:"fulfillment_type,omitempty"` + + ListingId string `json:"listing_id"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + + RepoInfo *RepoInfo `json:"repo_info,omitempty"` + + ShareInfo *ShareInfo `json:"share_info,omitempty"` +} + +type ListingSetting struct { + // filters are joined with `or` conjunction. + Filters []VisibilityFilter `json:"filters,omitempty"` + + Visibility Visibility `json:"visibility,omitempty"` +} + +type ListingShareType string + +const ListingShareTypeFull ListingShareType = `FULL` + +const ListingShareTypeSample ListingShareType = `SAMPLE` + +// String representation for [fmt.Print] +func (f *ListingShareType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ListingShareType) Set(v string) error { + switch v { + case `FULL`, `SAMPLE`: + *f = ListingShareType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FULL", "SAMPLE"`, v) + } +} + +// Type always returns ListingShareType to satisfy [pflag.Value] interface +func (f *ListingShareType) Type() string { + return "ListingShareType" +} + +// Enums +type ListingStatus string + +const ListingStatusDraft ListingStatus = `DRAFT` + +const ListingStatusPending ListingStatus = `PENDING` + +const ListingStatusPublished ListingStatus = `PUBLISHED` + +const ListingStatusSuspended ListingStatus = `SUSPENDED` + +// String representation for [fmt.Print] +func (f *ListingStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ListingStatus) Set(v string) error { + switch v { + case `DRAFT`, `PENDING`, `PUBLISHED`, `SUSPENDED`: + *f = ListingStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DRAFT", "PENDING", "PUBLISHED", "SUSPENDED"`, v) + } +} + +// Type always returns ListingStatus to satisfy [pflag.Value] interface +func (f *ListingStatus) Type() string { + return "ListingStatus" +} + +// Next Number: 26 +type ListingSummary struct { + Categories []Category `json:"categories,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + CreatedBy string `json:"created_by,omitempty"` + + CreatedById int64 `json:"created_by_id,omitempty"` + + ExchangeIds []string `json:"exchange_ids,omitempty"` + // if a git repo is being created, a listing will be initialized with this + // field as opposed to a share + GitRepo *RepoInfo `json:"git_repo,omitempty"` + + ListingType ListingType `json:"listingType"` + + MetastoreId string `json:"metastore_id,omitempty"` + + Name string `json:"name"` + + ProviderId string `json:"provider_id,omitempty"` + + ProviderRegion *RegionInfo `json:"provider_region,omitempty"` + + PublishedAt int64 `json:"published_at,omitempty"` + + PublishedBy string `json:"published_by,omitempty"` + + Setting *ListingSetting `json:"setting,omitempty"` + + Share *ShareInfo `json:"share,omitempty"` + // Enums + Status ListingStatus `json:"status,omitempty"` + + Subtitle string `json:"subtitle,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + UpdatedBy string `json:"updated_by,omitempty"` + + UpdatedById int64 `json:"updated_by_id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListingSummary) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListingSummary) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListingTag struct { + // Tag name (enum) + TagName ListingTagType `json:"tag_name,omitempty"` + // String representation of the tag value. Values should be string literals + // (no complex types) + TagValues []string `json:"tag_values,omitempty"` +} + +type ListingTagType string + +const ListingTagTypeListingTagTypeLanguage ListingTagType = `LISTING_TAG_TYPE_LANGUAGE` + +const ListingTagTypeListingTagTypeTask ListingTagType = `LISTING_TAG_TYPE_TASK` + +const ListingTagTypeListingTagTypeUnspecified ListingTagType = `LISTING_TAG_TYPE_UNSPECIFIED` + +// String representation for [fmt.Print] +func (f *ListingTagType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ListingTagType) Set(v string) error { + switch v { + case `LISTING_TAG_TYPE_LANGUAGE`, `LISTING_TAG_TYPE_TASK`, `LISTING_TAG_TYPE_UNSPECIFIED`: + *f = ListingTagType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "LISTING_TAG_TYPE_LANGUAGE", "LISTING_TAG_TYPE_TASK", "LISTING_TAG_TYPE_UNSPECIFIED"`, v) + } +} + +// Type always returns ListingTagType to satisfy [pflag.Value] interface +func (f *ListingTagType) Type() string { + return "ListingTagType" +} + +type ListingType string + +const ListingTypePersonalized ListingType = `PERSONALIZED` + +const ListingTypeStandard ListingType = `STANDARD` + +// String representation for [fmt.Print] +func (f *ListingType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ListingType) Set(v string) error { + switch v { + case `PERSONALIZED`, `STANDARD`: + *f = ListingType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "PERSONALIZED", "STANDARD"`, v) + } +} + +// Type always returns ListingType to satisfy [pflag.Value] interface +func (f *ListingType) Type() string { + return "ListingType" +} + +type MarketplaceFileType string + +const MarketplaceFileTypeEmbeddedNotebook MarketplaceFileType = `EMBEDDED_NOTEBOOK` + +const MarketplaceFileTypeProviderIcon MarketplaceFileType = `PROVIDER_ICON` + +// String representation for [fmt.Print] +func (f *MarketplaceFileType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *MarketplaceFileType) Set(v string) error { + switch v { + case `EMBEDDED_NOTEBOOK`, `PROVIDER_ICON`: + *f = MarketplaceFileType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "EMBEDDED_NOTEBOOK", "PROVIDER_ICON"`, v) + } +} + +// Type always returns MarketplaceFileType to satisfy [pflag.Value] interface +func (f *MarketplaceFileType) Type() string { + return "MarketplaceFileType" +} + +type PersonalizationRequest struct { + Comment string `json:"comment,omitempty"` + + ConsumerRegion RegionInfo `json:"consumer_region"` + // contact info for the consumer requesting data or performing a listing + // installation + ContactInfo *ContactInfo `json:"contact_info,omitempty"` + + CreatedAt int64 `json:"created_at,omitempty"` + + Id string `json:"id,omitempty"` + + IntendedUse string `json:"intended_use,omitempty"` + + IsFromLighthouse bool `json:"is_from_lighthouse,omitempty"` + + ListingId string `json:"listing_id,omitempty"` + + ListingName string `json:"listing_name,omitempty"` + + MetastoreId string `json:"metastore_id,omitempty"` + + ProviderId string `json:"provider_id,omitempty"` + + RecipientType DeltaSharingRecipientType `json:"recipient_type,omitempty"` + + Share *ShareInfo `json:"share,omitempty"` + + Status PersonalizationRequestStatus `json:"status,omitempty"` + + StatusMessage string `json:"status_message,omitempty"` + + UpdatedAt int64 `json:"updated_at,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *PersonalizationRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s PersonalizationRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type PersonalizationRequestStatus string + +const PersonalizationRequestStatusDenied PersonalizationRequestStatus = `DENIED` + +const PersonalizationRequestStatusFulfilled PersonalizationRequestStatus = `FULFILLED` + +const PersonalizationRequestStatusNew PersonalizationRequestStatus = `NEW` + +const PersonalizationRequestStatusRequestPending PersonalizationRequestStatus = `REQUEST_PENDING` + +// String representation for [fmt.Print] +func (f *PersonalizationRequestStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *PersonalizationRequestStatus) Set(v string) error { + switch v { + case `DENIED`, `FULFILLED`, `NEW`, `REQUEST_PENDING`: + *f = PersonalizationRequestStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DENIED", "FULFILLED", "NEW", "REQUEST_PENDING"`, v) + } +} + +// Type always returns PersonalizationRequestStatus to satisfy [pflag.Value] interface +func (f *PersonalizationRequestStatus) Type() string { + return "PersonalizationRequestStatus" +} + +type ProviderAnalyticsDashboard struct { + Id string `json:"id"` +} + +type ProviderInfo struct { + BusinessContactEmail string `json:"business_contact_email"` + + CompanyWebsiteLink string `json:"company_website_link,omitempty"` + + DarkModeIconFileId string `json:"dark_mode_icon_file_id,omitempty"` + + DarkModeIconFilePath string `json:"dark_mode_icon_file_path,omitempty"` + + Description string `json:"description,omitempty"` + + IconFileId string `json:"icon_file_id,omitempty"` + + IconFilePath string `json:"icon_file_path,omitempty"` + + Id string `json:"id,omitempty"` + // is_featured is accessible by consumers only + IsFeatured bool `json:"is_featured,omitempty"` + + Name string `json:"name"` + + PrivacyPolicyLink string `json:"privacy_policy_link"` + // published_by is only applicable to data aggregators (e.g. Crux) + PublishedBy string `json:"published_by,omitempty"` + + SupportContactEmail string `json:"support_contact_email,omitempty"` + + TermOfServiceLink string `json:"term_of_service_link"` + + ForceSendFields []string `json:"-"` +} + +func (s *ProviderInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ProviderInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type RegionInfo struct { + Cloud string `json:"cloud,omitempty"` + + Region string `json:"region,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *RegionInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s RegionInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Remove an exchange for listing +type RemoveExchangeForListingRequest struct { + Id string `json:"-" url:"-"` +} + +type RemoveExchangeForListingResponse struct { +} + +type RepoInfo struct { + // the git repo url e.g. https://github.com/databrickslabs/dolly.git + GitRepoUrl string `json:"git_repo_url"` +} + +type RepoInstallation struct { + // the user-specified repo name for their installed git repo listing + RepoName string `json:"repo_name"` + // refers to the full url file path that navigates the user to the repo's + // entrypoint (e.g. a README.md file, or the repo file view in the unified + // UI) should just be a relative path + RepoPath string `json:"repo_path"` +} + +// Search listings +type SearchListingsRequest struct { + // Matches any of the following asset types + Assets []AssetType `json:"-" url:"assets,omitempty"` + // Matches any of the following categories + Categories []Category `json:"-" url:"categories,omitempty"` + + IsFree bool `json:"-" url:"is_free,omitempty"` + + IsPrivateExchange bool `json:"-" url:"is_private_exchange,omitempty"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + // Matches any of the following provider ids + ProviderIds []string `json:"-" url:"provider_ids,omitempty"` + // Fuzzy matches query + Query string `json:"-" url:"query"` + + SortBy SortBy `json:"-" url:"sort_by,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *SearchListingsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SearchListingsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type SearchListingsResponse struct { + Listings []Listing `json:"listings,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *SearchListingsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SearchListingsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ShareInfo struct { + Name string `json:"name"` + + Type ListingShareType `json:"type"` +} + +type SharedDataObject struct { + // The type of the data object. Could be one of: TABLE, SCHEMA, + // NOTEBOOK_FILE, MODEL, VOLUME + DataObjectType string `json:"data_object_type,omitempty"` + // Name of the shared object + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *SharedDataObject) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SharedDataObject) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type SortBy string + +const SortBySortByDate SortBy = `SORT_BY_DATE` + +const SortBySortByRelevance SortBy = `SORT_BY_RELEVANCE` + +const SortBySortByTitle SortBy = `SORT_BY_TITLE` + +const SortBySortByUnspecified SortBy = `SORT_BY_UNSPECIFIED` + +// String representation for [fmt.Print] +func (f *SortBy) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *SortBy) Set(v string) error { + switch v { + case `SORT_BY_DATE`, `SORT_BY_RELEVANCE`, `SORT_BY_TITLE`, `SORT_BY_UNSPECIFIED`: + *f = SortBy(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "SORT_BY_DATE", "SORT_BY_RELEVANCE", "SORT_BY_TITLE", "SORT_BY_UNSPECIFIED"`, v) + } +} + +// Type always returns SortBy to satisfy [pflag.Value] interface +func (f *SortBy) Type() string { + return "SortBy" +} + +type SortBySpec struct { + // The field on which to sort the listing. + SortBy SortBy `json:"sort_by" url:"sort_by"` + // The order in which to sort the listing. + SortOrder SortOrder `json:"sort_order" url:"sort_order"` +} + +type SortOrder string + +const SortOrderSortOrderAscending SortOrder = `SORT_ORDER_ASCENDING` + +const SortOrderSortOrderDescending SortOrder = `SORT_ORDER_DESCENDING` + +const SortOrderSortOrderUnspecified SortOrder = `SORT_ORDER_UNSPECIFIED` + +// String representation for [fmt.Print] +func (f *SortOrder) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *SortOrder) Set(v string) error { + switch v { + case `SORT_ORDER_ASCENDING`, `SORT_ORDER_DESCENDING`, `SORT_ORDER_UNSPECIFIED`: + *f = SortOrder(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "SORT_ORDER_ASCENDING", "SORT_ORDER_DESCENDING", "SORT_ORDER_UNSPECIFIED"`, v) + } +} + +// Type always returns SortOrder to satisfy [pflag.Value] interface +func (f *SortOrder) Type() string { + return "SortOrder" +} + +type TokenDetail struct { + BearerToken string `json:"bearerToken,omitempty"` + + Endpoint string `json:"endpoint,omitempty"` + + ExpirationTime string `json:"expirationTime,omitempty"` + // These field names must follow the delta sharing protocol. Original + // message: RetrieveToken.Response in + // managed-catalog/api/messages/recipient.proto + ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *TokenDetail) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s TokenDetail) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type TokenInfo struct { + // Full activation url to retrieve the access token. It will be empty if the + // token is already retrieved. + ActivationUrl string `json:"activation_url,omitempty"` + // Time at which this Recipient Token was created, in epoch milliseconds. + CreatedAt int64 `json:"created_at,omitempty"` + // Username of Recipient Token creator. + CreatedBy string `json:"created_by,omitempty"` + // Expiration timestamp of the token in epoch milliseconds. + ExpirationTime int64 `json:"expiration_time,omitempty"` + // Unique id of the Recipient Token. + Id string `json:"id,omitempty"` + // Time at which this Recipient Token was updated, in epoch milliseconds. + UpdatedAt int64 `json:"updated_at,omitempty"` + // Username of Recipient Token updater. + UpdatedBy string `json:"updated_by,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *TokenInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s TokenInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type UpdateExchangeFilterRequest struct { + Filter ExchangeFilter `json:"filter"` + + Id string `json:"-" url:"-"` +} + +type UpdateExchangeFilterResponse struct { + Filter *ExchangeFilter `json:"filter,omitempty"` +} + +type UpdateExchangeRequest struct { + Exchange Exchange `json:"exchange"` + + Id string `json:"-" url:"-"` +} + +type UpdateExchangeResponse struct { + Exchange *Exchange `json:"exchange,omitempty"` +} + +type UpdateInstallationRequest struct { + Installation InstallationDetail `json:"installation"` + + InstallationId string `json:"-" url:"-"` + + ListingId string `json:"-" url:"-"` + + RotateToken bool `json:"rotate_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *UpdateInstallationRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateInstallationRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type UpdateInstallationResponse struct { + Installation *InstallationDetail `json:"installation,omitempty"` +} + +type UpdateListingRequest struct { + Id string `json:"-" url:"-"` + + Listing Listing `json:"listing"` +} + +type UpdateListingResponse struct { + Listing *Listing `json:"listing,omitempty"` +} + +type UpdatePersonalizationRequestRequest struct { + ListingId string `json:"-" url:"-"` + + Reason string `json:"reason,omitempty"` + + RequestId string `json:"-" url:"-"` + + Share *ShareInfo `json:"share,omitempty"` + + Status PersonalizationRequestStatus `json:"status"` + + ForceSendFields []string `json:"-"` +} + +func (s *UpdatePersonalizationRequestRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdatePersonalizationRequestRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type UpdatePersonalizationRequestResponse struct { + Request *PersonalizationRequest `json:"request,omitempty"` +} + +type UpdateProviderAnalyticsDashboardRequest struct { + // id is immutable property and can't be updated. + Id string `json:"-" url:"-"` + // this is the version of the dashboard template we want to update our user + // to current expectation is that it should be equal to latest version of + // the dashboard template + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *UpdateProviderAnalyticsDashboardRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateProviderAnalyticsDashboardRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type UpdateProviderAnalyticsDashboardResponse struct { + // this is newly created Lakeview dashboard for the user + DashboardId string `json:"dashboard_id"` + // id & version should be the same as the request + Id string `json:"id"` + + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *UpdateProviderAnalyticsDashboardResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type UpdateProviderRequest struct { + Id string `json:"-" url:"-"` + + Provider ProviderInfo `json:"provider"` +} + +type UpdateProviderResponse struct { + Provider *ProviderInfo `json:"provider,omitempty"` +} + +type Visibility string + +const VisibilityPrivate Visibility = `PRIVATE` + +const VisibilityPublic Visibility = `PUBLIC` + +// String representation for [fmt.Print] +func (f *Visibility) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *Visibility) Set(v string) error { + switch v { + case `PRIVATE`, `PUBLIC`: + *f = Visibility(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "PRIVATE", "PUBLIC"`, v) + } +} + +// Type always returns Visibility to satisfy [pflag.Value] interface +func (f *Visibility) Type() string { + return "Visibility" +} + +type VisibilityFilter struct { + FilterType FilterType `json:"filterType,omitempty"` + + FilterValue string `json:"filterValue,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *VisibilityFilter) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s VisibilityFilter) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} diff --git a/service/pkg.go b/service/pkg.go index 3e727c6ae..becddcbf9 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -32,6 +32,16 @@ // // - [catalog.ConnectionsAPI]: Connections allow for creating a connection to an external data source. // +// - [marketplace.ConsumerFulfillmentsAPI]: Fulfillments are entities that allow consumers to preview installations. +// +// - [marketplace.ConsumerInstallationsAPI]: Installations are entities that allow consumers to interact with Databricks Marketplace listings. +// +// - [marketplace.ConsumerListingsAPI]: Listings are the core entities in the Marketplace. +// +// - [marketplace.ConsumerPersonalizationRequestsAPI]: Personalization Requests allow customers to interact with the individualized Marketplace listing flow. +// +// - [marketplace.ConsumerProvidersAPI]: Providers are the entities that publish listings to the Marketplace. +// // - [provisioning.CredentialsAPI]: These APIs manage credential configurations for this workspace. // // - [settings.CredentialsManagerAPI]: Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens. @@ -124,6 +134,20 @@ // // - [provisioning.PrivateAccessAPI]: These APIs manage private access settings for this account. // +// - [marketplace.ProviderExchangeFiltersAPI]: Marketplace exchanges filters curate which groups can access an exchange. +// +// - [marketplace.ProviderExchangesAPI]: Marketplace exchanges allow providers to share their listings with a curated set of customers. +// +// - [marketplace.ProviderFilesAPI]: Marketplace offers a set of file APIs for various purposes such as preview notebooks and provider icons. +// +// - [marketplace.ProviderListingsAPI]: Listings are the core entities in the Marketplace. +// +// - [marketplace.ProviderPersonalizationRequestsAPI]: Personalization requests are an alternate to instantly available listings. +// +// - [marketplace.ProviderProviderAnalyticsDashboardsAPI]: Manage templated analytics solution for providers. +// +// - [marketplace.ProviderProvidersAPI]: Providers are entities that manage assets in Marketplace. +// // - [sharing.ProvidersAPI]: A data provider is an object representing the organization in the real world who shares the data. // // - [oauth2.PublishedAppIntegrationAPI]: These APIs enable administrators to manage published oauth app integrations, which is required for adding/using Published OAuth App Integration like Tableau Desktop for Databricks in AWS cloud. @@ -213,6 +237,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/files" "github.com/databricks/databricks-sdk-go/service/iam" "github.com/databricks/databricks-sdk-go/service/jobs" + "github.com/databricks/databricks-sdk-go/service/marketplace" "github.com/databricks/databricks-sdk-go/service/ml" "github.com/databricks/databricks-sdk-go/service/oauth2" "github.com/databricks/databricks-sdk-go/service/pipelines" @@ -230,106 +255,118 @@ import ( // https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service // See: https://pkg.go.dev/golang.org/x/tools/internal/imports#ImportPathToAssumedName var ( - _ *iam.AccountAccessControlAPI = nil - _ *iam.AccountAccessControlProxyAPI = nil - _ *sql.AlertsAPI = nil - _ *serving.AppsAPI = nil - _ *catalog.ArtifactAllowlistsAPI = nil - _ *settings.AutomaticClusterUpdateAPI = nil - _ *billing.BillableUsageAPI = nil - _ *billing.BudgetsAPI = nil - _ *settings.CspEnablementAPI = nil - _ *settings.CspEnablementAccountAPI = nil - _ *catalog.CatalogsAPI = nil - _ *sharing.CleanRoomsAPI = nil - _ *compute.ClusterPoliciesAPI = nil - _ *compute.ClustersAPI = nil - _ *compute.CommandExecutionAPI = nil - _ *catalog.ConnectionsAPI = nil - _ *provisioning.CredentialsAPI = nil - _ *settings.CredentialsManagerAPI = nil - _ *iam.CurrentUserAPI = nil - _ *oauth2.CustomAppIntegrationAPI = nil - _ *sql.DashboardWidgetsAPI = nil - _ *sql.DashboardsAPI = nil - _ *sql.DataSourcesAPI = nil - _ *files.DbfsAPI = nil - _ *sql.DbsqlPermissionsAPI = nil - _ *settings.DefaultNamespaceAPI = nil - _ *settings.EsmEnablementAPI = nil - _ *settings.EsmEnablementAccountAPI = nil - _ *provisioning.EncryptionKeysAPI = nil - _ *ml.ExperimentsAPI = nil - _ *catalog.ExternalLocationsAPI = nil - _ *files.FilesAPI = nil - _ *catalog.FunctionsAPI = nil - _ *workspace.GitCredentialsAPI = nil - _ *compute.GlobalInitScriptsAPI = nil - _ *catalog.GrantsAPI = nil - _ *iam.GroupsAPI = nil - _ *iam.AccountGroupsAPI = nil - _ *compute.InstancePoolsAPI = nil - _ *compute.InstanceProfilesAPI = nil - _ *settings.IpAccessListsAPI = nil - _ *settings.AccountIpAccessListsAPI = nil - _ *jobs.JobsAPI = nil - _ *catalog.LakehouseMonitorsAPI = nil - _ *dashboards.LakeviewAPI = nil - _ *compute.LibrariesAPI = nil - _ *billing.LogDeliveryAPI = nil - _ *catalog.AccountMetastoreAssignmentsAPI = nil - _ *catalog.MetastoresAPI = nil - _ *catalog.AccountMetastoresAPI = nil - _ *ml.ModelRegistryAPI = nil - _ *catalog.ModelVersionsAPI = nil - _ *settings.NetworkConnectivityAPI = nil - _ *provisioning.NetworksAPI = nil - _ *oauth2.OAuthPublishedAppsAPI = nil - _ *catalog.OnlineTablesAPI = nil - _ *iam.PermissionMigrationAPI = nil - _ *iam.PermissionsAPI = nil - _ *settings.PersonalComputeAPI = nil - _ *pipelines.PipelinesAPI = nil - _ *compute.PolicyFamiliesAPI = nil - _ *provisioning.PrivateAccessAPI = nil - _ *sharing.ProvidersAPI = nil - _ *oauth2.PublishedAppIntegrationAPI = nil - _ *sql.QueriesAPI = nil - _ *sql.QueryHistoryAPI = nil - _ *sql.QueryVisualizationsAPI = nil - _ *sharing.RecipientActivationAPI = nil - _ *sharing.RecipientsAPI = nil - _ *catalog.RegisteredModelsAPI = nil - _ *workspace.ReposAPI = nil - _ *settings.RestrictWorkspaceAdminsAPI = nil - _ *catalog.SchemasAPI = nil - _ *workspace.SecretsAPI = nil - _ *oauth2.ServicePrincipalSecretsAPI = nil - _ *iam.ServicePrincipalsAPI = nil - _ *iam.AccountServicePrincipalsAPI = nil - _ *serving.ServingEndpointsAPI = nil - _ *settings.SettingsAPI = nil - _ *settings.AccountSettingsAPI = nil - _ *sharing.SharesAPI = nil - _ *sql.StatementExecutionAPI = nil - _ *provisioning.StorageAPI = nil - _ *catalog.StorageCredentialsAPI = nil - _ *catalog.AccountStorageCredentialsAPI = nil - _ *catalog.SystemSchemasAPI = nil - _ *catalog.TableConstraintsAPI = nil - _ *catalog.TablesAPI = nil - _ *settings.TokenManagementAPI = nil - _ *settings.TokensAPI = nil - _ *iam.UsersAPI = nil - _ *iam.AccountUsersAPI = nil - _ *vectorsearch.VectorSearchEndpointsAPI = nil - _ *vectorsearch.VectorSearchIndexesAPI = nil - _ *catalog.VolumesAPI = nil - _ *provisioning.VpcEndpointsAPI = nil - _ *sql.WarehousesAPI = nil - _ *workspace.WorkspaceAPI = nil - _ *iam.WorkspaceAssignmentAPI = nil - _ *catalog.WorkspaceBindingsAPI = nil - _ *settings.WorkspaceConfAPI = nil - _ *provisioning.WorkspacesAPI = nil + _ *iam.AccountAccessControlAPI = nil + _ *iam.AccountAccessControlProxyAPI = nil + _ *sql.AlertsAPI = nil + _ *serving.AppsAPI = nil + _ *catalog.ArtifactAllowlistsAPI = nil + _ *settings.AutomaticClusterUpdateAPI = nil + _ *billing.BillableUsageAPI = nil + _ *billing.BudgetsAPI = nil + _ *settings.CspEnablementAPI = nil + _ *settings.CspEnablementAccountAPI = nil + _ *catalog.CatalogsAPI = nil + _ *sharing.CleanRoomsAPI = nil + _ *compute.ClusterPoliciesAPI = nil + _ *compute.ClustersAPI = nil + _ *compute.CommandExecutionAPI = nil + _ *catalog.ConnectionsAPI = nil + _ *marketplace.ConsumerFulfillmentsAPI = nil + _ *marketplace.ConsumerInstallationsAPI = nil + _ *marketplace.ConsumerListingsAPI = nil + _ *marketplace.ConsumerPersonalizationRequestsAPI = nil + _ *marketplace.ConsumerProvidersAPI = nil + _ *provisioning.CredentialsAPI = nil + _ *settings.CredentialsManagerAPI = nil + _ *iam.CurrentUserAPI = nil + _ *oauth2.CustomAppIntegrationAPI = nil + _ *sql.DashboardWidgetsAPI = nil + _ *sql.DashboardsAPI = nil + _ *sql.DataSourcesAPI = nil + _ *files.DbfsAPI = nil + _ *sql.DbsqlPermissionsAPI = nil + _ *settings.DefaultNamespaceAPI = nil + _ *settings.EsmEnablementAPI = nil + _ *settings.EsmEnablementAccountAPI = nil + _ *provisioning.EncryptionKeysAPI = nil + _ *ml.ExperimentsAPI = nil + _ *catalog.ExternalLocationsAPI = nil + _ *files.FilesAPI = nil + _ *catalog.FunctionsAPI = nil + _ *workspace.GitCredentialsAPI = nil + _ *compute.GlobalInitScriptsAPI = nil + _ *catalog.GrantsAPI = nil + _ *iam.GroupsAPI = nil + _ *iam.AccountGroupsAPI = nil + _ *compute.InstancePoolsAPI = nil + _ *compute.InstanceProfilesAPI = nil + _ *settings.IpAccessListsAPI = nil + _ *settings.AccountIpAccessListsAPI = nil + _ *jobs.JobsAPI = nil + _ *catalog.LakehouseMonitorsAPI = nil + _ *dashboards.LakeviewAPI = nil + _ *compute.LibrariesAPI = nil + _ *billing.LogDeliveryAPI = nil + _ *catalog.AccountMetastoreAssignmentsAPI = nil + _ *catalog.MetastoresAPI = nil + _ *catalog.AccountMetastoresAPI = nil + _ *ml.ModelRegistryAPI = nil + _ *catalog.ModelVersionsAPI = nil + _ *settings.NetworkConnectivityAPI = nil + _ *provisioning.NetworksAPI = nil + _ *oauth2.OAuthPublishedAppsAPI = nil + _ *catalog.OnlineTablesAPI = nil + _ *iam.PermissionMigrationAPI = nil + _ *iam.PermissionsAPI = nil + _ *settings.PersonalComputeAPI = nil + _ *pipelines.PipelinesAPI = nil + _ *compute.PolicyFamiliesAPI = nil + _ *provisioning.PrivateAccessAPI = nil + _ *marketplace.ProviderExchangeFiltersAPI = nil + _ *marketplace.ProviderExchangesAPI = nil + _ *marketplace.ProviderFilesAPI = nil + _ *marketplace.ProviderListingsAPI = nil + _ *marketplace.ProviderPersonalizationRequestsAPI = nil + _ *marketplace.ProviderProviderAnalyticsDashboardsAPI = nil + _ *marketplace.ProviderProvidersAPI = nil + _ *sharing.ProvidersAPI = nil + _ *oauth2.PublishedAppIntegrationAPI = nil + _ *sql.QueriesAPI = nil + _ *sql.QueryHistoryAPI = nil + _ *sql.QueryVisualizationsAPI = nil + _ *sharing.RecipientActivationAPI = nil + _ *sharing.RecipientsAPI = nil + _ *catalog.RegisteredModelsAPI = nil + _ *workspace.ReposAPI = nil + _ *settings.RestrictWorkspaceAdminsAPI = nil + _ *catalog.SchemasAPI = nil + _ *workspace.SecretsAPI = nil + _ *oauth2.ServicePrincipalSecretsAPI = nil + _ *iam.ServicePrincipalsAPI = nil + _ *iam.AccountServicePrincipalsAPI = nil + _ *serving.ServingEndpointsAPI = nil + _ *settings.SettingsAPI = nil + _ *settings.AccountSettingsAPI = nil + _ *sharing.SharesAPI = nil + _ *sql.StatementExecutionAPI = nil + _ *provisioning.StorageAPI = nil + _ *catalog.StorageCredentialsAPI = nil + _ *catalog.AccountStorageCredentialsAPI = nil + _ *catalog.SystemSchemasAPI = nil + _ *catalog.TableConstraintsAPI = nil + _ *catalog.TablesAPI = nil + _ *settings.TokenManagementAPI = nil + _ *settings.TokensAPI = nil + _ *iam.UsersAPI = nil + _ *iam.AccountUsersAPI = nil + _ *vectorsearch.VectorSearchEndpointsAPI = nil + _ *vectorsearch.VectorSearchIndexesAPI = nil + _ *catalog.VolumesAPI = nil + _ *provisioning.VpcEndpointsAPI = nil + _ *sql.WarehousesAPI = nil + _ *workspace.WorkspaceAPI = nil + _ *iam.WorkspaceAssignmentAPI = nil + _ *catalog.WorkspaceBindingsAPI = nil + _ *settings.WorkspaceConfAPI = nil + _ *provisioning.WorkspacesAPI = nil ) diff --git a/version/version.go b/version/version.go index 4b2f02fea..17f5d2182 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // Version of the SDK, updated manually before every tag -const Version = "0.37.0" +const Version = "0.38.0" diff --git a/workspace_client.go b/workspace_client.go index 4ccb55b18..1411f0ba1 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -15,6 +15,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/files" "github.com/databricks/databricks-sdk-go/service/iam" "github.com/databricks/databricks-sdk-go/service/jobs" + "github.com/databricks/databricks-sdk-go/service/marketplace" "github.com/databricks/databricks-sdk-go/service/ml" "github.com/databricks/databricks-sdk-go/service/pipelines" "github.com/databricks/databricks-sdk-go/service/serving" @@ -143,6 +144,24 @@ type WorkspaceClient struct { // credential management and other settings. Connections catalog.ConnectionsInterface + // Fulfillments are entities that allow consumers to preview installations. + ConsumerFulfillments marketplace.ConsumerFulfillmentsInterface + + // Installations are entities that allow consumers to interact with + // Databricks Marketplace listings. + ConsumerInstallations marketplace.ConsumerInstallationsInterface + + // Listings are the core entities in the Marketplace. They represent the + // products that are available for consumption. + ConsumerListings marketplace.ConsumerListingsInterface + + // Personalization Requests allow customers to interact with the + // individualized Marketplace listing flow. + ConsumerPersonalizationRequests marketplace.ConsumerPersonalizationRequestsInterface + + // Providers are the entities that publish listings to the Marketplace. + ConsumerProviders marketplace.ConsumerProvidersInterface + // Credentials manager interacts with with Identity Providers to to perform // token exchanges using stored credentials and refresh tokens. CredentialsManager settings.CredentialsManagerInterface @@ -529,6 +548,31 @@ type WorkspaceClient struct { // using a policy family inherit the policy family's policy definition. PolicyFamilies compute.PolicyFamiliesInterface + // Marketplace exchanges filters curate which groups can access an exchange. + ProviderExchangeFilters marketplace.ProviderExchangeFiltersInterface + + // Marketplace exchanges allow providers to share their listings with a + // curated set of customers. + ProviderExchanges marketplace.ProviderExchangesInterface + + // Marketplace offers a set of file APIs for various purposes such as + // preview notebooks and provider icons. + ProviderFiles marketplace.ProviderFilesInterface + + // Listings are the core entities in the Marketplace. They represent the + // products that are available for consumption. + ProviderListings marketplace.ProviderListingsInterface + + // Personalization requests are an alternate to instantly available + // listings. Control the lifecycle of personalized solutions. + ProviderPersonalizationRequests marketplace.ProviderPersonalizationRequestsInterface + + // Manage templated analytics solution for providers. + ProviderProviderAnalyticsDashboards marketplace.ProviderProviderAnalyticsDashboardsInterface + + // Providers are entities that manage assets in Marketplace. + ProviderProviders marketplace.ProviderProvidersInterface + // A data provider is an object representing the organization in the real // world who shares the data. A provider contains shares which further // contain the shared data. @@ -962,74 +1006,86 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { Config: cfg, apiClient: apiClient, - AccountAccessControlProxy: iam.NewAccountAccessControlProxy(databricksClient), - Alerts: sql.NewAlerts(databricksClient), - Apps: serving.NewApps(databricksClient), - ArtifactAllowlists: catalog.NewArtifactAllowlists(databricksClient), - Catalogs: catalog.NewCatalogs(databricksClient), - CleanRooms: sharing.NewCleanRooms(databricksClient), - ClusterPolicies: compute.NewClusterPolicies(databricksClient), - Clusters: compute.NewClusters(databricksClient), - CommandExecution: compute.NewCommandExecution(databricksClient), - Connections: catalog.NewConnections(databricksClient), - CredentialsManager: settings.NewCredentialsManager(databricksClient), - CurrentUser: iam.NewCurrentUser(databricksClient), - DashboardWidgets: sql.NewDashboardWidgets(databricksClient), - Dashboards: sql.NewDashboards(databricksClient), - DataSources: sql.NewDataSources(databricksClient), - Dbfs: files.NewDbfs(databricksClient), - DbsqlPermissions: sql.NewDbsqlPermissions(databricksClient), - Experiments: ml.NewExperiments(databricksClient), - ExternalLocations: catalog.NewExternalLocations(databricksClient), - Files: files.NewFiles(databricksClient), - Functions: catalog.NewFunctions(databricksClient), - GitCredentials: workspace.NewGitCredentials(databricksClient), - GlobalInitScripts: compute.NewGlobalInitScripts(databricksClient), - Grants: catalog.NewGrants(databricksClient), - Groups: iam.NewGroups(databricksClient), - InstancePools: compute.NewInstancePools(databricksClient), - InstanceProfiles: compute.NewInstanceProfiles(databricksClient), - IpAccessLists: settings.NewIpAccessLists(databricksClient), - Jobs: jobs.NewJobs(databricksClient), - LakehouseMonitors: catalog.NewLakehouseMonitors(databricksClient), - Lakeview: dashboards.NewLakeview(databricksClient), - Libraries: compute.NewLibraries(databricksClient), - Metastores: catalog.NewMetastores(databricksClient), - ModelRegistry: ml.NewModelRegistry(databricksClient), - ModelVersions: catalog.NewModelVersions(databricksClient), - OnlineTables: catalog.NewOnlineTables(databricksClient), - PermissionMigration: iam.NewPermissionMigration(databricksClient), - Permissions: iam.NewPermissions(databricksClient), - Pipelines: pipelines.NewPipelines(databricksClient), - PolicyFamilies: compute.NewPolicyFamilies(databricksClient), - Providers: sharing.NewProviders(databricksClient), - Queries: sql.NewQueries(databricksClient), - QueryHistory: sql.NewQueryHistory(databricksClient), - QueryVisualizations: sql.NewQueryVisualizations(databricksClient), - RecipientActivation: sharing.NewRecipientActivation(databricksClient), - Recipients: sharing.NewRecipients(databricksClient), - RegisteredModels: catalog.NewRegisteredModels(databricksClient), - Repos: workspace.NewRepos(databricksClient), - Schemas: catalog.NewSchemas(databricksClient), - Secrets: workspace.NewSecrets(databricksClient), - ServicePrincipals: iam.NewServicePrincipals(databricksClient), - ServingEndpoints: serving.NewServingEndpoints(databricksClient), - Settings: settings.NewSettings(databricksClient), - Shares: sharing.NewShares(databricksClient), - StatementExecution: sql.NewStatementExecution(databricksClient), - StorageCredentials: catalog.NewStorageCredentials(databricksClient), - SystemSchemas: catalog.NewSystemSchemas(databricksClient), - TableConstraints: catalog.NewTableConstraints(databricksClient), - Tables: catalog.NewTables(databricksClient), - TokenManagement: settings.NewTokenManagement(databricksClient), - Tokens: settings.NewTokens(databricksClient), - Users: iam.NewUsers(databricksClient), - VectorSearchEndpoints: vectorsearch.NewVectorSearchEndpoints(databricksClient), - VectorSearchIndexes: vectorsearch.NewVectorSearchIndexes(databricksClient), - Volumes: catalog.NewVolumes(databricksClient), - Warehouses: sql.NewWarehouses(databricksClient), - Workspace: workspace.NewWorkspace(databricksClient), - WorkspaceBindings: catalog.NewWorkspaceBindings(databricksClient), - WorkspaceConf: settings.NewWorkspaceConf(databricksClient), + AccountAccessControlProxy: iam.NewAccountAccessControlProxy(databricksClient), + Alerts: sql.NewAlerts(databricksClient), + Apps: serving.NewApps(databricksClient), + ArtifactAllowlists: catalog.NewArtifactAllowlists(databricksClient), + Catalogs: catalog.NewCatalogs(databricksClient), + CleanRooms: sharing.NewCleanRooms(databricksClient), + ClusterPolicies: compute.NewClusterPolicies(databricksClient), + Clusters: compute.NewClusters(databricksClient), + CommandExecution: compute.NewCommandExecution(databricksClient), + Connections: catalog.NewConnections(databricksClient), + ConsumerFulfillments: marketplace.NewConsumerFulfillments(databricksClient), + ConsumerInstallations: marketplace.NewConsumerInstallations(databricksClient), + ConsumerListings: marketplace.NewConsumerListings(databricksClient), + ConsumerPersonalizationRequests: marketplace.NewConsumerPersonalizationRequests(databricksClient), + ConsumerProviders: marketplace.NewConsumerProviders(databricksClient), + CredentialsManager: settings.NewCredentialsManager(databricksClient), + CurrentUser: iam.NewCurrentUser(databricksClient), + DashboardWidgets: sql.NewDashboardWidgets(databricksClient), + Dashboards: sql.NewDashboards(databricksClient), + DataSources: sql.NewDataSources(databricksClient), + Dbfs: files.NewDbfs(databricksClient), + DbsqlPermissions: sql.NewDbsqlPermissions(databricksClient), + Experiments: ml.NewExperiments(databricksClient), + ExternalLocations: catalog.NewExternalLocations(databricksClient), + Files: files.NewFiles(databricksClient), + Functions: catalog.NewFunctions(databricksClient), + GitCredentials: workspace.NewGitCredentials(databricksClient), + GlobalInitScripts: compute.NewGlobalInitScripts(databricksClient), + Grants: catalog.NewGrants(databricksClient), + Groups: iam.NewGroups(databricksClient), + InstancePools: compute.NewInstancePools(databricksClient), + InstanceProfiles: compute.NewInstanceProfiles(databricksClient), + IpAccessLists: settings.NewIpAccessLists(databricksClient), + Jobs: jobs.NewJobs(databricksClient), + LakehouseMonitors: catalog.NewLakehouseMonitors(databricksClient), + Lakeview: dashboards.NewLakeview(databricksClient), + Libraries: compute.NewLibraries(databricksClient), + Metastores: catalog.NewMetastores(databricksClient), + ModelRegistry: ml.NewModelRegistry(databricksClient), + ModelVersions: catalog.NewModelVersions(databricksClient), + OnlineTables: catalog.NewOnlineTables(databricksClient), + PermissionMigration: iam.NewPermissionMigration(databricksClient), + Permissions: iam.NewPermissions(databricksClient), + Pipelines: pipelines.NewPipelines(databricksClient), + PolicyFamilies: compute.NewPolicyFamilies(databricksClient), + ProviderExchangeFilters: marketplace.NewProviderExchangeFilters(databricksClient), + ProviderExchanges: marketplace.NewProviderExchanges(databricksClient), + ProviderFiles: marketplace.NewProviderFiles(databricksClient), + ProviderListings: marketplace.NewProviderListings(databricksClient), + ProviderPersonalizationRequests: marketplace.NewProviderPersonalizationRequests(databricksClient), + ProviderProviderAnalyticsDashboards: marketplace.NewProviderProviderAnalyticsDashboards(databricksClient), + ProviderProviders: marketplace.NewProviderProviders(databricksClient), + Providers: sharing.NewProviders(databricksClient), + Queries: sql.NewQueries(databricksClient), + QueryHistory: sql.NewQueryHistory(databricksClient), + QueryVisualizations: sql.NewQueryVisualizations(databricksClient), + RecipientActivation: sharing.NewRecipientActivation(databricksClient), + Recipients: sharing.NewRecipients(databricksClient), + RegisteredModels: catalog.NewRegisteredModels(databricksClient), + Repos: workspace.NewRepos(databricksClient), + Schemas: catalog.NewSchemas(databricksClient), + Secrets: workspace.NewSecrets(databricksClient), + ServicePrincipals: iam.NewServicePrincipals(databricksClient), + ServingEndpoints: serving.NewServingEndpoints(databricksClient), + Settings: settings.NewSettings(databricksClient), + Shares: sharing.NewShares(databricksClient), + StatementExecution: sql.NewStatementExecution(databricksClient), + StorageCredentials: catalog.NewStorageCredentials(databricksClient), + SystemSchemas: catalog.NewSystemSchemas(databricksClient), + TableConstraints: catalog.NewTableConstraints(databricksClient), + Tables: catalog.NewTables(databricksClient), + TokenManagement: settings.NewTokenManagement(databricksClient), + Tokens: settings.NewTokens(databricksClient), + Users: iam.NewUsers(databricksClient), + VectorSearchEndpoints: vectorsearch.NewVectorSearchEndpoints(databricksClient), + VectorSearchIndexes: vectorsearch.NewVectorSearchIndexes(databricksClient), + Volumes: catalog.NewVolumes(databricksClient), + Warehouses: sql.NewWarehouses(databricksClient), + Workspace: workspace.NewWorkspace(databricksClient), + WorkspaceBindings: catalog.NewWorkspaceBindings(databricksClient), + WorkspaceConf: settings.NewWorkspaceConf(databricksClient), }, nil }