Skip to content
Permalink
Browse files
feat!: make v1 the default version of the API (#88)
refactor!: v1 of API renames GkeHubMembershipServiceClient to GkeHubClient
  • Loading branch information
JustinBeckwith committed Nov 25, 2021
1 parent 615611a commit 55702e66424430a442f1cc36ec4d766e8f677df3
Showing with 26 additions and 30 deletions.
  1. +2 −2 .repo-metadata.json
  2. +9 −3 README.md
  3. +2 −2 samples/quickstart.js
  4. +2 −2 samples/test/quickstart.js
  5. +4 −11 src/index.ts
  6. +1 −2 system-test/fixtures/sample/src/index.js
  7. +4 −6 system-test/fixtures/sample/src/index.ts
  8. +2 −2 webpack.config.js
@@ -2,8 +2,8 @@
"client_documentation": "https://cloud.google.com/nodejs/docs/reference/gke-hub/latest",
"api_id": "gkehub.googleapis.com",
"distribution_name": "@google-cloud/gke-hub",
"release_level": "BETA",
"default_version": "v1beta1",
"release_level": "ga",
"default_version": "v1",
"language": "nodejs",
"name_pretty": "GKE Hub",
"repo": "googleapis/nodejs-gke-hub",
@@ -4,7 +4,7 @@

# [GKE Hub: Node.js Client](https://github.com/googleapis/nodejs-gke-hub)

[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/gke-hub.svg)](https://www.npmjs.org/package/@google-cloud/gke-hub)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-gke-hub/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-gke-hub)

@@ -60,14 +60,14 @@ npm install @google-cloud/gke-hub
```javascript
// Imports the Google Cloud client library
const {GkeHubMembershipServiceClient} = require('@google-cloud/gke-hub');
const {GkeHubClient} = require('@google-cloud/gke-hub');
// TODO(developer): replace with your preferred values.
// const projectId = 'my-project'
// const location = 'global'
// Creates a client
const client = new GkeHubMembershipServiceClient();
const client = new GkeHubClient();
async function listMemberships() {
const memberships = await client.listMemberships({
@@ -120,6 +120,12 @@ _Legacy Node.js versions are supported as a best effort:_
This library follows [Semantic Versioning](http://semver.org/).


This library is considered to be **General Availability (GA)**. This means it
is stable; the code surface will not change in backwards-incompatible ways
unless absolutely necessary (e.g. because of critical security issues) or with
an extensive deprecation period. Issues and requests against **GA** libraries
are addressed with the highest priority.




@@ -17,14 +17,14 @@ async function main(projectId, location) {
// [START nodejs_gke_hub_quickstart]

// Imports the Google Cloud client library
const {GkeHubMembershipServiceClient} = require('@google-cloud/gke-hub');
const {GkeHubClient} = require('@google-cloud/gke-hub');

// TODO(developer): replace with your preferred values.
// const projectId = 'my-project'
// const location = 'global'

// Creates a client
const client = new GkeHubMembershipServiceClient();
const client = new GkeHubClient();

async function listMemberships() {
const memberships = await client.listMemberships({
@@ -20,14 +20,14 @@
const path = require('path');
const cp = require('child_process');
const {before, describe, it} = require('mocha');
const {GkeHubMembershipServiceClient} = require('@google-cloud/gke-hub');
const {GkeHubClient} = require('@google-cloud/gke-hub');
const {assert} = require('chai');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cwd = path.join(__dirname, '..');

const client = new GkeHubMembershipServiceClient();
const client = new GkeHubClient();

describe('Quickstart', () => {
let projectId;
@@ -22,17 +22,10 @@ import * as v1alpha2 from './v1alpha2';
import * as v1beta from './v1beta';
import * as v1beta1 from './v1beta1';

const GkeHubMembershipServiceClient = v1beta1.GkeHubMembershipServiceClient;
type GkeHubMembershipServiceClient = v1beta1.GkeHubMembershipServiceClient;
const GkeHubClient = v1.GkeHubClient;
type GkeHubClient = v1.GkeHubClient;

export {v1, v1alpha, v1alpha2, v1beta, v1beta1, GkeHubMembershipServiceClient};
export default {
v1,
v1alpha,
v1alpha2,
v1beta,
v1beta1,
GkeHubMembershipServiceClient,
};
export {v1, v1alpha, v1alpha2, v1beta, v1beta1, GkeHubClient};
export default {v1, v1alpha, v1alpha2, v1beta, v1beta1, GkeHubClient};
import * as protos from '../protos/protos';
export {protos};
@@ -20,8 +20,7 @@
const gkehub = require('@google-cloud/gke-hub');

function main() {
const gkeHubMembershipServiceClient =
new gkehub.GkeHubMembershipServiceClient();
const gkeHubClient = new gkehub.GkeHubClient();
}

main();
@@ -16,19 +16,17 @@
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

import {GkeHubMembershipServiceClient} from '@google-cloud/gke-hub';
import {GkeHubClient} from '@google-cloud/gke-hub';

// check that the client class type name can be used
function doStuffWithGkeHubMembershipServiceClient(
client: GkeHubMembershipServiceClient
) {
function doStuffWithGkeHubClient(client: GkeHubClient) {
client.close();
}

function main() {
// check that the client instance can be created
const gkeHubMembershipServiceClient = new GkeHubMembershipServiceClient();
doStuffWithGkeHubMembershipServiceClient(gkeHubMembershipServiceClient);
const gkeHubClient = new GkeHubClient();
doStuffWithGkeHubClient(gkeHubClient);
}

main();
@@ -17,8 +17,8 @@ const path = require('path');
module.exports = {
entry: './src/index.ts',
output: {
library: 'GkeHubMembershipService',
filename: './gke-hub-membership-service.js',
library: 'GkeHub',
filename: './gke-hub.js',
},
node: {
child_process: 'empty',

0 comments on commit 55702e6

Please sign in to comment.