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

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

namespace Microsoft.ProviderHub;

@parentResource(ProviderRegistration)
model AuthorizedApplication
is Azure.ResourceManager.ProxyResource<AuthorizedApplicationProperties> {
...ResourceNameParameter<
Resource = AuthorizedApplication,
KeyName = "applicationId",
SegmentName = "authorizedApplications",
NamePattern = ""
>;
}

@armResourceOperations
interface AuthorizedApplications {
/**
* Gets the authorized application details.
*/
get is ArmResourceRead<AuthorizedApplication>;

/**
* Creates or updates the authorized application.
*/
createOrUpdate is ArmResourceCreateOrReplaceAsync<AuthorizedApplication>;

/**
* Deletes an authorized application.
*/
delete is ArmResourceDeleteSync<AuthorizedApplication>;

/**
* Gets the list of the authorized applications in the provider namespace.
*/
list is ArmResourceListByParent<
AuthorizedApplication,
Response = ArmResponse<AuthorizedApplicationArrayResponseWithContinuation>
>;
}

#suppress "@azure-tools/typespec-azure-core/no-format" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@@format(AuthorizedApplication.name, "uuid");
@@doc(AuthorizedApplication.name, "The application ID.");
@@doc(AuthorizedApplication.properties, "");
@@doc(AuthorizedApplications.createOrUpdate::parameters.resource,
"The authorized application properties supplied to the CreateOrUpdate operation."
);
62 changes: 62 additions & 0 deletions specification/providerhub/ProviderHub.Management/CustomRollout.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./ProviderRegistration.tsp";

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

namespace Microsoft.ProviderHub;

@parentResource(ProviderRegistration)
model CustomRollout
is Azure.ResourceManager.ProxyResource<CustomRolloutProperties, false> {
...ResourceNameParameter<
Resource = CustomRollout,
KeyName = "rolloutName",
SegmentName = "customRollouts",
NamePattern = "^[-\\w\\._\\(\\)]+$"
>;
}

@armResourceOperations
interface CustomRollouts {
/**
* Gets the custom rollout details.
*/
get is ArmResourceRead<CustomRollout>;

/**
* Creates or updates the rollout details.
*/
createOrUpdate is ArmResourceCreateOrReplaceAsync<CustomRollout>;

/**
* Deletes the custom rollout resource. Custom rollout must be in terminal state.
*/
delete is ArmResourceDeleteSync<CustomRollout>;

/**
* Gets the list of the custom rollouts for the given provider.
*/
listByProviderRegistration is ArmResourceListByParent<
CustomRollout,
Response = ArmResponse<CustomRolloutArrayResponseWithContinuation>
>;

/**
* Stops or cancels the custom rollout, if in progress.
*/
stop is ArmResourceActionSync<CustomRollout, void, OkResponse>;
}

@@maxLength(CustomRollout.name, 260);
@@doc(CustomRollout.name, "The rollout name.");
@@doc(CustomRollout.properties, "Properties of the rollout.");
@@doc(CustomRollouts.createOrUpdate::parameters.resource,
"The custom rollout properties supplied to the CreateOrUpdate operation."
);
142 changes: 142 additions & 0 deletions specification/providerhub/ProviderHub.Management/DefaultRollout.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./ProviderRegistration.tsp";

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

namespace Microsoft.ProviderHub;

@parentResource(ProviderRegistration)
model DefaultRollout
is Azure.ResourceManager.ProxyResource<DefaultRolloutProperties> {
...ResourceNameParameter<
Resource = DefaultRollout,
KeyName = "rolloutName",
SegmentName = "defaultRollouts",
NamePattern = "^[-\\w\\._\\(\\)]+$"
>;
}

@armResourceOperations
interface DefaultRolloutOps
extends Azure.ResourceManager.Legacy.ExtensionOperations<
{
...ApiVersionParameter,
...SubscriptionIdParameter,
...Azure.ResourceManager.Legacy.Provider,

/** The name of the resource provider hosted within ProviderHub. */
@path
@segment("providerRegistrations")
@key
providerNamespace: string,
},
{},
{
/** The rollout name. */
@path
@segment("defaultRollouts")
@key
@maxLength(260)
@pattern("^[-\\w\\._\\(\\)]+$")
rolloutName: string,
}
> {}

@armResourceOperations
interface DefaultRollouts {
/**
* Gets the default rollout details.
*/
get is DefaultRolloutOps.Read<DefaultRollout>;

/**
* Creates or updates the rollout details.
*/
createOrUpdate is DefaultRolloutOps.CreateOrUpdateAsync<DefaultRollout>;

/**
* Deletes the rollout resource. Rollout must be in terminal state.
*/
delete is DefaultRolloutOps.DeleteSync<DefaultRollout>;

/**
* Gets the list of the rollouts for the given provider.
*/
listByProviderRegistration is DefaultRolloutOps.List<
DefaultRollout,
Response = ArmResponse<DefaultRolloutArrayResponseWithContinuation>
>;

/**
* Stops or cancels the rollout, if in progress.
*/
stop is DefaultRolloutOps.ActionSync<
DefaultRollout,
Request = void,
Response = OkResponse
>;
}
@armResourceOperations
interface NewRegionFrontloadReleaseOps
extends Azure.ResourceManager.Legacy.ExtensionOperations<
{
...ApiVersionParameter,
...SubscriptionIdParameter,
...Azure.ResourceManager.Legacy.Provider,

/** The name of the resource provider hosted within ProviderHub. */
@path
@segment("providerRegistrations")
@key
providerNamespace: string,
},
{},
{
/** The name of the release. */
@path
@segment("newRegionFrontloadRelease")
@key
@pattern("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")
releaseName: string,
}
> {}

@armResourceOperations
interface NewRegionFrontloadRelease {
/**
* Gets a new region frontload release.
*/
get is NewRegionFrontloadReleaseOps.Read<DefaultRollout>;

/**
* Creates or updates a new region frontload release.
*/
createOrUpdate is NewRegionFrontloadReleaseOps.CreateOrUpdateSync<
FrontloadPayload,
Response = DefaultRollout | ArmCreatedResponse<DefaultRollout>
>;

/**
* Stops a new region frontload release.
*/
stop is NewRegionFrontloadReleaseOps.ActionSync<
DefaultRollout,
void,
OkResponse
>;
}

@@maxLength(DefaultRollout.name, 260);
@@doc(DefaultRollout.name, "The rollout name.");
@@doc(DefaultRollout.properties, "Properties of the rollout.");
@@doc(DefaultRollouts.createOrUpdate::parameters.resource,
"The Default rollout properties supplied to the CreateOrUpdate operation."
);
@@doc(NewRegionFrontloadRelease.createOrUpdate::parameters.resource, "");
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./ProviderRegistration.tsp";

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

namespace Microsoft.ProviderHub;

@parentResource(ProviderRegistration)
model NotificationRegistration
is Azure.ResourceManager.ProxyResource<NotificationRegistrationProperties> {
...ResourceNameParameter<
Resource = NotificationRegistration,
KeyName = "notificationRegistrationName",
SegmentName = "notificationRegistrations",
NamePattern = ""
>;
}

@armResourceOperations
interface NotificationRegistrations {
/**
* Gets the notification registration details.
*/
get is ArmResourceRead<NotificationRegistration>;

/**
* Creates or updates a notification registration.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
createOrUpdate is ArmResourceCreateOrReplaceSync<
NotificationRegistration,
Response = ArmResourceUpdatedResponse<NotificationRegistration>
>;

/**
* Deletes a notification registration.
*/
delete is ArmResourceDeleteSync<NotificationRegistration>;

/**
* Gets the list of the notification registrations for the given provider.
*/
listByProviderRegistration is ArmResourceListByParent<
NotificationRegistration,
Response = ArmResponse<NotificationRegistrationArrayResponseWithContinuation>
>;
}

@@doc(NotificationRegistration.name, "The notification registration.");
@@doc(NotificationRegistration.properties, "");
@@doc(NotificationRegistrations.createOrUpdate::parameters.resource,
"The required body parameters supplied to the notification registration operation."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./ProviderRegistration.tsp";

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

namespace Microsoft.ProviderHub;

@singleton("default")
@parentResource(ProviderRegistration)
model OperationsPutContent
is Azure.ResourceManager.ProxyResource<OperationsPutContentProperties> {
...ResourceNameParameter<
Resource = OperationsPutContent,
KeyName = "operation",
SegmentName = "operations",
NamePattern = ""
>;
}

@armResourceOperations
interface OperationsPutContents {
/**
* Gets the operations supported by the given provider.
*/
listByProviderRegistration is ArmResourceRead<
OperationsPutContent,
Response = ArmResponse<OperationsDefinition[]>
>;

/**
* Creates or updates the operation supported by the given provider.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
createOrUpdate is ArmResourceCreateOrReplaceSync<
OperationsPutContent,
Response = ArmResourceUpdatedResponse<OperationsPutContent>
>;

/**
* Deletes an operation.
*/
delete is ArmResourceDeleteSync<OperationsPutContent>;
}

@@doc(OperationsPutContent.name, "");
@@doc(OperationsPutContent.properties, "");
@@doc(OperationsPutContents.createOrUpdate::parameters.resource,
"The operations content properties supplied to the CreateOrUpdate operation."
);
Loading
Loading