Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.Purview;
/**
* Account resource
*/
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
model Account
is Azure.ResourceManager.Legacy.TrackedResourceWithOptionalLocation<AccountProperties> {
...ResourceNameParameter<
Resource = Account,
KeyName = "accountName",
SegmentName = "accounts",
NamePattern = "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"
>;

/**
* The Managed Identity of the resource
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
identity?: Identity;

/**
* Gets or sets the Sku.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
sku?: AccountSku;
}

@armResourceOperations
interface Accounts {
/**
* Get an account
*/
@summary("Gets the account resource.")
get is ArmResourceRead<Account, Error = ErrorResponseModel>;

/**
* Creates or updates an account
*/
@summary("Create or update an account resource.")
createOrUpdate is ArmResourceCreateOrReplaceAsync<
Account,
LroHeaders = ArmLroLocationHeader<FinalResult = Account> &
Azure.Core.Foundations.RetryAfterHeader,
Error = ErrorResponseModel
>;

/**
* Updates an account
*/
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@summary("Patches the account resource.")
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchAsync<
Account,
PatchModel = AccountUpdateParameters,
Response = ArmResponse<Account> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Account> &
Azure.Core.Foundations.RetryAfterHeader> & {
@bodyRoot
_: Account;
}),
Error = ErrorResponseModel
>;

/**
* Deletes an account resource
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@summary("Deletes the account resource.")
delete is ArmResourceDeleteWithoutOkAsync<
Account,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse,
Error = ErrorResponseModel
>;

/**
* List accounts in ResourceGroup
*/
@summary("Gets the accounts resources by resource group.")
listByResourceGroup is ArmResourceListByParent<
Account,
Parameters = {
/**
* The skip token.
*/
@query("$skipToken")
$skipToken?: string;
},
Response = ArmResponse<AccountList>,
Error = ErrorResponseModel
>;

/**
* List accounts in Subscription
*/
@summary("Gets the accounts resources by subscription.")
listBySubscription is ArmListBySubscription<
Account,
Parameters = {
/**
* The skip token.
*/
@query("$skipToken")
$skipToken?: string;
},
Response = ArmResponse<AccountList>,
Error = ErrorResponseModel
>;

/**
* Add the administrator for root collection associated with this account.
*/
@summary("Add the administrator for root collection.")
addRootCollectionAdmin is ArmResourceActionSync<
Account,
CollectionAdminUpdate,
OkResponse,
Error = ErrorResponseModel
>;

/**
* List the authorization keys associated with this account.
*/
@summary("Lists the keys asynchronous.")
@action("listkeys")
listKeys is ArmResourceActionSync<
Account,
void,
ArmResponse<AccessKeys>,
Error = ErrorResponseModel
>;

/**
* Gets details from a list of feature names.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@summary("Gets a list of features and their status for the account.\r\nStatus of enabled features will be true. Status of disabled features will be false.\r\nFeatures that don't exist will be excluded from the results.")
@operationId("Features_AccountGet")
@action("listFeatures")
accountGet is ArmResourceActionSync<
Account,
BatchFeatureRequest,
ArmResponse<BatchFeatureStatus>,
Error = ErrorResponseModel
>;

/**
* Lists all ingestion private endpoint connections
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@summary("Lists all ingestion private endpoint connections.")
@operationId("IngestionPrivateEndpointConnections_List")
@list
@get
@action("ingestionPrivateEndpointConnections")
list is ArmResourceActionSync<
Account,
void,
ArmResponse<PrivateEndpointConnectionList>,
Error = ErrorResponseModel
>;

/**
* Update ingestion private endpoint connection status
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@summary("Updates ingestion private endpoint connection status.")
@operationId("IngestionPrivateEndpointConnections_UpdateStatus")
@action("ingestionPrivateEndpointConnectionStatus")
updateStatus is ArmResourceActionSync<
Account,
PrivateEndpointConnectionStatusUpdateRequest,
ArmResponse<PrivateEndpointConnectionStatusUpdateResponse>,
Error = ErrorResponseModel
>;
}

@@maxLength(Account.name, 63);
@@minLength(Account.name, 3);
@@doc(Account.name, "The name of the account.");
@@doc(Account.properties, "The account properties");
@@doc(Accounts.createOrUpdate::parameters.resource, "The account.");
@@doc(Accounts.update::parameters.properties, "The account update parameters.");
@@doc(Accounts.addRootCollectionAdmin::parameters.body,
"The collection admin update payload."
);
@@doc(Accounts.accountGet::parameters.body, "Request body with feature names.");
@@doc(Accounts.updateStatus::parameters.body,
"The ingestion private endpoint connection status update request."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Account.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.Purview;
/**
* The configuration of the event streaming service resource attached to the Purview account for kafka notifications.
*/
@parentResource(Account)
model KafkaConfiguration
is Azure.ResourceManager.ProxyResource<KafkaConfigurationProperties> {
...ResourceNameParameter<
Resource = KafkaConfiguration,
KeyName = "kafkaConfigurationName",
SegmentName = "kafkaConfigurations",
NamePattern = "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"
>;
}

@armResourceOperations
interface KafkaConfigurations {
/**
* Gets the kafka configuration for the account
*/
@summary("Gets the kafka configuration.")
get is ArmResourceRead<KafkaConfiguration, Error = ErrorResponseModel>;

/**
* Create or update Kafka Configuration
*/
@summary("Create or update the kafka configuration.")
createOrUpdate is ArmResourceCreateOrReplaceSync<
KafkaConfiguration,
Error = ErrorResponseModel
>;

/**
* Deletes a KafkaConfiguration resource.
*/
@summary("Deletes the kafka configuration on the account.")
delete is ArmResourceDeleteSync<
KafkaConfiguration,
Error = ErrorResponseModel
>;

/**
* Lists the Kafka configurations in the Account
*/
@summary("Gets the list of Kafka configurations for the account.")
listByAccount is ArmResourceListByParent<
KafkaConfiguration,
Parameters = {
/**
* The skip token.
*/
@query("$skipToken")
$skipToken?: string;
},
Response = ArmResponse<KafkaConfigurationList>,
Error = ErrorResponseModel
>;
}

@@maxLength(KafkaConfiguration.name, 63);
@@minLength(KafkaConfiguration.name, 3);
@@doc(KafkaConfiguration.name, "Name of kafka configuration.");
@@doc(KafkaConfiguration.properties,
"The kafka configuration properties of the event streaming service attached to the Purview account for kafka notifications."
);
@@doc(KafkaConfigurations.createOrUpdate::parameters.resource,
"The kafka configuration of the account."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Account.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.Purview;
/**
* A private endpoint connection class.
*/
@parentResource(Account)
model PrivateEndpointConnection
is Azure.ResourceManager.ProxyResource<PrivateEndpointConnectionProperties> {
...ResourceNameParameter<
Resource = PrivateEndpointConnection,
KeyName = "privateEndpointConnectionName",
SegmentName = "privateEndpointConnections",
NamePattern = ""
>;
}

@armResourceOperations
interface PrivateEndpointConnections {
/**
* Get a private endpoint connection
*/
@summary("Gets private endpoint connection information.")
get is ArmResourceRead<PrivateEndpointConnection, Error = ErrorResponseModel>;

/**
* Create or update a private endpoint connection
*/
@summary("Approves/Rejects private endpoint connection request.")
createOrUpdate is ArmResourceCreateOrReplaceAsync<
PrivateEndpointConnection,
LroHeaders = ArmLroLocationHeader<FinalResult = PrivateEndpointConnection> &
Azure.Core.Foundations.RetryAfterHeader,
Error = ErrorResponseModel
>;

/**
* Delete a private endpoint connection
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@summary("Deletes private endpoint connection.")
delete is ArmResourceDeleteWithoutOkAsync<
PrivateEndpointConnection,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse,
Error = ErrorResponseModel
>;

/**
* Get private endpoint connections for account
*/
@summary("Gets private endpoint connections.")
listByAccount is ArmResourceListByParent<
PrivateEndpointConnection,
Parameters = {
/**
* The skip token.
*/
@query("$skipToken")
$skipToken?: string;
},
Response = ArmResponse<PrivateEndpointConnectionList>,
Error = ErrorResponseModel
>;
}

@@doc(PrivateEndpointConnection.name,
"Name of the private endpoint connection."
);
@@doc(PrivateEndpointConnection.properties, "The connection identifier.");
@@doc(PrivateEndpointConnections.createOrUpdate::parameters.resource,
"The request."
);
Loading
Loading