/// <summary> /// Initializes a new instance of the <see cref="ObjectAnchorsConversionClient" /> class. /// </summary> /// <param name="accountId">The Azure Object Anchors account ID.</param> /// <param name="accountDomain">The Azure Object Anchors account domain.</param> /// <param name="keyCredential">The Azure Object Anchors account primary or secondary key credential.</param> /// <param name="options">The options.</param> public ObjectAnchorsConversionClient(Guid accountId, string accountDomain, AzureKeyCredential keyCredential, ObjectAnchorsConversionClientOptions options) : this(accountId, accountDomain, new MixedRealityAccountKeyCredential(accountId, keyCredential), options) { }
/// <summary> /// Initializes a new instance of the <see cref="ObjectAnchorsConversionClient" /> class. /// </summary> /// <param name="accountId">The Azure Object Anchors account ID.</param> /// <param name="accountDomain">The Azure Object Anchors account domain.</param> /// <param name="token">An access token used to access the specified Azure Object Anchors account.</param> /// <param name="options">The options.</param> public ObjectAnchorsConversionClient(Guid accountId, string accountDomain, AccessToken token, ObjectAnchorsConversionClientOptions options = null) : this(accountId, accountDomain, new StaticAccessTokenCredential(token), options) { }
/// <summary> /// Initializes a new instance of the <see cref="ObjectAnchorsConversionClient" /> class. /// </summary> /// <param name="accountId">The Azure Object Anchors account ID.</param> /// <param name="accountDomain">The Azure Object Anchors account domain.</param> /// <param name="credential">The credential used to access the Mixed Reality service.</param> /// <param name="options">The options.</param> public ObjectAnchorsConversionClient(Guid accountId, string accountDomain, TokenCredential credential, ObjectAnchorsConversionClientOptions options = null) { Argument.AssertNotDefault(ref accountId, nameof(accountId)); Argument.AssertNotNullOrWhiteSpace(accountDomain, nameof(accountDomain)); Argument.AssertNotNull(credential, nameof(credential)); options = options ?? new ObjectAnchorsConversionClientOptions(); Uri authenticationEndpoint = options.MixedRealityAuthenticationEndpoint ?? AuthenticationEndpoint.ConstructFromDomain(accountDomain); TokenCredential mrTokenCredential = MixedRealityTokenCredential.GetMixedRealityCredential(accountId, authenticationEndpoint, credential, options.MixedRealityAuthenticationOptions); Uri serviceEndpoint = options.ServiceEndpoint ?? ConstructObjectAnchorsEndpointUrl(accountDomain); AccountId = accountId; SupportedAssetFileTypesSet = options.SupportedAssetFileTypes; _clientDiagnostics = new ClientDiagnostics(options); _pipeline = HttpPipelineBuilder.Build(options, new BearerTokenAuthenticationPolicy(mrTokenCredential, GetDefaultScope(serviceEndpoint))); _getBlobUploadEndpointRestClient = new BlobUploadEndpointRestClient(_clientDiagnostics, _pipeline, serviceEndpoint, options.Version); _ingestionJobRestClient = new IngestionJobRestClient(_clientDiagnostics, _pipeline, serviceEndpoint, options.Version); }