Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions specification/botservice/BotService.Management/Bot.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
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.BotService;
/**
* Bot resource definition
*/
model Bot is Azure.ResourceManager.TrackedResource<BotProperties> {
...ResourceNameParameter<
Resource = Bot,
KeyName = "resourceName",
SegmentName = "botServices",
NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
>;

/**
* Gets or sets the SKU 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"
sku?: Sku;

/**
* Required. Gets or sets the Kind 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"
kind?: Kind;

/**
* Entity Tag.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
etag?: string;

/**
* Entity zones
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@visibility(Lifecycle.Read)
zones?: string[];
}

@armResourceOperations
interface Bots {
/**
* Returns a BotService specified by the parameters.
*/
get is ArmResourceRead<Bot, Error = Error>;

/**
* Creates a Bot Service. Bot Service is a resource group wide resource type.
*/
create is ArmResourceCreateOrReplaceSync<Bot, Error = Error>;

/**
* Updates a Bot Service
*/
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchSync<
Bot,
PatchModel = Bot,
Response = ArmResponse<Bot> | ArmResourceCreatedSyncResponse<Bot>,
Error = Error
>;

/**
* Deletes a Bot Service from the resource group.
*/
delete is ArmResourceDeleteSync<Bot, Error = Error>;

/**
* Returns all the resources of a particular type belonging to a resource group
*/
listByResourceGroup is ArmResourceListByParent<
Bot,
Response = ArmResponse<BotResponseList>,
Error = Error
>;

/**
* Returns all the resources of a particular type belonging to a subscription.
*/
list is ArmListBySubscription<
Bot,
Response = ArmResponse<BotResponseList>,
Error = Error
>;

/**
* Creates an email channel sign in url for a Bot Service
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@action("createEmailSignInUrl")
createSignInUrl is ArmResourceActionSync<
Bot,
void,
ArmResponse<CreateEmailSignInUrlResponse>,
Error = Error
>;

/**
* Gets the private link resources that need to be created for a Bot.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@get
@action("privateLinkResources")
listByBotResource is ArmResourceActionSync<
Bot,
void,
ArmResponse<PrivateLinkResourceListResult>,
Error = Error
>;
}

@@maxLength(Bot.name, 64);
@@minLength(Bot.name, 2);
@@doc(Bot.name, "The name of the Bot resource.");
@@doc(Bot.properties, "The set of properties specific to bot resource");
@@doc(Bots.create::parameters.resource,
"The parameters to provide for the created bot."
);
@@doc(Bots.update::parameters.properties,
"The parameters to provide for the created bot."
);
133 changes: 133 additions & 0 deletions specification/botservice/BotService.Management/BotChannel.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Bot.tsp";

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

namespace Microsoft.BotService;
/**
* Bot channel resource definition
*/
@parentResource(Bot)
model BotChannel is Azure.ResourceManager.TrackedResource<Channel> {
...ResourceNameParameter<
Resource = BotChannel,
KeyName = "channelName",
SegmentName = "channels",
NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
>;

/**
* Gets or sets the SKU 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"
sku?: Sku;

/**
* Required. Gets or sets the Kind 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"
kind?: Kind;

/**
* Entity Tag.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
etag?: string;

/**
* Entity zones
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@visibility(Lifecycle.Read)
zones?: string[];
}

@armResourceOperations
interface BotChannels {
/**
* Returns a BotService Channel registration specified by the parameters.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
get is ArmResourceRead<BotChannel, Error = Error>;

/**
* Creates a Channel registration for a Bot Service
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
create is ArmResourceCreateOrReplaceSync<BotChannel, Error = Error>;

/**
* Updates a Channel registration for a Bot Service
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchSync<
BotChannel,
PatchModel = BotChannel,
Response = ArmResponse<BotChannel> | ArmResourceCreatedSyncResponse<BotChannel>,
Error = Error
>;

/**
* Deletes a Channel registration from a Bot Service
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
delete is ArmResourceDeleteSync<BotChannel, Error = Error>;

/**
* Returns all the Channel registrations of a particular BotService resource
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
listByResourceGroup is ArmResourceListByParent<
BotChannel,
Response = ArmResponse<ChannelResponseList>,
Error = Error
>;

/**
* Lists a Channel registration for a Bot Service including secrets
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@action("listChannelWithKeys")
listWithKeys is ArmResourceActionSync<
BotChannel,
void,
ArmResponse<ListChannelWithKeysResponse>,
Error = Error
>;

/**
* Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@action("regeneratekeys")
regenerateKeys is ArmResourceActionSync<
BotChannel,
SiteInfo,
ArmResponse<BotChannel>,
Error = Error
>;
}

@@maxLength(BotChannel.name, 64);
@@minLength(BotChannel.name, 2);
@@doc(BotChannel.name, "The name of the Bot resource.");
@@doc(BotChannel.properties,
"The set of properties specific to bot channel resource"
);
@@doc(BotChannels.create::parameters.resource,
"The parameters to provide for the created bot."
);
@@doc(BotChannels.update::parameters.properties,
"The parameters to provide for the created bot."
);
@@doc(BotChannels.regenerateKeys::parameters.body,
"The parameters to provide for the created bot."
);
133 changes: 133 additions & 0 deletions specification/botservice/BotService.Management/ConnectionSetting.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Bot.tsp";

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

namespace Microsoft.BotService;
/**
* Bot channel resource definition
*/
@parentResource(Bot)
model ConnectionSetting
is Azure.ResourceManager.ProxyResource<ConnectionSettingProperties> {
...ResourceNameParameter<
Resource = ConnectionSetting,
KeyName = "connectionName",
SegmentName = "connections",
NamePattern = "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$"
>;

/**
* Specifies the location 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"
location?: string;

/**
* Contains resource tags defined as key/value pairs.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
tags?: Record<string>;

/**
* Gets or sets the SKU 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"
sku?: Sku;

/**
* Required. Gets or sets the Kind 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"
kind?: Kind;

/**
* Entity Tag.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
etag?: string;

/**
* Entity zones
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@visibility(Lifecycle.Read)
zones?: string[];
}

@armResourceOperations
interface ConnectionSettings {
/**
* Get a Connection Setting registration for a Bot Service
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
get is ArmResourceRead<ConnectionSetting, Error = Error>;

/**
* Register a new Auth Connection for a Bot Service
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
create is ArmResourceCreateOrReplaceSync<ConnectionSetting, Error = Error>;

/**
* Updates a Connection Setting registration for a Bot Service
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchSync<
ConnectionSetting,
PatchModel = ConnectionSetting,
Response = ArmResponse<ConnectionSetting> | ArmResourceCreatedSyncResponse<ConnectionSetting>,
Error = Error
>;

/**
* Deletes a Connection Setting registration for a Bot Service
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
delete is ArmResourceDeleteSync<ConnectionSetting, Error = Error>;

/**
* Returns all the Connection Settings registered to a particular BotService resource
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
listByBotService is ArmResourceListByParent<
ConnectionSetting,
Response = ArmResponse<ConnectionSettingResponseList>,
Error = Error
>;

/**
* Get a Connection Setting registration for a Bot Service
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
listWithSecrets is ArmResourceActionSync<
ConnectionSetting,
void,
ArmResponse<ConnectionSetting>,
Error = Error
>;
}

@@maxLength(ConnectionSetting.name, 64);
@@minLength(ConnectionSetting.name, 2);
@@doc(ConnectionSetting.name,
"The name of the Bot Service Connection Setting resource."
);
@@doc(ConnectionSetting.properties,
"The set of properties specific to bot channel resource"
);
@@doc(ConnectionSettings.create::parameters.resource,
"The parameters to provide for creating the Connection Setting."
);
@@doc(ConnectionSettings.update::parameters.properties,
"The parameters to provide for updating the Connection Setting."
);
Loading
Loading