< Summary

Class:Azure.AI.FormRecognizer.Models.CopyRequest
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyRequest.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyRequest.Serialization.cs
Covered lines:20
Uncovered lines:3
Coverable lines:23
Total lines:74
Line coverage:86.9% (20 of 23)
Covered branches:3
Total branches:6
Branch coverage:50% (3 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-72.73%50%
get_TargetResourceId()-100%100%
get_TargetResourceRegion()-100%100%
get_CopyAuthorization()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyRequest.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9
 10namespace Azure.AI.FormRecognizer.Models
 11{
 12    /// <summary> Request parameter to copy an existing custom model from the source resource to a target resource refer
 13    internal partial class CopyRequest
 14    {
 15        /// <summary> Initializes a new instance of CopyRequest. </summary>
 16        /// <param name="targetResourceId"> Azure Resource Id of the target Form Recognizer resource where the model is 
 17        /// <param name="targetResourceRegion"> Location of the target Azure resource. A valid Azure region name support
 18        /// <param name="copyAuthorization"> Entity that encodes claims to authorize the copy request. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="targetResourceId"/>, <paramref name="targetResource
 1220        public CopyRequest(string targetResourceId, string targetResourceRegion, CopyAuthorizationResult copyAuthorizati
 21        {
 1222            if (targetResourceId == null)
 23            {
 024                throw new ArgumentNullException(nameof(targetResourceId));
 25            }
 1226            if (targetResourceRegion == null)
 27            {
 028                throw new ArgumentNullException(nameof(targetResourceRegion));
 29            }
 1230            if (copyAuthorization == null)
 31            {
 032                throw new ArgumentNullException(nameof(copyAuthorization));
 33            }
 34
 1235            TargetResourceId = targetResourceId;
 1236            TargetResourceRegion = targetResourceRegion;
 1237            CopyAuthorization = copyAuthorization;
 1238        }
 39
 40        /// <summary> Azure Resource Id of the target Form Recognizer resource where the model is copied to. </summary>
 1241        public string TargetResourceId { get; }
 42        /// <summary> Location of the target Azure resource. A valid Azure region name supported by Cognitive Services. 
 1243        public string TargetResourceRegion { get; }
 44        /// <summary> Entity that encodes claims to authorize the copy request. </summary>
 1245        public CopyAuthorizationResult CopyAuthorization { get; }
 46    }
 47}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyRequest.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.AI.FormRecognizer.Models
 12{
 13    internal partial class CopyRequest : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1217            writer.WriteStartObject();
 1218            writer.WritePropertyName("targetResourceId");
 1219            writer.WriteStringValue(TargetResourceId);
 1220            writer.WritePropertyName("targetResourceRegion");
 1221            writer.WriteStringValue(TargetResourceRegion);
 1222            writer.WritePropertyName("copyAuthorization");
 1223            writer.WriteObjectValue(CopyAuthorization);
 1224            writer.WriteEndObject();
 1225        }
 26    }
 27}