Ejemplo n.º 1
0
        public async stt::Task GetVersionRequestObjectAsync()
        {
            moq::Mock <Versions.VersionsClient> mockGrpcClient = new moq::Mock <Versions.VersionsClient>(moq::MockBehavior.Strict);
            GetVersionRequest request = new GetVersionRequest
            {
                VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
            };
            Version expectedResponse = new Version
            {
                VersionName   = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
                Description   = "description2cf9da67",
                VersionNumber = -1567505473,
                CreateTime    = new wkt::Timestamp(),
                Status        = Version.Types.VersionStatus.Ready,
            };

            mockGrpcClient.Setup(x => x.GetVersionAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Version>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            VersionsClient client = new VersionsClientImpl(mockGrpcClient.Object, null);
            Version        responseCallSettings = await client.GetVersionAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Version responseCancellationToken = await client.GetVersionAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 2
0
        /// <summary>Snippet for LoadVersionAsync</summary>
        public async Task LoadVersionResourceNamesAsync()
        {
            // Snippet: LoadVersionAsync(VersionName, CallSettings)
            // Additional: LoadVersionAsync(VersionName, CancellationToken)
            // Create client
            VersionsClient versionsClient = await VersionsClient.CreateAsync();

            // Initialize request argument(s)
            VersionName name = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
            // Make the request
            Operation <Empty, Struct> response = await versionsClient.LoadVersionAsync(name);

            // Poll until the returned long-running operation is complete
            Operation <Empty, Struct> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Empty, Struct> retrievedResponse = await versionsClient.PollOnceLoadVersionAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Ejemplo n.º 3
0
        public async stt::Task GetDeploymentRequestObjectAsync()
        {
            moq::Mock <Deployments.DeploymentsClient> mockGrpcClient = new moq::Mock <Deployments.DeploymentsClient>(moq::MockBehavior.Strict);
            GetDeploymentRequest request = new GetDeploymentRequest
            {
                DeploymentName = DeploymentName.FromProjectLocationAgentEnvironmentDeployment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]"),
            };
            Deployment expectedResponse = new Deployment
            {
                DeploymentName           = DeploymentName.FromProjectLocationAgentEnvironmentDeployment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]"),
                FlowVersionAsVersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
                State     = Deployment.Types.State.Succeeded,
                Result    = new Deployment.Types.Result(),
                StartTime = new wkt::Timestamp(),
                EndTime   = new wkt::Timestamp(),
            };

            mockGrpcClient.Setup(x => x.GetDeploymentAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Deployment>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            DeploymentsClient client = new DeploymentsClientImpl(mockGrpcClient.Object, null);
            Deployment        responseCallSettings = await client.GetDeploymentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Deployment responseCancellationToken = await client.GetDeploymentAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 public override IDocEntity SaveChanges(bool ignoreCache, DocConstantPermission permission)
 {
     Description = Description?.TrimAndPruneSpaces();
     Release     = Release?.TrimAndPruneSpaces();
     VersionName = VersionName?.TrimAndPruneSpaces();
     return(base.SaveChanges(ignoreCache, permission));
 }
Ejemplo n.º 5
0
        public void UpdateEnvironmentRequestObject()
        {
            moq::Mock <Environments.EnvironmentsClient> mockGrpcClient = new moq::Mock <Environments.EnvironmentsClient>(moq::MockBehavior.Strict);
            UpdateEnvironmentRequest request = new UpdateEnvironmentRequest
            {
                Environment = new Environment(),
                UpdateMask  = new wkt::FieldMask(),
                AllowLoadToDraftAndDiscardChanges = true,
            };
            Environment expectedResponse = new Environment
            {
                EnvironmentName           = EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
                Description               = "description2cf9da67",
                AgentVersionAsVersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
                State                = Environment.Types.State.Loading,
                UpdateTime           = new wkt::Timestamp(),
                TextToSpeechSettings = new TextToSpeechSettings(),
                Fulfillment          = new Fulfillment(),
            };

            mockGrpcClient.Setup(x => x.UpdateEnvironment(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            EnvironmentsClient client   = new EnvironmentsClientImpl(mockGrpcClient.Object, null);
            Environment        response = client.UpdateEnvironment(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 6
0
        public HttpResponseMessage HaveNewerVersion()
        {
            ATISMobileWebApi WebAPi = new ATISMobileWebApi();

            try
            {
                //تایید اعتبار کلاینت
                WebAPi.AuthenticateClient(Request, ATISMobileWebApiLogTypes.WebApiClientVersionControlRequest);

                string WebApiVersionNumber = File.ReadAllText(HttpContext.Current.Server.MapPath("~/App_Data/NewerVersionInfo.txt"), Encoding.UTF8).Split(';')[0].Split(':')[1].Trim();
                string WebApiVersionName   = File.ReadAllText(HttpContext.Current.Server.MapPath("~/App_Data/NewerVersionInfo.txt"), Encoding.UTF8).Split(';')[1].Split(':')[1].Trim();
                Request.Headers.TryGetValues("VersionNumber", out IEnumerable <string> VersionNumber);
                Request.Headers.TryGetValues("VersionName", out IEnumerable <string> VersionName);
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
                if (VersionNumber.FirstOrDefault().Trim() != WebApiVersionNumber || VersionName.FirstOrDefault().Trim() != WebApiVersionName)
                {
                    response.Content = new StringContent(JsonConvert.SerializeObject(Boolean.TrueString), Encoding.UTF8, "application/json");
                }
                else
                {
                    response.Content = new StringContent(JsonConvert.SerializeObject(Boolean.FalseString), Encoding.UTF8, "application/json");
                }
                return(response);
            }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }
Ejemplo n.º 7
0
        public async stt::Task GetEnvironmentRequestObjectAsync()
        {
            moq::Mock <Environments.EnvironmentsClient> mockGrpcClient = new moq::Mock <Environments.EnvironmentsClient>(moq::MockBehavior.Strict);
            GetEnvironmentRequest request = new GetEnvironmentRequest
            {
                EnvironmentName = EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
            };
            Environment expectedResponse = new Environment
            {
                EnvironmentName           = EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
                Description               = "description2cf9da67",
                AgentVersionAsVersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
                State                = Environment.Types.State.Loading,
                UpdateTime           = new wkt::Timestamp(),
                TextToSpeechSettings = new TextToSpeechSettings(),
                Fulfillment          = new Fulfillment(),
            };

            mockGrpcClient.Setup(x => x.GetEnvironmentAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Environment>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            EnvironmentsClient client = new EnvironmentsClientImpl(mockGrpcClient.Object, null);
            Environment        responseCallSettings = await client.GetEnvironmentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Environment responseCancellationToken = await client.GetEnvironmentAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 8
0
        public async stt::Task CompareVersionsResourceNamesAsync()
        {
            moq::Mock <Versions.VersionsClient> mockGrpcClient = new moq::Mock <Versions.VersionsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            CompareVersionsRequest request = new CompareVersionsRequest
            {
                BaseVersionAsVersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
            };
            CompareVersionsResponse expectedResponse = new CompareVersionsResponse
            {
                BaseVersionContentJson   = "base_version_content_json6279f098",
                TargetVersionContentJson = "target_version_content_jsonf76c0cf2",
                CompareTime = new wkt::Timestamp(),
            };

            mockGrpcClient.Setup(x => x.CompareVersionsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <CompareVersionsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            VersionsClient          client = new VersionsClientImpl(mockGrpcClient.Object, null);
            CompareVersionsResponse responseCallSettings = await client.CompareVersionsAsync(request.BaseVersionAsVersionName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            CompareVersionsResponse responseCancellationToken = await client.CompareVersionsAsync(request.BaseVersionAsVersionName, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task GetVersionRequestObjectAsync()
        {
            moq::Mock <Versions.VersionsClient> mockGrpcClient = new moq::Mock <Versions.VersionsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetVersionRequest request = new GetVersionRequest
            {
                VersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
            };
            Version expectedResponse = new Version
            {
                VersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
                DisplayName = "display_name137f65c2",
                Description = "description2cf9da67",
                NluSettings = new NluSettings(),
                CreateTime  = new wkt::Timestamp(),
                State       = Version.Types.State.Succeeded,
            };

            mockGrpcClient.Setup(x => x.GetVersionAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Version>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            VersionsClient client = new VersionsClientImpl(mockGrpcClient.Object, null);
            Version        responseCallSettings = await client.GetVersionAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Version responseCancellationToken = await client.GetVersionAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Returns runtime output folder for this version name and number.
        /// </summary>
        /// <returns>
        /// A <see cref="T:system.String"/> that contains runtime output folder.
        /// </returns>
        public string RuntimeOutputFolder()
        {
            bool isNetFramework = VersionName.Contains("NETFramework");

            if (isNetFramework)
            {
                return($"net{VersionNumber.Replace(".", string.Empty)}");
            }

            bool isNetStandard = VersionName.Contains("NETStandard");

            if (isNetStandard)
            {
                return($"netstandard{VersionNumber}");
            }

            bool isNetCore = VersionName.Contains("NETCore");

            if (isNetCore)
            {
                return($"netcoreapp{VersionNumber}");
            }

            bool isUAP = VersionName.Contains("UniversalWindowsPlatform");

            if (isUAP)
            {
                return($"uap{VersionNumber}");
            }

            bool isWindowsPhone = VersionName.Contains("WindowsPhone");

            if (isWindowsPhone)
            {
                return($"wp{VersionNumber.Replace(".", string.Empty)}");
            }

            bool isWindowsStore = VersionName.Contains("WindowsStore");

            if (isWindowsStore)
            {
                return($"netcore{VersionNumber.Replace(".", string.Empty)}");
            }

            bool isMicroFramework = VersionName.Contains("NETMicroFramework");

            if (isMicroFramework)
            {
                return($"netmf{VersionNumber.Replace(".", string.Empty)}");
            }

            bool isSilverlight = VersionName.Contains("Silverlight");

            if (isSilverlight)
            {
                return($"sl{VersionNumber.Replace(".", string.Empty)}");
            }

            return(string.Empty);
        }
        public void GetVersion()
        {
            moq::Mock <Versions.VersionsClient> mockGrpcClient = new moq::Mock <Versions.VersionsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetVersionRequest request = new GetVersionRequest
            {
                VersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
            };
            Version expectedResponse = new Version
            {
                VersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
                DisplayName = "display_name137f65c2",
                Description = "description2cf9da67",
                NluSettings = new NluSettings(),
                CreateTime  = new wkt::Timestamp(),
                State       = Version.Types.State.Succeeded,
            };

            mockGrpcClient.Setup(x => x.GetVersion(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            VersionsClient client   = new VersionsClientImpl(mockGrpcClient.Object, null);
            Version        response = client.GetVersion(request.Name);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 12
0
        /// <summary>Snippet for LoadVersion</summary>
        public void LoadVersionRequestObject()
        {
            // Snippet: LoadVersion(LoadVersionRequest, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            LoadVersionRequest request = new LoadVersionRequest
            {
                VersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
                AllowOverrideAgentResources = false,
            };
            // Make the request
            Operation <Empty, Struct> response = versionsClient.LoadVersion(request);

            // Poll until the returned long-running operation is complete
            Operation <Empty, Struct> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Empty, Struct> retrievedResponse = versionsClient.PollOnceLoadVersion(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Ejemplo n.º 13
0
        public void CompareVersionsRequestObject()
        {
            moq::Mock <Versions.VersionsClient> mockGrpcClient = new moq::Mock <Versions.VersionsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            CompareVersionsRequest request = new CompareVersionsRequest
            {
                BaseVersionAsVersionName   = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
                TargetVersionAsVersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
                LanguageCode = "language_code2f6c7160",
            };
            CompareVersionsResponse expectedResponse = new CompareVersionsResponse
            {
                BaseVersionContentJson   = "base_version_content_json6279f098",
                TargetVersionContentJson = "target_version_content_jsonf76c0cf2",
                CompareTime = new wkt::Timestamp(),
            };

            mockGrpcClient.Setup(x => x.CompareVersions(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            VersionsClient          client   = new VersionsClientImpl(mockGrpcClient.Object, null);
            CompareVersionsResponse response = client.CompareVersions(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 14
0
        public void CreateEnvironmentRequestObject()
        {
            moq::Mock <Environments.EnvironmentsClient> mockGrpcClient = new moq::Mock <Environments.EnvironmentsClient>(moq::MockBehavior.Strict);
            CreateEnvironmentRequest request = new CreateEnvironmentRequest
            {
                ParentAsAgentName = AgentName.FromProject("[PROJECT]"),
                Environment       = new Environment(),
                EnvironmentId     = "environment_id26e3069e",
            };
            Environment expectedResponse = new Environment
            {
                EnvironmentName           = EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
                Description               = "description2cf9da67",
                AgentVersionAsVersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
                State                = Environment.Types.State.Loading,
                UpdateTime           = new wkt::Timestamp(),
                TextToSpeechSettings = new TextToSpeechSettings(),
                Fulfillment          = new Fulfillment(),
            };

            mockGrpcClient.Setup(x => x.CreateEnvironment(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            EnvironmentsClient client   = new EnvironmentsClientImpl(mockGrpcClient.Object, null);
            Environment        response = client.CreateEnvironment(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 15
0
 public Card(int number, int cost, bool portion, string name, VersionName version)
 {
     Number  = number;
     Cost    = cost;
     Portion = portion;
     Name    = name;
     Version = version;
 }
Ejemplo n.º 16
0
        public VersionItem CreateVersionItem(Assembly bundleAssembly, VersionCode versionCode)
        {
            VersionName versionName = CreateVersionName(versionCode);

            VersionItem versionItem = BundleSourceFor(bundleAssembly, versionName);

            return(versionItem);
        }
Ejemplo n.º 17
0
        protected IBundleProfile BundleSourceFor(Assembly bundleAssembly, VersionName symbolName)
        {
            string symbolClass = ClassNameFor(symbolName);

            string targetClass = "";

            return(GeneralClazzFactory <IBundleProfile> .InstanceFor(bundleAssembly, NAME_SPACE_PREFIX, symbolClass, targetClass));
        }
Ejemplo n.º 18
0
 private static void GetVersion()
 {
     using (var ctx = new DBEntities())
     {
         long vCode = ctx.overal_setting.Where(o => o.id == 64).Select(o => o.value).FirstOrDefault();
         ProgramVersion = (VersionName)vCode;
     }
 }
Ejemplo n.º 19
0
 public Card(int number, int cost, bool portion, string name, VersionName version)
 {
     Number = number;
     Cost = cost;
     Portion = portion;
     Name = name;
     Version = version;
 }
 /// <summary>Snippet for CompareVersions</summary>
 public void CompareVersionsResourceNames()
 {
     // Snippet: CompareVersions(VersionName, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     VersionName baseVersion = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
     // Make the request
     CompareVersionsResponse response = versionsClient.CompareVersions(baseVersion);
     // End snippet
 }
Ejemplo n.º 21
0
 /// <summary>Snippet for GetVersion</summary>
 public void GetVersionResourceNames()
 {
     // Snippet: GetVersion(VersionName, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     VersionName name = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
     // Make the request
     gcdcv::Version response = versionsClient.GetVersion(name);
     // End snippet
 }
        /// <summary>Snippet for DeleteVersion</summary>
        public void DeleteVersionResourceNames()
        {
            // Snippet: DeleteVersion(VersionName, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            VersionName name = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]");

            // Make the request
            versionsClient.DeleteVersion(name);
            // End snippet
        }
        /// <summary>Snippet for GetVersionAsync</summary>
        public async Task GetVersionResourceNamesAsync()
        {
            // Snippet: GetVersionAsync(VersionName, CallSettings)
            // Additional: GetVersionAsync(VersionName, CancellationToken)
            // Create client
            VersionsClient versionsClient = await VersionsClient.CreateAsync();

            // Initialize request argument(s)
            VersionName name = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]");
            // Make the request
            gcdv::Version response = await versionsClient.GetVersionAsync(name);

            // End snippet
        }
Ejemplo n.º 24
0
        /// <summary>Snippet for DeleteVersionAsync</summary>
        public async Task DeleteVersionResourceNamesAsync()
        {
            // Snippet: DeleteVersionAsync(VersionName, CallSettings)
            // Additional: DeleteVersionAsync(VersionName, CancellationToken)
            // Create client
            VersionsClient versionsClient = await VersionsClient.CreateAsync();

            // Initialize request argument(s)
            VersionName name = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
            // Make the request
            await versionsClient.DeleteVersionAsync(name);

            // End snippet
        }
Ejemplo n.º 25
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = PackageName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Label?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (VersionName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ VersionCode.GetHashCode();
         hashCode = (hashCode * 397) ^ MinSdkVersion;
         hashCode = (hashCode * 397) ^ TargetSdkVersion;
         hashCode = (hashCode * 397) ^ ScreenSupport.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 26
0
 /// <summary>Snippet for GetVersion</summary>
 public void GetVersionRequestObject()
 {
     // Snippet: GetVersion(GetVersionRequest, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     GetVersionRequest request = new GetVersionRequest
     {
         VersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
     };
     // Make the request
     gcdcv::Version response = versionsClient.GetVersion(request);
     // End snippet
 }
Ejemplo n.º 27
0
        /// <summary>
        /// VersionName型から対象のOSバージョン情報を生成
        /// </summary>
        /// <param name="version"></param>
        private void CreateInstance(VersionName version)
        {
            OSVersion osver = Windows10Versions.FirstOrDefault(x => x.Version == version);

            this.Version            = osver.Version;
            this.Name               = osver.Name;
            this.Alias              = osver.Alias;
            this.CodeName           = osver.CodeName;
            this.BuildNumber        = osver.BuildNumber;
            this.FullVersion        = osver.FullVersion;
            this.ReleaseDate        = osver.ReleaseDate;
            this.EndSupport_HomePro = osver.EndSupport_HomePro;
            this.EndSupport_EntEdu  = osver.EndSupport_EntEdu;
            this.EndSupport_LTS     = osver.EndSupport_LTS;
        }
        /// <summary>Snippet for DeleteVersion</summary>
        public void DeleteVersionRequestObject()
        {
            // Snippet: DeleteVersion(DeleteVersionRequest, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            DeleteVersionRequest request = new DeleteVersionRequest
            {
                VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
            };

            // Make the request
            versionsClient.DeleteVersion(request);
            // End snippet
        }
 public bool FitsFilter(string[] keywords)
 {
     FilteredContracts.Clear();
     VersionContracts.ForEach(contract =>
     {
         if (contract.FitsFilter(keywords))
         {
             FilteredContracts.Add(contract);
         }
     });
     if (FilteredContracts.Count == 0)
     {
         VersionContracts.ForEach(contract =>
         {
             FilteredContracts.Add(contract);
         });
     }
     return(keywords.All(key =>
     {
         if (Version.Contains(key, StringComparison.InvariantCultureIgnoreCase))
         {
             return true;
         }
         if (BuildVersion.Contains(key, StringComparison.InvariantCultureIgnoreCase))
         {
             return true;
         }
         if (VersionName.Contains(key, StringComparison.InvariantCultureIgnoreCase))
         {
             return true;
         }
         if (MarketingName.Contains(key, StringComparison.InvariantCultureIgnoreCase))
         {
             return true;
         }
         if (CodeName.Contains(key, StringComparison.InvariantCultureIgnoreCase))
         {
             return true;
         }
         if (FilteredContractsCount(key) > 0)
         {
             return true;
         }
         // No matches, return false
         return false;
     }
                         ));
 }
Ejemplo n.º 30
0
        public void DeleteVersionResourceNames()
        {
            moq::Mock <Versions.VersionsClient> mockGrpcClient = new moq::Mock <Versions.VersionsClient>(moq::MockBehavior.Strict);
            DeleteVersionRequest request = new DeleteVersionRequest
            {
                VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteVersion(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            VersionsClient client = new VersionsClientImpl(mockGrpcClient.Object, null);

            client.DeleteVersion(request.VersionName);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for CompareVersions</summary>
 public void CompareVersionsRequestObject()
 {
     // Snippet: CompareVersions(CompareVersionsRequest, CallSettings)
     // Create client
     VersionsClient versionsClient = VersionsClient.Create();
     // Initialize request argument(s)
     CompareVersionsRequest request = new CompareVersionsRequest
     {
         BaseVersionAsVersionName   = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
         TargetVersionAsVersionName = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"),
         LanguageCode = "",
     };
     // Make the request
     CompareVersionsResponse response = versionsClient.CompareVersions(request);
     // End snippet
 }