Skip to content

Commit

Permalink
First generation of AutoML
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Sep 24, 2019
1 parent 0d57744 commit ba7dfdd
Show file tree
Hide file tree
Showing 27 changed files with 17,346 additions and 0 deletions.

Large diffs are not rendered by default.

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.1</TargetFrameworks>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
<AssemblyOriginatorKeyFile>../../GoogleApis.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>1701;1702;1705;xUnit2004;xUnit2013;AD0001</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Google.Cloud.AutoML.V1\Google.Cloud.AutoML.V1.csproj" />
<ProjectReference Include="..\..\..\tools\Google.Cloud.ClientTesting\Google.Cloud.ClientTesting.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Moq" Version="4.12.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Xunit.SkippableFact" Version="1.3.12" />
<Analyzer Condition="Exists('..\..\..\tools\Google.Cloud.Tools.Analyzers\bin\$(Configuration)\netstandard1.3\publish\Google.Cloud.Tools.Analyzers.dll')" Include="..\..\..\tools\Google.Cloud.Tools.Analyzers\bin\$(Configuration)\netstandard1.3\publish\Google.Cloud.Tools.Analyzers.dll" />
<Reference Condition="'$(TargetFramework)' == 'net452'" Include="Microsoft.CSharp" />
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>
@@ -0,0 +1,103 @@
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace Google.Cloud.AutoML.V1.Snippets
{
using Google.Api.Gax;
using Google.Api.Gax.Grpc;
using apis = Google.Cloud.AutoML.V1;
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

/// <summary>Generated snippets</summary>
public class GeneratedPredictionServiceClientSnippets
{
/// <summary>Snippet for PredictAsync</summary>
public async Task PredictAsync()
{
// Snippet: PredictAsync(ModelName,ExamplePayload,IDictionary<string, string>,CallSettings)
// Additional: PredictAsync(ModelName,ExamplePayload,IDictionary<string, string>,CancellationToken)
// Create client
PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = new ModelName("[PROJECT]", "[LOCATION]", "[MODEL]");
ExamplePayload payload = new ExamplePayload();
IDictionary<string, string> @params = new Dictionary<string, string>();
// Make the request
PredictResponse response = await predictionServiceClient.PredictAsync(name, payload, @params);
// End snippet
}

/// <summary>Snippet for Predict</summary>
public void Predict()
{
// Snippet: Predict(ModelName,ExamplePayload,IDictionary<string, string>,CallSettings)
// Create client
PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create();
// Initialize request argument(s)
ModelName name = new ModelName("[PROJECT]", "[LOCATION]", "[MODEL]");
ExamplePayload payload = new ExamplePayload();
IDictionary<string, string> @params = new Dictionary<string, string>();
// Make the request
PredictResponse response = predictionServiceClient.Predict(name, payload, @params);
// End snippet
}

/// <summary>Snippet for PredictAsync</summary>
public async Task PredictAsync_RequestObject()
{
// Snippet: PredictAsync(PredictRequest,CallSettings)
// Additional: PredictAsync(PredictRequest,CancellationToken)
// Create client
PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync();
// Initialize request argument(s)
PredictRequest request = new PredictRequest
{
ModelName = new ModelName("[PROJECT]", "[LOCATION]", "[MODEL]"),
Payload = new ExamplePayload(),
};
// Make the request
PredictResponse response = await predictionServiceClient.PredictAsync(request);
// End snippet
}

/// <summary>Snippet for Predict</summary>
public void Predict_RequestObject()
{
// Snippet: Predict(PredictRequest,CallSettings)
// Create client
PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create();
// Initialize request argument(s)
PredictRequest request = new PredictRequest
{
ModelName = new ModelName("[PROJECT]", "[LOCATION]", "[MODEL]"),
Payload = new ExamplePayload(),
};
// Make the request
PredictResponse response = predictionServiceClient.Predict(request);
// End snippet
}

}
}
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<CoverageParams>
<TargetExecutable>C:/Program Files/dotnet/dotnet.exe</TargetExecutable>
<TargetArguments>test --no-build -c Release</TargetArguments>
<Filters>
<IncludeFilters>
<FilterEntry>
<ModuleMask>Google.Cloud.AutoML.V1</ModuleMask>
</FilterEntry>
</IncludeFilters>
</Filters>
<AttributeFilters>
<AttributeFilterEntry>System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute</AttributeFilterEntry>
<AttributeFilterEntry>System.Diagnostics.DebuggerNonUserCodeAttribute</AttributeFilterEntry>
</AttributeFilters>
<TargetWorkingDir>.</TargetWorkingDir>
<Output>../../../coverage/Google.Cloud.AutoML.V1.Snippets.dvcr</Output>
</CoverageParams>

0 comments on commit ba7dfdd

Please sign in to comment.