Skip to content

Commit

Permalink
build: library of v1beta1 showcase onboarded to SAM
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 428795675
  • Loading branch information
Google APIs authored and Copybara-Service committed Feb 15, 2022
1 parent e8fea5a commit 79bec21
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 32 deletions.
2 changes: 1 addition & 1 deletion google/example/showcase/v1beta1/compliance.proto
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/example/showcase/v1beta1/echo.proto
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/example/showcase/v1beta1/sequence.proto
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
53 changes: 53 additions & 0 deletions google/example/showcase/v1beta1/showcase_v1beta1.yaml
@@ -0,0 +1,53 @@
type: google.api.Service
config_version: 3
name: showcase.googleapis.com
title: Client Libraries Showcase API

apis:
- name: google.example.showcase.v1beta1.Compliance
- name: google.example.showcase.v1beta1.Echo
- name: google.example.showcase.v1beta1.SequenceService
- name: google.example.showcase.v1beta1.Testing

documentation:
summary: |-
Showcase represents both a model API and an integration testing surface
for client library generator consumption.
rules:
- selector: google.cloud.location.Locations.GetLocation
description: Gets information about a location.

- selector: google.cloud.location.Locations.ListLocations
description: Lists information about the supported locations for this service.

- selector: google.iam.v1.IAMPolicy.GetIamPolicy
description: |-
Gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
description: |-
Sets the access control policy on the specified resource. Replaces
any existing policy.
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
errors.
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
description: |-
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a `NOT_FOUND` error.
Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization
checking. This operation may "fail open" without warning.
backend:
rules:
- selector: google.cloud.location.Locations.GetLocation
deadline: 60.0
- selector: google.cloud.location.Locations.ListLocations
deadline: 60.0
- selector: 'google.iam.v1.IAMPolicy.*'
deadline: 60.0
58 changes: 29 additions & 29 deletions google/example/showcase/v1beta1/testing.proto
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,9 +17,9 @@ syntax = "proto3";
package google.example.showcase.v1beta1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/resource.proto";
import "google/protobuf/empty.proto";
import "google/api/client.proto";

option go_package = "github.com/googleapis/gapic-showcase/server/genproto";
option java_multiple_files = true;
Expand Down Expand Up @@ -212,6 +212,33 @@ message Test {
pattern: "sessions/{session}/tests/{test}"
};

// Whether or not a test is required, recommended, or optional.
enum ExpectationLevel {
EXPECTATION_LEVEL_UNSPECIFIED = 0;

// This test is strictly required.
REQUIRED = 1;

// This test is recommended.
//
// If a generator explicitly ignores a recommended test (see `DeleteTest`),
// then the report may still pass, but with a warning.
//
// If a generator skips a recommended test and does not explicitly
// express that intention, the report will fail.
RECOMMENDED = 2;

// This test is optional.
//
// If a generator explicitly ignores an optional test (see `DeleteTest`),
// then the report may still pass, and no warning will be issued.
//
// If a generator skips an optional test and does not explicitly
// express that intention, the report may still pass, but with a
// warning.
OPTIONAL = 3;
}

// A blueprint is an explicit definition of methods and requests that are
// needed to be made to test this specific test case. Ideally this would be
// represented by something more robust like CEL, but as of writing this, I am
Expand Down Expand Up @@ -244,33 +271,6 @@ message Test {
repeated Invocation additional_requests = 4;
}

// Whether or not a test is required, recommended, or optional.
enum ExpectationLevel {
EXPECTATION_LEVEL_UNSPECIFIED = 0;

// This test is strictly required.
REQUIRED = 1;

// This test is recommended.
//
// If a generator explicitly ignores a recommended test (see `DeleteTest`),
// then the report may still pass, but with a warning.
//
// If a generator skips a recommended test and does not explicitly
// express that intention, the report will fail.
RECOMMENDED = 2;

// This test is optional.
//
// If a generator explicitly ignores an optional test (see `DeleteTest`),
// then the report may still pass, and no warning will be issued.
//
// If a generator skips an optional test and does not explicitly
// express that intention, the report may still pass, but with a
// warning.
OPTIONAL = 3;
}

// The name of the test.
// The tests/* portion of the names are hard-coded, and do not change
// from session to session.
Expand Down

0 comments on commit 79bec21

Please sign in to comment.