Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
76 changes: 76 additions & 0 deletions specification/eventgrid/EventGrid.Management/CaCertificate.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Namespace.tsp";

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

namespace Microsoft.EventGrid;
/**
* The CA Certificate resource.
*/
@parentResource(Namespace)
model CaCertificate
is Azure.ResourceManager.ProxyResource<CaCertificateProperties> {
...ResourceNameParameter<
Resource = CaCertificate,
KeyName = "caCertificateName",
SegmentName = "caCertificates",
NamePattern = "^[a-zA-Z0-9-]*$"
>;
}

@armResourceOperations
interface CaCertificates {
/**
* Get properties of a CA certificate.
*/
get is ArmResourceRead<CaCertificate>;

/**
* Create or update a CA certificate with the specified parameters.
*/
createOrUpdate is ArmResourceCreateOrReplaceAsync<CaCertificate>;

/**
* Delete an existing CA certificate.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
delete is ArmResourceDeleteWithoutOkAsync<
CaCertificate,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
>;

/**
* Get all the CA certificates under a namespace.
*/
listByNamespace is ArmResourceListByParent<
CaCertificate,
Parameters = {
/**
* The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
*/
@query("$filter")
$filter?: string;

/**
* The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
*/
@query("$top")
$top?: int32;
}
>;
}

@@maxLength(CaCertificate.name, 50);
@@minLength(CaCertificate.name, 3);
@@doc(CaCertificate.name, "Name of the CA certificate.");
@@doc(CaCertificate.properties, "The properties of CA certificate.");
@@doc(CaCertificates.createOrUpdate::parameters.resource,
"CA certificate information."
);
91 changes: 91 additions & 0 deletions specification/eventgrid/EventGrid.Management/Channel.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./PartnerNamespace.tsp";

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

namespace Microsoft.EventGrid;
/**
* Channel info.
*/
@parentResource(PartnerNamespace)
model Channel is Azure.ResourceManager.ProxyResource<ChannelProperties> {
...ResourceNameParameter<
Resource = Channel,
KeyName = "channelName",
SegmentName = "channels",
NamePattern = ""
>;
}

@armResourceOperations
interface Channels {
/**
* Get properties of a channel.
*/
get is ArmResourceRead<Channel>;

/**
* Synchronously creates or updates a new channel with the specified parameters.
*/
createOrUpdate is ArmResourceCreateOrReplaceSync<Channel>;

/**
* Synchronously updates a channel with the specified parameters.
*/
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchSync<
Channel,
PatchModel = ChannelUpdateParameters,
Response = OkResponse
>;

/**
* Delete an existing channel.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
delete is ArmResourceDeleteWithoutOkAsync<
Channel,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
>;

/**
* List all the channels in a partner namespace.
*/
listByPartnerNamespace is ArmResourceListByParent<
Channel,
Parameters = {
/**
* The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
*/
@query("$filter")
$filter?: string;

/**
* The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
*/
@query("$top")
$top?: int32;
}
>;

/**
* Get the full endpoint URL of a partner destination channel.
*/
getFullUrl is ArmResourceActionSync<
Channel,
void,
ArmResponse<EventSubscriptionFullUrl>
>;
}

@@doc(Channel.name, "Name of the channel.");
@@doc(Channel.properties, "Properties of the Channel.");
@@doc(Channels.createOrUpdate::parameters.resource, "Channel information.");
@@doc(Channels.update::parameters.properties, "Channel update information.");
73 changes: 73 additions & 0 deletions specification/eventgrid/EventGrid.Management/Client.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Namespace.tsp";

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

namespace Microsoft.EventGrid;
/**
* The Client resource.
*/
@parentResource(Namespace)
model Client is Azure.ResourceManager.ProxyResource<ClientProperties> {
...ResourceNameParameter<
Resource = Client,
KeyName = "clientName",
SegmentName = "clients",
NamePattern = "^[-a-zA-Z0-9:\\._]*$"
>;
}

@armResourceOperations
interface Clients {
/**
* Get properties of a client.
*/
get is ArmResourceRead<Client>;

/**
* Create or update a client with the specified parameters.
*/
createOrUpdate is ArmResourceCreateOrReplaceAsync<Client>;

/**
* Delete an existing client.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
delete is ArmResourceDeleteWithoutOkAsync<
Client,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
>;

/**
* Get all the permission bindings under a namespace.
*/
listByNamespace is ArmResourceListByParent<
Client,
Parameters = {
/**
* The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
*/
@query("$filter")
$filter?: string;

/**
* The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
*/
@query("$top")
$top?: int32;
}
>;
}

@@maxLength(Client.name, 128);
@@minLength(Client.name, 1);
@@doc(Client.name, "Name of the client.");
@@doc(Client.properties, "The properties of client.");
@@doc(Clients.createOrUpdate::parameters.resource, "Client information.");
76 changes: 76 additions & 0 deletions specification/eventgrid/EventGrid.Management/ClientGroup.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Namespace.tsp";

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

namespace Microsoft.EventGrid;
/**
* The Client group resource.
*/
@parentResource(Namespace)
model ClientGroup
is Azure.ResourceManager.ProxyResource<ClientGroupProperties> {
...ResourceNameParameter<
Resource = ClientGroup,
KeyName = "clientGroupName",
SegmentName = "clientGroups",
NamePattern = "^[a-zA-Z0-9-]*$"
>;
}

@armResourceOperations
interface ClientGroups {
/**
* Get properties of a client group.
*/
get is ArmResourceRead<ClientGroup>;

/**
* Create or update a client group with the specified parameters.
*/
createOrUpdate is ArmResourceCreateOrReplaceAsync<ClientGroup>;

/**
* Delete an existing client group.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
delete is ArmResourceDeleteWithoutOkAsync<
ClientGroup,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
>;

/**
* Get all the client groups under a namespace.
*/
listByNamespace is ArmResourceListByParent<
ClientGroup,
Parameters = {
/**
* The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
*/
@query("$filter")
$filter?: string;

/**
* The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
*/
@query("$top")
$top?: int32;
}
>;
}

@@maxLength(ClientGroup.name, 50);
@@minLength(ClientGroup.name, 3);
@@doc(ClientGroup.name, "Name of the client group.");
@@doc(ClientGroup.properties, "The properties of client group.");
@@doc(ClientGroups.createOrUpdate::parameters.resource,
"Client group information."
);
Loading