< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.RestResourceDataset
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\RestResourceDataset.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\RestResourceDataset.Serialization.cs
Covered lines:0
Uncovered lines:137
Coverable lines:137
Total lines:273
Line coverage:0% (0 of 137)
Covered branches:0
Total branches:70
Branch coverage:0% (0 of 70)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_RelativeUrl()-0%100%
get_RequestMethod()-0%100%
get_RequestBody()-0%100%
get_AdditionalHeaders()-0%100%
get_PaginationRules()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeRestResourceDataset(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\RestResourceDataset.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.Analytics.Synapse.Artifacts.Models
 12{
 13    /// <summary> A Rest service dataset. </summary>
 14    public partial class RestResourceDataset : Dataset
 15    {
 16        /// <summary> Initializes a new instance of RestResourceDataset. </summary>
 17        /// <param name="linkedServiceName"> Linked service reference. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="linkedServiceName"/> is null. </exception>
 019        public RestResourceDataset(LinkedServiceReference linkedServiceName) : base(linkedServiceName)
 20        {
 021            if (linkedServiceName == null)
 22            {
 023                throw new ArgumentNullException(nameof(linkedServiceName));
 24            }
 25
 026            Type = "RestResource";
 027        }
 28
 29        /// <summary> Initializes a new instance of RestResourceDataset. </summary>
 30        /// <param name="type"> Type of dataset. </param>
 31        /// <param name="description"> Dataset description. </param>
 32        /// <param name="structure"> Columns that define the structure of the dataset. Type: array (or Expression with r
 33        /// <param name="schema"> Columns that define the physical type schema of the dataset. Type: array (or Expressio
 34        /// <param name="linkedServiceName"> Linked service reference. </param>
 35        /// <param name="parameters"> Parameters for dataset. </param>
 36        /// <param name="annotations"> List of tags that can be used for describing the Dataset. </param>
 37        /// <param name="folder"> The folder that this Dataset is in. If not specified, Dataset will appear at the root 
 38        /// <param name="additionalProperties"> . </param>
 39        /// <param name="relativeUrl"> The relative URL to the resource that the RESTful API provides. Type: string (or 
 40        /// <param name="requestMethod"> The HTTP method used to call the RESTful API. The default is GET. Type: string 
 41        /// <param name="requestBody"> The HTTP request body to the RESTful API if requestMethod is POST. Type: string (
 42        /// <param name="additionalHeaders"> The additional HTTP headers in the request to the RESTful API. Type: string
 43        /// <param name="paginationRules"> The pagination rules to compose next page requests. Type: string (or Expressi
 044        internal RestResourceDataset(string type, string description, object structure, object schema, LinkedServiceRefe
 45        {
 046            RelativeUrl = relativeUrl;
 047            RequestMethod = requestMethod;
 048            RequestBody = requestBody;
 049            AdditionalHeaders = additionalHeaders;
 050            PaginationRules = paginationRules;
 051            Type = type ?? "RestResource";
 052        }
 53
 54        /// <summary> The relative URL to the resource that the RESTful API provides. Type: string (or Expression with r
 055        public object RelativeUrl { get; set; }
 56        /// <summary> The HTTP method used to call the RESTful API. The default is GET. Type: string (or Expression with
 057        public object RequestMethod { get; set; }
 58        /// <summary> The HTTP request body to the RESTful API if requestMethod is POST. Type: string (or Expression wit
 059        public object RequestBody { get; set; }
 60        /// <summary> The additional HTTP headers in the request to the RESTful API. Type: string (or Expression with re
 061        public object AdditionalHeaders { get; set; }
 62        /// <summary> The pagination rules to compose next page requests. Type: string (or Expression with resultType st
 063        public object PaginationRules { get; set; }
 64    }
 65}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\RestResourceDataset.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Analytics.Synapse.Artifacts.Models
 13{
 14    public partial class RestResourceDataset : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("type");
 020            writer.WriteStringValue(Type);
 021            if (Optional.IsDefined(Description))
 22            {
 023                writer.WritePropertyName("description");
 024                writer.WriteStringValue(Description);
 25            }
 026            if (Optional.IsDefined(Structure))
 27            {
 028                writer.WritePropertyName("structure");
 029                writer.WriteObjectValue(Structure);
 30            }
 031            if (Optional.IsDefined(Schema))
 32            {
 033                writer.WritePropertyName("schema");
 034                writer.WriteObjectValue(Schema);
 35            }
 036            writer.WritePropertyName("linkedServiceName");
 037            writer.WriteObjectValue(LinkedServiceName);
 038            if (Optional.IsCollectionDefined(Parameters))
 39            {
 040                writer.WritePropertyName("parameters");
 041                writer.WriteStartObject();
 042                foreach (var item in Parameters)
 43                {
 044                    writer.WritePropertyName(item.Key);
 045                    writer.WriteObjectValue(item.Value);
 46                }
 047                writer.WriteEndObject();
 48            }
 049            if (Optional.IsCollectionDefined(Annotations))
 50            {
 051                writer.WritePropertyName("annotations");
 052                writer.WriteStartArray();
 053                foreach (var item in Annotations)
 54                {
 055                    writer.WriteObjectValue(item);
 56                }
 057                writer.WriteEndArray();
 58            }
 059            if (Optional.IsDefined(Folder))
 60            {
 061                writer.WritePropertyName("folder");
 062                writer.WriteObjectValue(Folder);
 63            }
 064            writer.WritePropertyName("typeProperties");
 065            writer.WriteStartObject();
 066            if (Optional.IsDefined(RelativeUrl))
 67            {
 068                writer.WritePropertyName("relativeUrl");
 069                writer.WriteObjectValue(RelativeUrl);
 70            }
 071            if (Optional.IsDefined(RequestMethod))
 72            {
 073                writer.WritePropertyName("requestMethod");
 074                writer.WriteObjectValue(RequestMethod);
 75            }
 076            if (Optional.IsDefined(RequestBody))
 77            {
 078                writer.WritePropertyName("requestBody");
 079                writer.WriteObjectValue(RequestBody);
 80            }
 081            if (Optional.IsDefined(AdditionalHeaders))
 82            {
 083                writer.WritePropertyName("additionalHeaders");
 084                writer.WriteObjectValue(AdditionalHeaders);
 85            }
 086            if (Optional.IsDefined(PaginationRules))
 87            {
 088                writer.WritePropertyName("paginationRules");
 089                writer.WriteObjectValue(PaginationRules);
 90            }
 091            writer.WriteEndObject();
 092            foreach (var item in AdditionalProperties)
 93            {
 094                writer.WritePropertyName(item.Key);
 095                writer.WriteObjectValue(item.Value);
 96            }
 097            writer.WriteEndObject();
 098        }
 99
 100        internal static RestResourceDataset DeserializeRestResourceDataset(JsonElement element)
 101        {
 0102            string type = default;
 0103            Optional<string> description = default;
 0104            Optional<object> structure = default;
 0105            Optional<object> schema = default;
 0106            LinkedServiceReference linkedServiceName = default;
 0107            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 0108            Optional<IList<object>> annotations = default;
 0109            Optional<DatasetFolder> folder = default;
 0110            Optional<object> relativeUrl = default;
 0111            Optional<object> requestMethod = default;
 0112            Optional<object> requestBody = default;
 0113            Optional<object> additionalHeaders = default;
 0114            Optional<object> paginationRules = default;
 0115            IDictionary<string, object> additionalProperties = default;
 0116            Dictionary<string, object> additionalPropertiesDictionary = default;
 0117            foreach (var property in element.EnumerateObject())
 118            {
 0119                if (property.NameEquals("type"))
 120                {
 0121                    type = property.Value.GetString();
 0122                    continue;
 123                }
 0124                if (property.NameEquals("description"))
 125                {
 0126                    description = property.Value.GetString();
 0127                    continue;
 128                }
 0129                if (property.NameEquals("structure"))
 130                {
 0131                    structure = property.Value.GetObject();
 0132                    continue;
 133                }
 0134                if (property.NameEquals("schema"))
 135                {
 0136                    schema = property.Value.GetObject();
 0137                    continue;
 138                }
 0139                if (property.NameEquals("linkedServiceName"))
 140                {
 0141                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0142                    continue;
 143                }
 0144                if (property.NameEquals("parameters"))
 145                {
 0146                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0147                    foreach (var property0 in property.Value.EnumerateObject())
 148                    {
 0149                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 150                    }
 0151                    parameters = dictionary;
 0152                    continue;
 153                }
 0154                if (property.NameEquals("annotations"))
 155                {
 0156                    List<object> array = new List<object>();
 0157                    foreach (var item in property.Value.EnumerateArray())
 158                    {
 0159                        array.Add(item.GetObject());
 160                    }
 0161                    annotations = array;
 0162                    continue;
 163                }
 0164                if (property.NameEquals("folder"))
 165                {
 0166                    folder = DatasetFolder.DeserializeDatasetFolder(property.Value);
 0167                    continue;
 168                }
 0169                if (property.NameEquals("typeProperties"))
 170                {
 0171                    foreach (var property0 in property.Value.EnumerateObject())
 172                    {
 0173                        if (property0.NameEquals("relativeUrl"))
 174                        {
 0175                            relativeUrl = property0.Value.GetObject();
 0176                            continue;
 177                        }
 0178                        if (property0.NameEquals("requestMethod"))
 179                        {
 0180                            requestMethod = property0.Value.GetObject();
 0181                            continue;
 182                        }
 0183                        if (property0.NameEquals("requestBody"))
 184                        {
 0185                            requestBody = property0.Value.GetObject();
 0186                            continue;
 187                        }
 0188                        if (property0.NameEquals("additionalHeaders"))
 189                        {
 0190                            additionalHeaders = property0.Value.GetObject();
 0191                            continue;
 192                        }
 0193                        if (property0.NameEquals("paginationRules"))
 194                        {
 0195                            paginationRules = property0.Value.GetObject();
 196                            continue;
 197                        }
 198                    }
 199                    continue;
 200                }
 0201                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0202                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 203            }
 0204            additionalProperties = additionalPropertiesDictionary;
 0205            return new RestResourceDataset(type, description.Value, structure.Value, schema.Value, linkedServiceName, Op
 206        }
 207    }
 208}