SimSwap.Retrieve Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Retrieve(String, SimSwapRetrievalContent, CancellationToken) |
Provides timestamp of latest SIM swap. |
Retrieve(String, RequestContent, RequestContext) |
[Protocol Method] Provides timestamp of latest SIM swap
|
Retrieve(String, SimSwapRetrievalContent, CancellationToken)
- Source:
- SimSwap.cs
Provides timestamp of latest SIM swap.
public virtual Azure.Response<Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalResult> Retrieve (string apcGatewayId, Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalContent simSwapRetrievalContent, System.Threading.CancellationToken cancellationToken = default);
abstract member Retrieve : string * Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalContent * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalResult>
override this.Retrieve : string * Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalContent * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalResult>
Public Overridable Function Retrieve (apcGatewayId As String, simSwapRetrievalContent As SimSwapRetrievalContent, Optional cancellationToken As CancellationToken = Nothing) As Response(Of SimSwapRetrievalResult)
Parameters
- apcGatewayId
- String
The identifier of the APC Gateway resource which should handle this request.
- simSwapRetrievalContent
- SimSwapRetrievalContent
Request to retrieve SimSwap date.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
apcGatewayId
or simSwapRetrievalContent
is null.
Examples
This sample shows how to call Retrieve.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview");
SimSwapRetrievalContent simSwapRetrievalContent = new SimSwapRetrievalContent(new NetworkIdentifier("<identifierType>", "<identifier>"));
Response<SimSwapRetrievalResult> response = client.Retrieve("<apcGatewayId>", simSwapRetrievalContent);
This sample shows how to call Retrieve with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview");
SimSwapRetrievalContent simSwapRetrievalContent = new SimSwapRetrievalContent(new NetworkIdentifier("<identifierType>", "<identifier>"))
{
PhoneNumber = "<phoneNumber>",
};
Response<SimSwapRetrievalResult> response = client.Retrieve("<apcGatewayId>", simSwapRetrievalContent);
Applies to
Retrieve(String, RequestContent, RequestContext)
- Source:
- SimSwap.cs
[Protocol Method] Provides timestamp of latest SIM swap
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler Retrieve(String, SimSwapRetrievalContent, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response Retrieve (string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member Retrieve : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.Retrieve : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function Retrieve (apcGatewayId As String, content As RequestContent, Optional context As RequestContext = Nothing) As Response
Parameters
- apcGatewayId
- String
The identifier of the APC Gateway resource which should handle this request.
- content
- RequestContent
The content to send as the body of the request.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
apcGatewayId
or content
is null.
Service returned a non-success status code.
Examples
This sample shows how to call Retrieve and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview");
using RequestContent content = RequestContent.Create(new
{
networkIdentifier = new
{
identifierType = "<identifierType>",
identifier = "<identifier>",
},
});
Response response = client.Retrieve("<apcGatewayId>", content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call Retrieve with all parameters and request content and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview");
using RequestContent content = RequestContent.Create(new
{
phoneNumber = "<phoneNumber>",
networkIdentifier = new
{
identifierType = "<identifierType>",
identifier = "<identifier>",
},
});
Response response = client.Retrieve("<apcGatewayId>", content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("date").ToString());
Applies to
Azure SDK for .NET