ReceivedSharesClient.Create(String, RequestContent, RequestContext) 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.
Create a received share in the given account.
public virtual Azure.Response Create (string receivedShareName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member Create : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.Create : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function Create (receivedShareName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Response
Parameters
- receivedShareName
- String
The name of the received share.
- content
- RequestContent
The content to send as the body of the request. Details of the request body schema are in the Remarks section below.
- 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. Details of the response body schema are in the Remarks section below.
Exceptions
receivedShareName
or content
is null.
receivedShareName
is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Examples
This sample shows how to call Create with required parameters and request content, and how to parse the result.
var credential = new DefaultAzureCredential();
var client = new ReceivedSharesClient("<https://my-service.azure.com>", credential);
var data = new {
shareKind = "InPlace",
properties = new {
collection = new {
referenceName = "<CollectionReferenceName>",
type = "<CollectionType>",
},
invitationId = "<InPlaceReceivedSharePropertiesInvitationId>",
sentShareLocation = "<InPlaceReceivedSharePropertiesSentShareLocation>",
},
};
Response response = client.Create("<receivedShareName>", RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call Create with all parameters and request content, and how to parse the result.
var credential = new DefaultAzureCredential();
var client = new ReceivedSharesClient("<https://my-service.azure.com>", credential);
var data = new {
shareKind = "InPlace",
properties = new {
collection = new {
referenceName = "<CollectionReferenceName>",
type = "<CollectionType>",
},
expirationDate = "<2022-05-10T14:57:31.2311892-04:00>",
invitationId = "<InPlaceReceivedSharePropertiesInvitationId>",
sentShareDescription = "<InPlaceReceivedSharePropertiesSentShareDescription>",
sentShareLocation = "<InPlaceReceivedSharePropertiesSentShareLocation>",
},
};
Response response = client.Create("<receivedShareName>", RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("shareKind").ToString());
Remarks
Create a received share
Below is the JSON schema for the request and response payloads.
Request Body:
InPlaceReceivedShare
Schema forInPlaceReceivedShare
:
{
shareKind: InPlace, # Required. Defines the supported types for share.
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
collection: {
referenceName: string, # Required. Gets or sets the reference name.
type: string, # Required. Gets or sets the reference type property.
}, # Required. Reference to a Collection.
createdAt: string (ISO 8601 Format), # Optional. Time at which the received share was created.
expirationDate: string (ISO 8601 Format), # Optional. The expiration date of the received share.
invitationId: string, # Required. The invitation id.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
receivedShareStatus: "Active" | "Reinstating" | "Revoked" | "Revoking" | "RevokeFailed" | "ReinstateFailed" | "SourceDeleted", # Optional. received share status
receiverEmail: string, # Optional. Email of the user/receiver who received the sent share invitation
receiverName: string, # Optional. Name of the user/receiver who received the sent share invitation
receiverTenantName: string, # Optional. Tenant name of the user/receiver who received the sent share invitation
senderEmail: string, # Optional. Email of the sender who created the sent share invitation
senderName: string, # Optional. Name of the sender who created the sent share invitation
senderTenantName: string, # Optional. Tenant name of the sender who created the sent share invitation
sentShareDescription: string, # Optional. Share description.
sentShareLocation: string, # Required. Sent share location.
sharedAt: string (ISO 8601 Format), # Optional. Time at which the sent share was shared.
shareName: string, # Optional. Name of the share
}, # Required. Properties of in place received share.
}
Response Body:
InPlaceReceivedShare
Schema forInPlaceReceivedShare
:
{
shareKind: InPlace, # Required. Defines the supported types for share.
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
collection: {
referenceName: string, # Required. Gets or sets the reference name.
type: string, # Required. Gets or sets the reference type property.
}, # Required. Reference to a Collection.
createdAt: string (ISO 8601 Format), # Optional. Time at which the received share was created.
expirationDate: string (ISO 8601 Format), # Optional. The expiration date of the received share.
invitationId: string, # Required. The invitation id.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
receivedShareStatus: "Active" | "Reinstating" | "Revoked" | "Revoking" | "RevokeFailed" | "ReinstateFailed" | "SourceDeleted", # Optional. received share status
receiverEmail: string, # Optional. Email of the user/receiver who received the sent share invitation
receiverName: string, # Optional. Name of the user/receiver who received the sent share invitation
receiverTenantName: string, # Optional. Tenant name of the user/receiver who received the sent share invitation
senderEmail: string, # Optional. Email of the sender who created the sent share invitation
senderName: string, # Optional. Name of the sender who created the sent share invitation
senderTenantName: string, # Optional. Tenant name of the sender who created the sent share invitation
sentShareDescription: string, # Optional. Share description.
sentShareLocation: string, # Required. Sent share location.
sharedAt: string (ISO 8601 Format), # Optional. Time at which the sent share was shared.
shareName: string, # Optional. Name of the share
}, # Required. Properties of in place received share.
}
Applies to
Azure SDK for .NET