diff --git a/custom-words.txt b/custom-words.txt index 1ef64cde9ac3..5f0157ebeff3 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -125,6 +125,7 @@ aods aosm apac apacheavro +apcgatewayapi api's apim apimanagement @@ -422,6 +423,7 @@ bzip cacerts cadl calculatebaseline +camara canadacentral canadaeast canceldelete diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/common.tsp b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/common.tsp new file mode 100644 index 000000000000..daf2d047610f --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/common.tsp @@ -0,0 +1,106 @@ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; + +namespace Azure.ProgrammableConnectivity; + +alias ServiceTraits = NoRepeatableRequests & + NoConditionalRequests & + SupportsClientRequestId & + RequestHeadersTrait & + // Note that ResponseHeadersTrait is overridden in number operations + // If you modify this, you must also modify it in the number operations. + ResponseHeadersTrait; + +// alias Operations = Azure.Core.ResourceOperations; +alias Operations = Azure.Core.ResourceOperations< + ServiceTraits, + Azure.Core.Foundations.ErrorResponse +>; + +@doc("Header to identify APC Gateway resource.") +model ApcGatewayIdHeader { + @doc("The identifier of the APC Gateway resource which should handle this request.") + @header("apc-gateway-id") + apcGatewayId: string; +} + +@doc("Identifier for the network to be queried") +model NetworkIdentifier { + @doc("The type of identifier for the network. one of: 'IPv4', 'IPv6', 'NetworkCode'") + identifierType: string; + + @doc(""" + The network identifier, based on the identifierType: an IPv4 address, and IPv6 address, or a Network Code. + A Network Code may be obtained from APC documentation or from the APC /Network:retrieve endpoint. + """) + identifier: string; +} + +@doc("The phone number of the device.") +model PhoneNumberModel { + @doc("Phone number in E.164 format (starting with country code), and optionally prefixed with '+'") + @pattern("^\\+?[0-9]{5,15}$") + phoneNumber?: string; +} + +@doc("The network access ID/external ID of the device") +model NetworkAccessIdentifierModel { + @doc("External identifier or network access identifier of the device") + networkAccessIdentifier?: string; +} + +@error +@doc("A custom error response for APC.") +model ApcErrorResponse { + @doc("Error returned by APC") + error: ApcError; + + @header("x-ms-error-code") + @doc("String error code indicating what went wrong.") + errorCode?: string; +} + +@doc("A custom error for APC.") +model ApcError { + ...Azure.Core.Foundations.Error; + + @doc("The consent URL in case of a consent failure") + consentUrl?: url; +} + +@doc("IPv4 address and port of the device") +model Ipv4AddressModel { + @doc("The Ipv4 address") + ipv4Address?: Ipv4Address; +} + +@doc("IPv4 address and port of the device") +model Ipv6AddressModel { + @doc("The Ipv6 address") + ipv6Address?: Ipv6Address; +} + +@doc("IPv4 device indicator") +model Ipv4Address { + @doc("An IPv4 address. This may be specified as an exact address, or as a subnet in CIDR notation.") + ipv4: string; + + @doc("User equipment port.") + port: int32; +} + +@doc("IPv6 device indicator") +model Ipv6Address { + @doc("An IPv6 address. This may be specified as an exact address, or as a subnet in CIDR notation.") + ipv6: string; + + @doc("User equipment port.") + port: int32; +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/location.tsp b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/location.tsp new file mode 100644 index 000000000000..2fe865cf1574 --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/location.tsp @@ -0,0 +1,77 @@ +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; + +namespace Azure.ProgrammableConnectivity; + +/// Interfaces + +interface DeviceLocation { + @doc("Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude.") + verify is Operations.ResourceAction< + DeviceLocationEndpoint, + DeviceLocationVerificationContent, + DeviceLocationVerificationResult + >; +} + +/// Endpoints + +@resource("device-location") +@doc("Static endpoint to access the Device Location API family.") +model DeviceLocationEndpoint { + @key + @doc("Static endpoint") + @visibility("read") + location: "location"; +} + +/// Request models + +@doc("Request to verify Location") +model DeviceLocationVerificationContent { + @doc("Network to query for this device, or device information to enable network routing.") + networkIdentifier: NetworkIdentifier; + + @doc("Latitude of location to be verified") + @minValue(-90) + @maxValue(90) + latitude: float64; + + @doc("Longitude of location to be verified") + @minValue(-180) + @maxValue(180) + longitude: float64; + + @doc("Accuracy expected for location verification in kilometers") + @minValue(2) + @maxValue(100) + accuracy: int32; + + @doc("The device to find the location for. Exactly one of Network Access Code, Phone Number, IPv4 address, or IPv6 address") + device: LocationDevice; +} + +/// Response models + +@doc("Response verifying location") +model DeviceLocationVerificationResult { + @doc("True if the location is in the specified area, False otherwise") + verificationResult: boolean; +} + +/// Common models + +// LocationDevice represents a Device as required by the Location API. The APC team aims +// to drive commonisation of the underlying CAMARA APIs so that all APIs can share a common Device +// model in future. +@doc("Device information needed by operator to provide location information. Include exactly one of these properties to identify your device.") +model LocationDevice { + ...NetworkAccessIdentifierModel; + ...PhoneNumberModel; + ...Ipv4AddressModel; + ...Ipv6AddressModel; +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/network.tsp b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/network.tsp new file mode 100644 index 000000000000..48faea42e171 --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/network.tsp @@ -0,0 +1,40 @@ +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; + +namespace Azure.ProgrammableConnectivity; + +/// Interfaces + +interface DeviceNetwork { + @doc("Retrieves the network a given device is on. Returns network in a networkCode format that can be used for other APIs.") + retrieve is Operations.ResourceAction< + DeviceNetworkRetrievalEndpoint, + NetworkIdentifier, + NetworkRetrievalResult + >; +} + +/// Endpoints + +@resource("device-network") +@doc("Static endpoint to access the Device Network API family.") +model DeviceNetworkRetrievalEndpoint { + @key + @doc("Static endpoint") + @visibility("read") + network: "network"; +} + +/// Common models + +@doc("The network that the device is on.") +model NetworkRetrievalResult { + @pattern("[a-z0-9-]+$") + @doc("The identifier for the network. This can be used as the networkIdentifier for the service APIs.") + networkCode: string; +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/number.tsp b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/number.tsp new file mode 100644 index 000000000000..beaae5fe49e7 --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/number.tsp @@ -0,0 +1,100 @@ +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; + +namespace Azure.ProgrammableConnectivity; + +/// Interfaces + +@doc(""" + Number operations include Frontend Authentication. + + Users first make a call to the endpoint /Number:verify, which returns a redirect to the device's + Network. This is followed by the device to authenticate directly with the Network. The Network + responds with a token and a redirect. This token can be exchanged with APC for a code. + + Users make a second call to the endpoint /Number:verify including the code. The code is used + to verify the device number. The second response is a 200 containing the result of the query. + + For more information on the steps required to use Number Verificaiton, see the APC documentation. +""") +interface NumberVerification { + #suppress "@azure-tools/typespec-azure-core/no-response-body" "302 redirect has no response body" + @doc("Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly.") + @sharedRoute + @action("verify") + verifyWithoutCode is Operations.ResourceAction< + NumberVerificationEndpoint, + NumberVerificationWithoutCodeContent, + TypeSpec.Http.Response<302> & {}, + TraitOverride> + >; + + @doc("Verifies the phone number (MSISDN) associated with a device.") + @sharedRoute + @action("verify") + verifyWithCode is Operations.ResourceAction< + NumberVerificationEndpoint, + NumberVerificationWithCodeContent, + NumberVerificationResult + >; +} + +/// Endpoints + +@resource("number-verification") +@doc("Static endpoint to access Number Verification API family") +model NumberVerificationEndpoint { + @key + @doc("Static endpoint") + @visibility("read") + number: "number"; +} + +/// Request models + +@doc("Request to verify number of device - first call") +model NumberVerificationWithoutCodeContent { + @doc("Identifier for the network to query for this device.") + networkIdentifier: NetworkIdentifier; + + ...NumberDevice; +} + +@doc("Request to verify number of device - second call") +model NumberVerificationWithCodeContent { + @doc("Identifier for the network to query for this device.") + networkIdentifier: NetworkIdentifier; + + ...NumberDevice; + + @doc("The code provided by APC in exchange for the operator code.") + apcCode: string; +} + +/// Response models + +@doc("Response verifying number of device") +model NumberVerificationResult { + @doc("True if number if the phone number matches the device, False otherwise") + verificationResult: boolean; +} + +/// Common models + +// NumberDevice represents a Device as required by the Number Verification API. The APC team aims +// to drive commonisation of the underlying CAMARA APIs so that all APIs can share a common Device +// model in future. +@doc("Device information to verify phone number. Include exactly one form of phone number.") +model NumberDevice { + ...PhoneNumberModel; + + @doc("Hashed phone number. SHA-256 (in hexadecimal representation) of the mobile phone number in **E.164 format (starting with country code)**. Optionally prefixed with '+'.") + hashedPhoneNumber?: string; +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/simswap.tsp b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/simswap.tsp new file mode 100644 index 000000000000..d004d29d282a --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/apis/simswap.tsp @@ -0,0 +1,85 @@ +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; + +namespace Azure.ProgrammableConnectivity; + +/// Interfaces +@doc("SIM Swap API provides the customer the ability to obtain information on any recent SIM pairing change related to the User's mobile account.") +interface SimSwap { + @doc("Provides timestamp of latest SIM swap") + retrieve is Operations.ResourceAction< + SimSwapEndpoint, + SimSwapRetrievalContent, + SimSwapRetrievalResult + >; + + @doc("Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured.") + verify is Operations.ResourceAction< + SimSwapEndpoint, + SimSwapVerificationContent, + SimSwapVerificationResult + >; +} + +/// Endpoints + +@resource("sim-swap") +@doc("Static endpoint to access the Sim Swap API family") +model SimSwapEndpoint { + @key + @doc("Static endpoint") + @visibility("read") + simSwap: "sim-swap"; +} + +/// Request models + +@doc("Request to retrieve SimSwap date") +model SimSwapRetrievalContent { + ...SimSwapDevice; + + @doc("Network to query for this device") + networkIdentifier: NetworkIdentifier; +} + +@doc("Request to verify SimSwap in period") +model SimSwapVerificationContent { + ...SimSwapDevice; + + @doc("Maximum lookback for SimSwap verification") + @minValue(1) + @maxValue(2400) + maxAgeHours?: int32 = 240; + + @doc("Identifier for the network to query for this device.") + networkIdentifier: NetworkIdentifier; +} + +/// Response Models + +@doc("Response with SimSwap date") +model SimSwapRetrievalResult { + @doc("Datetime of most recent swap for SIM") + date: utcDateTime; +} + +@doc("Response verifying SimSwap in period") +model SimSwapVerificationResult { + @doc("True if the SIM has swapped in the specified period, False otherwise") + verificationResult: boolean; +} + +/// Common models + +// SimSwapDevice represents a Device as required by the Sim Swap API. The APC team aims +// to drive commonisation of the underlying CAMARA APIs so that all APIs can share a common Device +// model in future. +@doc("Device information needed by operator to find sim swap information.") +model SimSwapDevice { + ...PhoneNumberModel; +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/client.tsp b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/client.tsp new file mode 100644 index 000000000000..164fc28c837f --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/client.tsp @@ -0,0 +1,5 @@ +/** + * PLACEHOLDER + * Add readme and sample + */ +import "./main.tsp"; diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/DeviceLocation_Verify_MaximumSet_Gen.json b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/DeviceLocation_Verify_MaximumSet_Gen.json new file mode 100644 index 000000000000..5ca27769ff7b --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/DeviceLocation_Verify_MaximumSet_Gen.json @@ -0,0 +1,38 @@ +{ + "title": "DeviceLocation_Verify", + "operationId": "DeviceLocation_Verify", + "parameters": { + "api-version": "2024-02-09-preview", + "location": "location", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "networkIdentifier": { + "identifierType": "ipv4", + "identifier": "12.12.12.12" + }, + "latitude": 70, + "longitude": -161, + "accuracy": 91, + "device": { + "networkAccessIdentifier": "122345@domain.com", + "phoneNumber": "+447000000000", + "ipv4Address": { + "ipv4": "12.12.12.12", + "port": 2442 + }, + "ipv6Address": { + "ipv6": "3001:0da8:75a3:0000:0000:8a2e:0370:7334", + "port": 1643 + } + } + } + }, + "responses": { + "200": { + "body": { + "verificationResult": true + } + } + } +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/DeviceNetwork_Retrieve_MaximumSet_Gen.json b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/DeviceNetwork_Retrieve_MaximumSet_Gen.json new file mode 100644 index 000000000000..cc6dc26b315c --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/DeviceNetwork_Retrieve_MaximumSet_Gen.json @@ -0,0 +1,21 @@ +{ + "title": "DeviceNetwork_Retrieve", + "operationId": "DeviceNetwork_Retrieve", + "parameters": { + "api-version": "2024-02-09-preview", + "network": "network", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "identifierType": "ipv6", + "identifier": "3001:0da8:75a3:0000:0000:8a2e:0370:7334" + } + }, + "responses": { + "200": { + "body": { + "networkCode": "Example_Network" + } + } + } +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/NumberVerification_VerifyWithCode_MaximumSet_Gen.json b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/NumberVerification_VerifyWithCode_MaximumSet_Gen.json new file mode 100644 index 000000000000..1ac432985790 --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/NumberVerification_VerifyWithCode_MaximumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "title": "NumberVerification_VerifyWithCode", + "operationId": "NumberVerification_VerifyWithCode", + "parameters": { + "api-version": "2024-02-09-preview", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "networkIdentifier": { + "identifierType": "ipv4", + "identifier": "12.12.12.12" + }, + "phoneNumber": "+14424318793", + "hashedPhoneNumber": "bwsl", + "apcCode": "yn" + } + }, + "responses": { + "200": { + "body": { + "verificationResult": true + } + } + } +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/NumberVerification_VerifyWithoutCode_MaximumSet_Gen.json b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/NumberVerification_VerifyWithoutCode_MaximumSet_Gen.json new file mode 100644 index 000000000000..9a2f68a4e168 --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/NumberVerification_VerifyWithoutCode_MaximumSet_Gen.json @@ -0,0 +1,20 @@ +{ + "title": "NumberVerification_VerifyWithoutCode", + "operationId": "NumberVerification_VerifyWithoutCode", + "parameters": { + "api-version": "2024-02-09-preview", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "networkIdentifier": { + "identifierType": "ipv4", + "identifier": "12.12.12.12" + }, + "phoneNumber": "+14424318793", + "hashedPhoneNumber": "bwsl" + } + }, + "responses": { + "302": {} + } +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/SimSwap_Retrieve_MaximumSet_Gen.json b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/SimSwap_Retrieve_MaximumSet_Gen.json new file mode 100644 index 000000000000..5291fdf6279e --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/SimSwap_Retrieve_MaximumSet_Gen.json @@ -0,0 +1,24 @@ +{ + "title": "SimSwap_Retrieve", + "operationId": "SimSwap_Retrieve", + "parameters": { + "api-version": "2024-02-09-preview", + "simSwap": "sim-swap", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "phoneNumber": "+61215310263792", + "networkIdentifier": { + "identifierType": "IPv6", + "identifier": "2001:0db8:85a3:0000:0000:8a2e:0370:7334" + } + } + }, + "responses": { + "200": { + "body": { + "date": "2023-12-12T09:01:33.333Z" + } + } + } +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/SimSwap_Verify_MaximumSet_Gen.json b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/SimSwap_Verify_MaximumSet_Gen.json new file mode 100644 index 000000000000..85d67550a64e --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/examples/2024-02-09-preview/SimSwap_Verify_MaximumSet_Gen.json @@ -0,0 +1,24 @@ +{ + "title": "SimSwap_Verify", + "operationId": "SimSwap_Verify", + "parameters": { + "api-version": "2024-02-09-preview", + "simSwap": "sim-swap", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "maxAgeHours": 941, + "networkIdentifier": { + "identifierType": "ipv4", + "identifier": "12.12.12.12" + } + } + }, + "responses": { + "200": { + "body": { + "verificationResult": true + } + } + } +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/main.tsp b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/main.tsp new file mode 100644 index 000000000000..5933e0fbdc47 --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/main.tsp @@ -0,0 +1,41 @@ +import "./apis/location.tsp"; +import "./apis/network.tsp"; +import "./apis/number.tsp"; +import "./apis/simswap.tsp"; + +using TypeSpec.Http; +using TypeSpec.Versioning; +using Azure.Core; + +@useAuth( + [ + OAuth2Auth<[ + { + type: OAuth2FlowType.implicit, + authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize", + scopes: ["https://management.azure.com//.default"], + } + ]> + ] +) +@service({ + title: "Programmable Connectivity", +}) +@server( + "{endpoint}", + "Azure Programmable Connectivity Endpoint.", + { + @doc("An Azure Programmable Connectivity Endpoint providing access to Network APIs, for example https://{region}.apcgatewayapi.azure.com") + endpoint: string, + } +) +@versioned(APCVersions) +@doc("Azure Programmable Connectivity (APC) provides a unified interface to the Network APIs of multiple Telecom Operators. Note that Operators may deprecate a Network API with less advance notice than the Azure standard, in which case APC will also deprecate that Network API.") +namespace Azure.ProgrammableConnectivity; + +@doc("APC Versions") +enum APCVersions { + @doc("Version 2024-02-09-preview") + @useDependency(Azure.Core.Versions.v1_0_Preview_1) + v2024_02_09_preview: "2024-02-09-preview", +} diff --git a/specification/programmableconnectivity/Azure.ProgrammableConnectivity/tspconfig.yaml b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/tspconfig.yaml new file mode 100644 index 000000000000..70877fbdf030 --- /dev/null +++ b/specification/programmableconnectivity/Azure.ProgrammableConnectivity/tspconfig.yaml @@ -0,0 +1,26 @@ +parameters: + "service-dir": + default: "sdk/programmableconnectivity" + "dependencies": + "additionalDirectories": [] + default: "" +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + azure-resource-provider-folder: "data-plane" + emitter-output-dir: "{project-root}/.." + examples-directory: "{project-root}/examples" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" + "@azure-tools/typespec-csharp": + package-dir: "Azure.Communication.ProgrammableConnectivity" + clear-output-folder: true + model-namespace: false + namespace: "{package-dir}" + "@azure-tools/typespec-python": + package-mode: "dataplane" + package-dir: "azure-programmableconnectivity" + package-name: "{package-dir}" +linter: + extends: + - "@azure-tools/typespec-azure-core/all" diff --git a/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/DeviceLocation_Verify_MaximumSet_Gen.json b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/DeviceLocation_Verify_MaximumSet_Gen.json new file mode 100644 index 000000000000..5ca27769ff7b --- /dev/null +++ b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/DeviceLocation_Verify_MaximumSet_Gen.json @@ -0,0 +1,38 @@ +{ + "title": "DeviceLocation_Verify", + "operationId": "DeviceLocation_Verify", + "parameters": { + "api-version": "2024-02-09-preview", + "location": "location", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "networkIdentifier": { + "identifierType": "ipv4", + "identifier": "12.12.12.12" + }, + "latitude": 70, + "longitude": -161, + "accuracy": 91, + "device": { + "networkAccessIdentifier": "122345@domain.com", + "phoneNumber": "+447000000000", + "ipv4Address": { + "ipv4": "12.12.12.12", + "port": 2442 + }, + "ipv6Address": { + "ipv6": "3001:0da8:75a3:0000:0000:8a2e:0370:7334", + "port": 1643 + } + } + } + }, + "responses": { + "200": { + "body": { + "verificationResult": true + } + } + } +} diff --git a/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/DeviceNetwork_Retrieve_MaximumSet_Gen.json b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/DeviceNetwork_Retrieve_MaximumSet_Gen.json new file mode 100644 index 000000000000..cc6dc26b315c --- /dev/null +++ b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/DeviceNetwork_Retrieve_MaximumSet_Gen.json @@ -0,0 +1,21 @@ +{ + "title": "DeviceNetwork_Retrieve", + "operationId": "DeviceNetwork_Retrieve", + "parameters": { + "api-version": "2024-02-09-preview", + "network": "network", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "identifierType": "ipv6", + "identifier": "3001:0da8:75a3:0000:0000:8a2e:0370:7334" + } + }, + "responses": { + "200": { + "body": { + "networkCode": "Example_Network" + } + } + } +} diff --git a/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/NumberVerification_VerifyWithCode_MaximumSet_Gen.json b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/NumberVerification_VerifyWithCode_MaximumSet_Gen.json new file mode 100644 index 000000000000..1ac432985790 --- /dev/null +++ b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/NumberVerification_VerifyWithCode_MaximumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "title": "NumberVerification_VerifyWithCode", + "operationId": "NumberVerification_VerifyWithCode", + "parameters": { + "api-version": "2024-02-09-preview", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "networkIdentifier": { + "identifierType": "ipv4", + "identifier": "12.12.12.12" + }, + "phoneNumber": "+14424318793", + "hashedPhoneNumber": "bwsl", + "apcCode": "yn" + } + }, + "responses": { + "200": { + "body": { + "verificationResult": true + } + } + } +} diff --git a/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/NumberVerification_VerifyWithoutCode_MaximumSet_Gen.json b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/NumberVerification_VerifyWithoutCode_MaximumSet_Gen.json new file mode 100644 index 000000000000..9a2f68a4e168 --- /dev/null +++ b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/NumberVerification_VerifyWithoutCode_MaximumSet_Gen.json @@ -0,0 +1,20 @@ +{ + "title": "NumberVerification_VerifyWithoutCode", + "operationId": "NumberVerification_VerifyWithoutCode", + "parameters": { + "api-version": "2024-02-09-preview", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "networkIdentifier": { + "identifierType": "ipv4", + "identifier": "12.12.12.12" + }, + "phoneNumber": "+14424318793", + "hashedPhoneNumber": "bwsl" + } + }, + "responses": { + "302": {} + } +} diff --git a/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/SimSwap_Retrieve_MaximumSet_Gen.json b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/SimSwap_Retrieve_MaximumSet_Gen.json new file mode 100644 index 000000000000..5291fdf6279e --- /dev/null +++ b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/SimSwap_Retrieve_MaximumSet_Gen.json @@ -0,0 +1,24 @@ +{ + "title": "SimSwap_Retrieve", + "operationId": "SimSwap_Retrieve", + "parameters": { + "api-version": "2024-02-09-preview", + "simSwap": "sim-swap", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "phoneNumber": "+61215310263792", + "networkIdentifier": { + "identifierType": "IPv6", + "identifier": "2001:0db8:85a3:0000:0000:8a2e:0370:7334" + } + } + }, + "responses": { + "200": { + "body": { + "date": "2023-12-12T09:01:33.333Z" + } + } + } +} diff --git a/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/SimSwap_Verify_MaximumSet_Gen.json b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/SimSwap_Verify_MaximumSet_Gen.json new file mode 100644 index 000000000000..85d67550a64e --- /dev/null +++ b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/examples/SimSwap_Verify_MaximumSet_Gen.json @@ -0,0 +1,24 @@ +{ + "title": "SimSwap_Verify", + "operationId": "SimSwap_Verify", + "parameters": { + "api-version": "2024-02-09-preview", + "simSwap": "sim-swap", + "x-ms-client-request-id": "123e4567-e89b-12d3-a456-426614174000", + "apc-gateway-id": "zdgrzzaxlodrvewbksn", + "body": { + "maxAgeHours": 941, + "networkIdentifier": { + "identifierType": "ipv4", + "identifier": "12.12.12.12" + } + } + }, + "responses": { + "200": { + "body": { + "verificationResult": true + } + } + } +} diff --git a/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/openapi.json b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/openapi.json new file mode 100644 index 000000000000..ee1a3814550f --- /dev/null +++ b/specification/programmableconnectivity/data-plane/Azure.ProgrammableConnectivity/preview/2024-02-09-preview/openapi.json @@ -0,0 +1,1021 @@ +{ + "swagger": "2.0", + "info": { + "title": "Programmable Connectivity", + "version": "2024-02-09-preview", + "description": "Azure Programmable Connectivity (APC) provides a unified interface to the Network APIs of multiple Telecom Operators. Note that Operators may deprecate a Network API with less advance notice than the Azure standard, in which case APC will also deprecate that Network API.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "description": "An Azure Programmable Connectivity Endpoint providing access to Network APIs, for example https://{region}.apcgatewayapi.azure.com", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "OAuth2Auth": [ + "https://management.azure.com//.default" + ] + } + ], + "securityDefinitions": { + "OAuth2Auth": { + "type": "oauth2", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "https://management.azure.com//.default": "" + } + } + }, + "tags": [], + "paths": { + "/device-location/location:verify": { + "post": { + "operationId": "DeviceLocation_Verify", + "description": "Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "$ref": "#/parameters/ApcGatewayIdHeader" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeviceLocationVerificationContent" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/DeviceLocationVerificationResult" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + }, + "x-ms-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, server-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "DeviceLocation_Verify": { + "$ref": "./examples/DeviceLocation_Verify_MaximumSet_Gen.json" + } + } + } + }, + "/device-network/network:retrieve": { + "post": { + "operationId": "DeviceNetwork_Retrieve", + "description": "Retrieves the network a given device is on. Returns network in a networkCode format that can be used for other APIs.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "$ref": "#/parameters/ApcGatewayIdHeader" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/NetworkIdentifier" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/NetworkRetrievalResult" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + }, + "x-ms-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, server-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "DeviceNetwork_Retrieve": { + "$ref": "./examples/DeviceNetwork_Retrieve_MaximumSet_Gen.json" + } + } + } + }, + "/number-verification/number:verify": { + "post": { + "operationId": "NumberVerification_VerifyWithoutCode", + "description": "Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "$ref": "#/parameters/ApcGatewayIdHeader" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/NumberVerificationWithoutCodeContent" + } + } + ], + "responses": { + "302": { + "description": "Redirection", + "headers": { + "location": { + "type": "string" + }, + "x-ms-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, server-generated string identifier for the request." + }, + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "NumberVerification_VerifyWithoutCode": { + "$ref": "./examples/NumberVerification_VerifyWithoutCode_MaximumSet_Gen.json" + } + } + } + }, + "/sim-swap/sim-swap:retrieve": { + "post": { + "operationId": "SimSwap_Retrieve", + "description": "Provides timestamp of latest SIM swap", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "$ref": "#/parameters/ApcGatewayIdHeader" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SimSwapRetrievalContent" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/SimSwapRetrievalResult" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + }, + "x-ms-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, server-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "SimSwap_Retrieve": { + "$ref": "./examples/SimSwap_Retrieve_MaximumSet_Gen.json" + } + } + } + }, + "/sim-swap/sim-swap:verify": { + "post": { + "operationId": "SimSwap_Verify", + "description": "Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "$ref": "#/parameters/ApcGatewayIdHeader" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SimSwapVerificationContent" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/SimSwapVerificationResult" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + }, + "x-ms-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, server-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "SimSwap_Verify": { + "$ref": "./examples/SimSwap_Verify_MaximumSet_Gen.json" + } + } + } + } + }, + "x-ms-paths": { + "/number-verification/number:verify?_overload=verifyWithCode": { + "post": { + "operationId": "NumberVerification_VerifyWithCode", + "description": "Verifies the phone number (MSISDN) associated with a device.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "$ref": "#/parameters/ApcGatewayIdHeader" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/NumberVerificationWithCodeContent" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/NumberVerificationResult" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + }, + "x-ms-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, server-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "NumberVerification_VerifyWithCode": { + "$ref": "./examples/NumberVerification_VerifyWithCode_MaximumSet_Gen.json" + } + } + } + } + }, + "definitions": { + "APCVersions": { + "type": "string", + "description": "APC Versions", + "enum": [ + "2024-02-09-preview" + ], + "x-ms-enum": { + "name": "APCVersions", + "modelAsString": true, + "values": [ + { + "name": "v2024_02_09_preview", + "value": "2024-02-09-preview", + "description": "Version 2024-02-09-preview" + } + ] + } + }, + "ApcError": { + "type": "object", + "description": "A custom error for APC.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + }, + "consentUrl": { + "type": "string", + "format": "uri", + "description": "The consent URL in case of a consent failure" + } + }, + "required": [ + "code", + "message" + ] + }, + "ApcErrorResponse": { + "type": "object", + "description": "A custom error response for APC.", + "properties": { + "error": { + "$ref": "#/definitions/ApcError", + "description": "Error returned by APC" + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "DeviceLocationEndpoint": { + "type": "object", + "description": "Static endpoint to access the Device Location API family.", + "properties": { + "location": { + "type": "string", + "description": "Static endpoint", + "enum": [ + "location" + ], + "x-ms-enum": { + "modelAsString": false + }, + "readOnly": true + } + }, + "required": [ + "location" + ] + }, + "DeviceLocationVerificationContent": { + "type": "object", + "description": "Request to verify Location", + "properties": { + "networkIdentifier": { + "$ref": "#/definitions/NetworkIdentifier", + "description": "Network to query for this device, or device information to enable network routing." + }, + "latitude": { + "type": "number", + "format": "double", + "description": "Latitude of location to be verified", + "minimum": -90, + "maximum": 90 + }, + "longitude": { + "type": "number", + "format": "double", + "description": "Longitude of location to be verified", + "minimum": -180, + "maximum": 180 + }, + "accuracy": { + "type": "integer", + "format": "int32", + "description": "Accuracy expected for location verification in kilometers", + "minimum": 2, + "maximum": 100 + }, + "device": { + "$ref": "#/definitions/LocationDevice", + "description": "The device to find the location for. Exactly one of Network Access Code, Phone Number, IPv4 address, or IPv6 address" + } + }, + "required": [ + "networkIdentifier", + "latitude", + "longitude", + "accuracy", + "device" + ] + }, + "DeviceLocationVerificationResult": { + "type": "object", + "description": "Response verifying location", + "properties": { + "verificationResult": { + "type": "boolean", + "description": "True if the location is in the specified area, False otherwise" + } + }, + "required": [ + "verificationResult" + ] + }, + "DeviceNetworkRetrievalEndpoint": { + "type": "object", + "description": "Static endpoint to access the Device Network API family.", + "properties": { + "network": { + "type": "string", + "description": "Static endpoint", + "enum": [ + "network" + ], + "x-ms-enum": { + "modelAsString": false + }, + "readOnly": true + } + }, + "required": [ + "network" + ] + }, + "Ipv4Address": { + "type": "object", + "description": "IPv4 device indicator", + "properties": { + "ipv4": { + "type": "string", + "description": "An IPv4 address. This may be specified as an exact address, or as a subnet in CIDR notation." + }, + "port": { + "type": "integer", + "format": "int32", + "description": "User equipment port." + } + }, + "required": [ + "ipv4", + "port" + ] + }, + "Ipv4AddressModel": { + "type": "object", + "description": "IPv4 address and port of the device", + "properties": { + "ipv4Address": { + "$ref": "#/definitions/Ipv4Address", + "description": "The Ipv4 address" + } + } + }, + "Ipv6Address": { + "type": "object", + "description": "IPv6 device indicator", + "properties": { + "ipv6": { + "type": "string", + "description": "An IPv6 address. This may be specified as an exact address, or as a subnet in CIDR notation." + }, + "port": { + "type": "integer", + "format": "int32", + "description": "User equipment port." + } + }, + "required": [ + "ipv6", + "port" + ] + }, + "Ipv6AddressModel": { + "type": "object", + "description": "IPv4 address and port of the device", + "properties": { + "ipv6Address": { + "$ref": "#/definitions/Ipv6Address", + "description": "The Ipv6 address" + } + } + }, + "LocationDevice": { + "type": "object", + "description": "Device information needed by operator to provide location information. Include exactly one of these properties to identify your device.", + "properties": { + "networkAccessIdentifier": { + "type": "string", + "description": "External identifier or network access identifier of the device" + }, + "phoneNumber": { + "type": "string", + "description": "Phone number in E.164 format (starting with country code), and optionally prefixed with '+'", + "pattern": "^\\+?[0-9]{5,15}$" + }, + "ipv4Address": { + "$ref": "#/definitions/Ipv4Address", + "description": "The Ipv4 address" + }, + "ipv6Address": { + "$ref": "#/definitions/Ipv6Address", + "description": "The Ipv6 address" + } + } + }, + "NetworkAccessIdentifierModel": { + "type": "object", + "description": "The network access ID/external ID of the device", + "properties": { + "networkAccessIdentifier": { + "type": "string", + "description": "External identifier or network access identifier of the device" + } + } + }, + "NetworkIdentifier": { + "type": "object", + "description": "Identifier for the network to be queried", + "properties": { + "identifierType": { + "type": "string", + "description": "The type of identifier for the network. one of: 'IPv4', 'IPv6', 'NetworkCode'" + }, + "identifier": { + "type": "string", + "description": "The network identifier, based on the identifierType: an IPv4 address, and IPv6 address, or a Network Code.\nA Network Code may be obtained from APC documentation or from the APC /Network:retrieve endpoint." + } + }, + "required": [ + "identifierType", + "identifier" + ] + }, + "NetworkRetrievalResult": { + "type": "object", + "description": "The network that the device is on.", + "properties": { + "networkCode": { + "type": "string", + "description": "The identifier for the network. This can be used as the networkIdentifier for the service APIs.", + "pattern": "[a-z0-9-]+$" + } + }, + "required": [ + "networkCode" + ] + }, + "NumberDevice": { + "type": "object", + "description": "Device information to verify phone number. Include exactly one form of phone number.", + "properties": { + "phoneNumber": { + "type": "string", + "description": "Phone number in E.164 format (starting with country code), and optionally prefixed with '+'", + "pattern": "^\\+?[0-9]{5,15}$" + }, + "hashedPhoneNumber": { + "type": "string", + "description": "Hashed phone number. SHA-256 (in hexadecimal representation) of the mobile phone number in **E.164 format (starting with country code)**. Optionally prefixed with '+'." + } + } + }, + "NumberVerificationEndpoint": { + "type": "object", + "description": "Static endpoint to access Number Verification API family", + "properties": { + "number": { + "type": "string", + "description": "Static endpoint", + "enum": [ + "number" + ], + "x-ms-enum": { + "modelAsString": false + }, + "readOnly": true + } + }, + "required": [ + "number" + ] + }, + "NumberVerificationResult": { + "type": "object", + "description": "Response verifying number of device", + "properties": { + "verificationResult": { + "type": "boolean", + "description": "True if number if the phone number matches the device, False otherwise" + } + }, + "required": [ + "verificationResult" + ] + }, + "NumberVerificationWithCodeContent": { + "type": "object", + "description": "Request to verify number of device - second call", + "properties": { + "networkIdentifier": { + "$ref": "#/definitions/NetworkIdentifier", + "description": "Identifier for the network to query for this device." + }, + "phoneNumber": { + "type": "string", + "description": "Phone number in E.164 format (starting with country code), and optionally prefixed with '+'", + "pattern": "^\\+?[0-9]{5,15}$" + }, + "hashedPhoneNumber": { + "type": "string", + "description": "Hashed phone number. SHA-256 (in hexadecimal representation) of the mobile phone number in **E.164 format (starting with country code)**. Optionally prefixed with '+'." + }, + "apcCode": { + "type": "string", + "description": "The code provided by APC in exchange for the operator code." + } + }, + "required": [ + "networkIdentifier", + "apcCode" + ] + }, + "NumberVerificationWithoutCodeContent": { + "type": "object", + "description": "Request to verify number of device - first call", + "properties": { + "networkIdentifier": { + "$ref": "#/definitions/NetworkIdentifier", + "description": "Identifier for the network to query for this device." + }, + "phoneNumber": { + "type": "string", + "description": "Phone number in E.164 format (starting with country code), and optionally prefixed with '+'", + "pattern": "^\\+?[0-9]{5,15}$" + }, + "hashedPhoneNumber": { + "type": "string", + "description": "Hashed phone number. SHA-256 (in hexadecimal representation) of the mobile phone number in **E.164 format (starting with country code)**. Optionally prefixed with '+'." + } + }, + "required": [ + "networkIdentifier" + ] + }, + "PhoneNumberModel": { + "type": "object", + "description": "The phone number of the device.", + "properties": { + "phoneNumber": { + "type": "string", + "description": "Phone number in E.164 format (starting with country code), and optionally prefixed with '+'", + "pattern": "^\\+?[0-9]{5,15}$" + } + } + }, + "SimSwapDevice": { + "type": "object", + "description": "Device information needed by operator to find sim swap information.", + "properties": { + "phoneNumber": { + "type": "string", + "description": "Phone number in E.164 format (starting with country code), and optionally prefixed with '+'", + "pattern": "^\\+?[0-9]{5,15}$" + } + } + }, + "SimSwapEndpoint": { + "type": "object", + "description": "Static endpoint to access the Sim Swap API family", + "properties": { + "simSwap": { + "type": "string", + "description": "Static endpoint", + "enum": [ + "sim-swap" + ], + "x-ms-enum": { + "modelAsString": false + }, + "readOnly": true + } + }, + "required": [ + "simSwap" + ] + }, + "SimSwapRetrievalContent": { + "type": "object", + "description": "Request to retrieve SimSwap date", + "properties": { + "phoneNumber": { + "type": "string", + "description": "Phone number in E.164 format (starting with country code), and optionally prefixed with '+'", + "pattern": "^\\+?[0-9]{5,15}$" + }, + "networkIdentifier": { + "$ref": "#/definitions/NetworkIdentifier", + "description": "Network to query for this device" + } + }, + "required": [ + "networkIdentifier" + ] + }, + "SimSwapRetrievalResult": { + "type": "object", + "description": "Response with SimSwap date", + "properties": { + "date": { + "type": "string", + "format": "date-time", + "description": "Datetime of most recent swap for SIM" + } + }, + "required": [ + "date" + ] + }, + "SimSwapVerificationContent": { + "type": "object", + "description": "Request to verify SimSwap in period", + "properties": { + "phoneNumber": { + "type": "string", + "description": "Phone number in E.164 format (starting with country code), and optionally prefixed with '+'", + "pattern": "^\\+?[0-9]{5,15}$" + }, + "maxAgeHours": { + "type": "integer", + "format": "int32", + "description": "Maximum lookback for SimSwap verification", + "default": 240, + "minimum": 1, + "maximum": 2400 + }, + "networkIdentifier": { + "$ref": "#/definitions/NetworkIdentifier", + "description": "Identifier for the network to query for this device." + } + }, + "required": [ + "networkIdentifier" + ] + }, + "SimSwapVerificationResult": { + "type": "object", + "description": "Response verifying SimSwap in period", + "properties": { + "verificationResult": { + "type": "boolean", + "description": "True if the SIM has swapped in the specified period, False otherwise" + } + }, + "required": [ + "verificationResult" + ] + } + }, + "parameters": { + "ApcGatewayIdHeader": { + "name": "apc-gateway-id", + "in": "header", + "description": "The identifier of the APC Gateway resource which should handle this request.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-client-name": "apcGatewayId" + }, + "Azure.Core.ClientRequestIdHeader": { + "name": "x-ms-client-request-id", + "in": "header", + "description": "An opaque, globally-unique, client-generated string identifier for the request.", + "required": false, + "type": "string", + "format": "uuid", + "x-ms-parameter-location": "method", + "x-ms-client-name": "clientRequestId" + }, + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + } + } +} diff --git a/specification/programmableconnectivity/data-plane/readme.md b/specification/programmableconnectivity/data-plane/readme.md new file mode 100644 index 000000000000..9afcd7bc956b --- /dev/null +++ b/specification/programmableconnectivity/data-plane/readme.md @@ -0,0 +1,57 @@ +# Azure Programmable Connectivity + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Azure Programmable Connectivity. + +## Getting Started + +To build the SDKs for My API, simply install AutoRest via `npm` (`npm install -g autorest`) and then run: + +> `autorest readme.md` + +To see additional help and options, run: + +> `autorest --help` + +For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page. + +--- + +## Configuration + +### Basic Information + +These are the global settings for the Azure Programmable Connectivity. + +```yaml +openapi-type: data-plane +tag: package-2024-02-09-preview +title: AzureProgrammableConnectivity +``` + +### Tag: package-2024-02-09-preview + +These settings apply only when `--tag=package-2024-02-09-preview` is specified on the command line. + +```yaml $(tag) == 'package-2024-02-09-preview' +input-file: + - Azure.ProgrammableConnectivity/preview/2024-02-09-preview/openapi.json +suppressions: + - code: ValidResponseCodeRequired + reason: APC must return a 302 as part of a non-standard frontend authentication flow + where: $.paths./number-verification/number:verify.post.responses +``` + +# Code Generation + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python + - repo: azure-sdk-for-net-track2 +``` \ No newline at end of file