Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Azure Programmable Connectivity 2024-01-15-preview management API #30537

Merged
merged 3 commits into from
Sep 17, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
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 Azure.ResourceManager.Foundations;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.ProgrammableConnectivity;
/**
* A Programmable Connectivity Gateway resource
*/
model Gateway is Azure.ResourceManager.TrackedResource<GatewayProperties> {
/**
* Azure Programmable Connectivity Gateway Name
*/
@pattern("^[a-zA-Z]{1}[a-zA-Z0-9-_]{2,127}$")
@path
@key("gatewayName")
@segment("gateways")
@visibility("read")
name: string;
}

/**
* Gateway resource properties
*/
model GatewayProperties {
/**
* List of Operator API Connections selected by the user
*/
@visibility("read")
operatorApiConnections?: Azure.Core.armResourceIdentifier<[
{
type: "Microsoft.ProgrammableConnectivity/operatorApiConnections";
}
]>[];

/**
* Base URL of the Gateway resource. This is the URL that the users would use to make Open API Gateway requests to the Operators via Azure.
*/
@visibility("read")
gatewayBaseUrl?: string;

/**
* The status of the last operation on the Gateway resource.
*/
@visibility("read")
provisioningState?: ProvisioningState;
}

@armResourceOperations
interface Gateways {
/**
* Get a Gateway resource by name.
*/
get is ArmResourceRead<Gateway>;

/**
* Create or update an APC Gateway.
*/
createOrUpdate is ArmResourceCreateOrReplaceAsync<Gateway>;

/**
* Update Gateway tags.
*/
update is ArmTagsPatchSync<Gateway>;

/**
* Delete a Gateway.
*/
delete is ArmResourceDeleteWithoutOkAsync<Gateway>;

/**
* List Gateway resources by resource group.
*/
//#suppress "@azure-tools/typespec-azure-core/no-operation-id" "For backward compatibility"
//@operationId("Gateways_ListByResourceGroup")
listByResourceGroup is ArmResourceListByParent<Gateway>;

/**
* List Gateway resources by subscription ID.
*/
listBySubscription is ArmListBySubscription<Gateway>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
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 Azure.ResourceManager.Foundations;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.ProgrammableConnectivity;
/**
* A Programmable Connectivity Operator API Connection resource
*/
model OperatorApiConnection
is Azure.ResourceManager.TrackedResource<OperatorApiConnectionProperties> {
/**
* Azure Programmable Connectivity (APC) Operator API Connection Name.
*/
@pattern("^[a-zA-Z]{1}[a-zA-Z0-9-_]{2,127}$")
@path
@key("operatorApiConnectionName")
@segment("operatorApiConnections")
@visibility("read", "create")
name: string;
}

/**
* Operator API Connection resource properties that cannot be updated once a resource has been created.
*/
model OperatorApiConnectionProperties {
/**
* Reference to the Operator API Plan Resource ID.
*/
@visibility("read", "create", "update")
operatorApiPlanId: Azure.Core.armResourceIdentifier<[
{
type: "Microsoft.ProgrammableConnectivity/operatorApiPlans";
}
]>;

/**
* Details about the SaaS offer purchased from the marketplace.
*/
@visibility("read", "create", "update")
saasProperties?: SaasProperties;

/**
* Details about the Application that would use the Operator's Network APIs.
*/
@visibility("read", "create", "update")
configuredApplication?: ApplicationProperties;

/**
* Application ID of the App Developer that is registered with the Operator in a specific country/region.
*/
@visibility("read", "create", "update")
appId?: string;

/**
* Reference to the APC Gateway resource ID.
*/
@visibility("read", "create")
gatewayId: Azure.Core.armResourceIdentifier<[
{
type: "Microsoft.ProgrammableConnectivity/gateways";
}
]>;

/**
* Type of the account the user has with the Operator's Network API infrastructure. AzureManaged | UserManaged.
*/
@visibility("read", "create")
accountType: AccountType;

/**
* Application secret linked to the 'appId'. This should be stored securely and is not returned back when the resource information is read.
*/
@visibility("create", "update")
@secret
appSecret?: string;

/**
* Name of the Operator in the linked Operator API Plan belongs to.
*/
@visibility("read")
operatorName?: string;

/**
* The Network API for the current operator in the country/region provided in the linked Operator API Plan.
*/
@visibility("read")
camaraApiName?: string;

/**
* The status of the last operation.
*/
@visibility("read")
provisioningState?: ProvisioningState;

/**
* The status of the OperatorApiConnection resource.
*/
@visibility("read")
status?: Status;
}

/**
* The Account Type of the Operator API Connections.
*/
union AccountType {
/**
* Managed by Azure on-behalf-of the user.
*/
AzureManaged: "AzureManaged",

/**
* Managed by the User themselves on the Operator end.
*/
UserManaged: "UserManaged",

string,
}

/**
* Details about the Application that would use the Operator's Network APIs.
*/
model ApplicationProperties {
/**
* Name of the application. Example: Contoso App.
*/
name?: string;

/**
* Description of the application.
*/
applicationDescription?: string;

/**
* The category that describes the application.
*/
applicationType?: string;

/**
* Legal name of the organization owning the application.
*/
legalName?: string;

/**
* A description of the organization owning the application.
*/
organizationDescription?: string;

/**
* Unique Tax Number for the user's organization in the country/region the APC Gateway is being purchased.
*/
taxNumber?: string;

/**
* Email address of the Privacy contact or Data Protection officer of the organization.
*/
privacyContactEmailAddress?: string;
}

/**
* Details about the SaaS offer purchased from the marketplace.
*/
model SaasProperties {
/**
* Subscription ID of the SaaS offer purchased from the marketplace.
*/
saasSubscriptionId?: string;

/**
* Resource ID of the SaaS offer purchased from the marketplace.
*/
saasResourceId?: string;
}

/**
* Description of the current status of the OperatorApiConnection resource.
*/
model Status {
/**
* Current state of the OperatorApiConnection resource.
*/
state?: string;

/**
* Explanation of the current state of the OperatorApiConnection resource.
*/
reason?: string;
}

@armResourceOperations
interface OperatorApiConnections {
/**
* Get an Operator API Connection.
*/
get is ArmResourceRead<OperatorApiConnection>;

/**
* Create an Operator API Connection.
*/
create is ArmResourceCreateOrReplaceAsync<OperatorApiConnection>;

/**
* Update an Operator API Connection.
*/
update is ArmCustomPatchAsync<
OperatorApiConnection,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
OperatorApiConnection,
OperatorApiConnectionProperties
>
>;

/**
* Delete an Operator API Connection.
*/
delete is ArmResourceDeleteWithoutOkAsync<OperatorApiConnection>;

/**
* List OperatorApiConnection resources by resource group.
*/
listByResourceGroup is ArmResourceListByParent<OperatorApiConnection>;

/**
* List OperatorApiConnection resources by subscription ID.
*/
listBySubscription is ArmListBySubscription<OperatorApiConnection>;
}
Loading
Loading