SentSharesClient.CreateOrUpdate メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
特定の Purview アカウントで送信済み共有を作成します。
public virtual Azure.Response CreateOrUpdate (string sentShareName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member CreateOrUpdate : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.CreateOrUpdate : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function CreateOrUpdate (sentShareName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Response
パラメーター
- sentShareName
- String
送信された共有の名前。
- content
- RequestContent
要求の本文として送信するコンテンツ。 要求本文スキーマの詳細については、以下の「解説」セクションを参照してください。
- context
- RequestContext
要求コンテキスト。これは、クライアント パイプラインの既定の動作を呼び出しごとにオーバーライドできます。
戻り値
サービスから返された応答。 応答本文スキーマの詳細については、以下の「解説」セクションを参照してください。
例外
sentShareName
または content
が null です。
sentShareName
は空の文字列であり、空でないと予想されていました。
サービスから成功以外の状態コードが返されました。
例
このサンプルでは、必要なパラメーターと要求コンテンツを使用して CreateOrUpdate を呼び出す方法と、結果を解析する方法を示します。
var credential = new DefaultAzureCredential();
var client = new SentSharesClient("<https://my-service.azure.com>", credential);
var data = new {
shareKind = "InPlace",
properties = new {
collection = new {
referenceName = "<CollectionReferenceName>",
type = "<CollectionType>",
},
},
};
Response response = client.CreateOrUpdate("<sentShareName>", RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
このサンプルでは、すべてのパラメーターと要求コンテンツを使用して CreateOrUpdate を呼び出す方法と、結果を解析する方法を示します。
var credential = new DefaultAzureCredential();
var client = new SentSharesClient("<https://my-service.azure.com>", credential);
var data = new {
shareKind = "InPlace",
properties = new {
collection = new {
referenceName = "<CollectionReferenceName>",
type = "<CollectionType>",
},
description = "<InPlaceSentSharePropertiesDescription>",
},
};
Response response = client.CreateOrUpdate("<sentShareName>", 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());
注釈
送信された共有を作成する
要求と応答のペイロードの JSON スキーマを次に示します。
要求本文:
InPlaceSentShare
のInPlaceSentShare
スキーマ:{
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 share was created.
description: string, # Optional. Share description.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
senderEmail: string, # Optional. Email of the sender who created the sent share.
senderName: string, # Optional. Name of the sender who created the sent share.
senderTenantName: string, # Optional. Tenant name of the sender who created the sent share.
}, # Required. Properties of in place sent share.
}
応答本文:
InPlaceSentShare
のInPlaceSentShare
スキーマ:{
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 share was created.
description: string, # Optional. Share description.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
senderEmail: string, # Optional. Email of the sender who created the sent share.
senderName: string, # Optional. Name of the sender who created the sent share.
senderTenantName: string, # Optional. Tenant name of the sender who created the sent share.
}, # Required. Properties of in place sent share.
}
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
Azure SDK for .NET