diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 57cfe73c879f..35394a58fc6b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -7,6 +7,8 @@ "google-analytics-data+FILLER": "0.0.0", "google-analytics-data-v1beta": "0.10.0", "google-analytics-data-v1beta+FILLER": "0.0.0", + "google-apps-meet": "0.0.1", + "google-apps-meet+FILLER": "0.0.0", "google-apps-meet-v2beta": "0.1.0", "google-apps-meet-v2beta+FILLER": "0.0.0", "google-area120-tables": "0.4.0", diff --git a/google-apps-meet/.OwlBot.yaml b/google-apps-meet/.OwlBot.yaml new file mode 100644 index 000000000000..8aea210dca66 --- /dev/null +++ b/google-apps-meet/.OwlBot.yaml @@ -0,0 +1,3 @@ +deep-copy-regex: + - source: /google/apps/meet/[^/]+-ruby/(.*) + dest: /owl-bot-staging/google-apps-meet/$1 diff --git a/google-apps-meet/.gitignore b/google-apps-meet/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/google-apps-meet/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/google-apps-meet/.owlbot-manifest.json b/google-apps-meet/.owlbot-manifest.json new file mode 100644 index 000000000000..86ac45c73f90 --- /dev/null +++ b/google-apps-meet/.owlbot-manifest.json @@ -0,0 +1,24 @@ +{ + "generated": [ + ".gitignore", + ".repo-metadata.json", + ".rubocop.yml", + ".yardopts", + "AUTHENTICATION.md", + "CHANGELOG.md", + "Gemfile", + "LICENSE.md", + "README.md", + "Rakefile", + "google-apps-meet.gemspec", + "lib/google-apps-meet.rb", + "lib/google/apps/meet.rb", + "lib/google/apps/meet/version.rb", + "test/google/apps/meet/client_test.rb", + "test/google/apps/meet/version_test.rb", + "test/helper.rb" + ], + "static": [ + ".OwlBot.yaml" + ] +} diff --git a/google-apps-meet/.repo-metadata.json b/google-apps-meet/.repo-metadata.json new file mode 100644 index 000000000000..467aac1be21b --- /dev/null +++ b/google-apps-meet/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "meet.googleapis.com", + "api_shortname": "meet", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-apps-meet/latest", + "distribution_name": "google-apps-meet", + "is_cloud": true, + "language": "ruby", + "name": "meet", + "name_pretty": "Google Meet API", + "product_documentation": "https://developers.google.com/meet/api/guides/overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Create and manage meetings in Google Meet.", + "ruby-cloud-product-url": "https://developers.google.com/meet/api/guides/overview", + "library_type": "GAPIC_MANUAL" +} diff --git a/google-apps-meet/.rubocop.yml b/google-apps-meet/.rubocop.yml new file mode 100644 index 000000000000..661af474fb13 --- /dev/null +++ b/google-apps-meet/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-apps-meet.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false + +Naming/FileName: + Exclude: + - "lib/google-apps-meet.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/google-apps-meet/.yardopts b/google-apps-meet/.yardopts new file mode 100644 index 000000000000..deb503ab8d7a --- /dev/null +++ b/google-apps-meet/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Google Meet API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/google-apps-meet/AUTHENTICATION.md b/google-apps-meet/AUTHENTICATION.md new file mode 100644 index 000000000000..1b0bf3db5433 --- /dev/null +++ b/google-apps-meet/AUTHENTICATION.md @@ -0,0 +1,149 @@ +# Authentication + +In general, the google-apps-meet library uses +[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) +credentials to connect to Google Cloud services. When running within +[Google Cloud Platform environments](#google-cloud-platform-environments) the +credentials will be discovered automatically. When running on other +environments, the Service Account credentials can be specified by providing the +path to the +[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) +for the account (or the JSON itself) in +[environment variables](#environment-variables). Additionally, Cloud SDK +credentials can also be discovered automatically, but this is only recommended +during development. + +## Quickstart + +1. [Create a service account and credentials](#creating-a-service-account). +2. Set the [environment variable](#environment-variables). + +```sh +export GOOGLE_CLOUD_CREDENTIALS=path/to/keyfile.json +``` + +3. Initialize the client. + +```ruby +require "google/apps/meet" + +client = Google::Apps::Meet.spaces_service +``` + +## Credential Lookup + +The google-apps-meet library aims to make authentication +as simple as possible, and provides several mechanisms to configure your system +without requiring **Service Account Credentials** directly in code. + +**Credentials** are discovered in the following order: + +1. Specify credentials in method arguments +2. Specify credentials in configuration +3. Discover credentials path in environment variables +4. Discover credentials JSON in environment variables +5. Discover credentials file in the Cloud SDK's path +6. Discover GCP credentials + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, **Credentials** are discovered automatically. +Code should be written as if already authenticated. + +### Environment Variables + +The **Credentials JSON** can be placed in environment variables instead of +declaring them directly in code. Each service has its own environment variable, +allowing for different service accounts to be used for different services. (See +the READMEs for the individual service gems for details.) The path to the +**Credentials JSON** file can be stored in the environment variable, or the +**Credentials JSON** itself can be stored for environments such as Docker +containers where writing files is difficult or not encouraged. + +The environment variables that google-apps-meet +checks for credentials are configured on the service Credentials class (such as +`::Google::Apps::Meet::V2beta::SpacesService::Credentials`): + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/apps/meet" + +ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json" + +client = Google::Apps::Meet.spaces_service +``` + +### Configuration + +The path to the **Credentials JSON** file can be configured instead of storing +it in an environment variable. Either on an individual client initialization: + +```ruby +require "google/apps/meet" + +client = Google::Apps::Meet.spaces_service do |config| + config.credentials = "path/to/keyfile.json" +end +``` + +Or globally for all clients: + +```ruby +require "google/apps/meet" + +Google::Apps::Meet.configure do |config| + config.credentials = "path/to/keyfile.json" +end + +client = Google::Apps::Meet.spaces_service +``` + +### Cloud SDK + +This option allows for an easy way to authenticate during development. If +credentials are not provided in code or in environment variables, then Cloud SDK +credentials are discovered. + +To configure your system for this, simply: + +1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) +2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` +3. Write code as if already authenticated. + +**NOTE:** This is _not_ recommended for running in production. The Cloud SDK +*should* only be used during development. + +## Creating a Service Account + +Google Cloud requires **Service Account Credentials** to +connect to the APIs. You will use the **JSON key file** to +connect to most services with google-apps-meet. + +If you are not running this client within +[Google Cloud Platform environments](#google-cloud-platform-environments), you +need a Google Developers service account. + +1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). +2. Create a new project or click on an existing project. +3. Activate the menu in the upper left and select **APIs & Services**. From + here, you will enable the APIs that your application requires. + + *Note: You may need to enable billing in order to use these services.* + +4. Select **Credentials** from the side navigation. + + Find the "Create credentials" drop down near the top of the page, and select + "Service account" to be guided through downloading a new JSON key file. + + If you want to re-use an existing service account, you can easily generate a + new key file. Just select the account you wish to re-use, click the pencil + tool on the right side to edit the service account, select the **Keys** tab, + and then select **Add Key**. + + The key file you download will be used by this library to authenticate API + requests and should be stored in a secure location. diff --git a/google-apps-meet/CHANGELOG.md b/google-apps-meet/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/google-apps-meet/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/google-apps-meet/Gemfile b/google-apps-meet/Gemfile new file mode 100644 index 000000000000..e7d49632a59d --- /dev/null +++ b/google-apps-meet/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gemspec + +gem "google-apps-meet-v2beta", path: "../google-apps-meet-v2beta" diff --git a/google-apps-meet/LICENSE.md b/google-apps-meet/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/google-apps-meet/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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. diff --git a/google-apps-meet/README.md b/google-apps-meet/README.md new file mode 100644 index 000000000000..b7a9ada5162d --- /dev/null +++ b/google-apps-meet/README.md @@ -0,0 +1,104 @@ +# Ruby Client for the Google Meet API + +Create and manage meetings in Google Meet. + +Create and manage meetings in Google Meet. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-apps-meet-v*`. +The gem `google-apps-meet` is the main client library that brings the +verisoned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-apps-meet/latest) +for this library, google-apps-meet, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-apps-meet-v2beta](https://cloud.google.com/ruby/docs/reference/google-apps-meet-v2beta/latest). + +See also the [Product Documentation](https://developers.google.com/meet/api/guides/overview) +for more usage information. + +## Quick Start + +``` +$ gem install google-apps-meet +``` + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/meet.googleapis.com) +1. {file:AUTHENTICATION.md Set up authentication.} + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-apps-meet`, +and lower-level _versioned_ client libraries with names such as +`google-apps-meet-v2beta`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-apps-meet`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-apps-meet-v2beta`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/google-apps-meet/Rakefile b/google-apps-meet/Rakefile new file mode 100644 index 000000000000..5f7f69933e12 --- /dev/null +++ b/google-apps-meet/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = true +end + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-apps-meet" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-apps-meet" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +end + +# Acceptance tests +desc "Run the google-apps-meet acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/apps/meet/v2beta/spaces_service/credentials" + ::Google::Apps::Meet::V2beta::SpacesService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-apps-meet gem has no acceptance tests." + end + end + + desc "Run acceptance tests with coverage." + task :coverage do + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-apps-meet gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-apps-meet gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-apps-meet gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-apps-meet" + header "google-apps-meet rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-apps-meet yard", "*" + Rake::Task[:yard].invoke + header "google-apps-meet test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-apps-meet smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-apps-meet acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/google-apps-meet/google-apps-meet.gemspec b/google-apps-meet/google-apps-meet.gemspec new file mode 100644 index 000000000000..bc57aaf9d428 --- /dev/null +++ b/google-apps-meet/google-apps-meet.gemspec @@ -0,0 +1,36 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/apps/meet/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-apps-meet" + gem.version = Google::Apps::Meet::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Create and manage meetings in Google Meet." + gem.summary = "Create and manage meetings in Google Meet." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.6" + + gem.add_dependency "google-apps-meet-v2beta", ">= 0.0", "< 2.a" + gem.add_dependency "google-cloud-core", "~> 1.6" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.9" + gem.add_development_dependency "yard", "~> 0.9" +end diff --git a/google-apps-meet/lib/google-apps-meet.rb b/google-apps-meet/lib/google-apps-meet.rb new file mode 100644 index 000000000000..588eb9bb9216 --- /dev/null +++ b/google-apps-meet/lib/google-apps-meet.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/apps/meet" unless defined? Google::Apps::Meet::VERSION diff --git a/google-apps-meet/lib/google/apps/meet.rb b/google-apps-meet/lib/google/apps/meet.rb new file mode 100644 index 000000000000..56ca98177845 --- /dev/null +++ b/google-apps-meet/lib/google/apps/meet.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/apps/meet/version" + +require "googleauth" + +module Google + module Apps + module Meet + ## + # Create a new client object for SpacesService. + # + # By default, this returns an instance of + # [Google::Apps::Meet::V2beta::SpacesService::Client](https://cloud.google.com/ruby/docs/reference/google-apps-meet-v2beta/latest/Google-Apps-Meet-V2beta-SpacesService-Client) + # for a gRPC client for version V2beta of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SpacesService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # ## About SpacesService + # + # REST API for services dealing with spaces. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2beta`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.spaces_service version: :v2beta, transport: :grpc, &block + require "google/apps/meet/#{version.to_s.downcase}" + + package_name = Google::Apps::Meet + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Apps::Meet.const_get(package_name).const_get(:SpacesService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Create a new client object for ConferenceRecordsService. + # + # By default, this returns an instance of + # [Google::Apps::Meet::V2beta::ConferenceRecordsService::Client](https://cloud.google.com/ruby/docs/reference/google-apps-meet-v2beta/latest/Google-Apps-Meet-V2beta-ConferenceRecordsService-Client) + # for a gRPC client for version V2beta of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ConferenceRecordsService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # ## About ConferenceRecordsService + # + # REST API for services dealing with conference records. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2beta`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.conference_records_service version: :v2beta, transport: :grpc, &block + require "google/apps/meet/#{version.to_s.downcase}" + + package_name = Google::Apps::Meet + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Apps::Meet.const_get(package_name).const_get(:ConferenceRecordsService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + end + end +end + +helper_path = ::File.join __dir__, "meet", "helpers.rb" +require "google/apps/meet/helpers" if ::File.file? helper_path diff --git a/google-apps-meet/lib/google/apps/meet/version.rb b/google-apps-meet/lib/google/apps/meet/version.rb new file mode 100644 index 000000000000..45e14dff50e0 --- /dev/null +++ b/google-apps-meet/lib/google/apps/meet/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Meet + VERSION = "0.0.1" + end + end +end diff --git a/google-apps-meet/test/google/apps/meet/client_test.rb b/google-apps-meet/test/google/apps/meet/client_test.rb new file mode 100644 index 000000000000..33c60aba0840 --- /dev/null +++ b/google-apps-meet/test/google/apps/meet/client_test.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/apps/meet" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Apps::Meet::ClientConstructionMinitest < Minitest::Test + def test_spaces_service_grpc + Gapic::ServiceStub.stub :new, :stub do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Apps::Meet.spaces_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Apps::Meet::V2beta::SpacesService::Client, client + end + end + + def test_spaces_service_rest + Gapic::Rest::ClientStub.stub :new, :stub do + client = Google::Apps::Meet.spaces_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Apps::Meet::V2beta::SpacesService::Rest::Client, client + end + end + + def test_conference_records_service_grpc + Gapic::ServiceStub.stub :new, :stub do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Apps::Meet.conference_records_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Apps::Meet::V2beta::ConferenceRecordsService::Client, client + end + end + + def test_conference_records_service_rest + Gapic::Rest::ClientStub.stub :new, :stub do + client = Google::Apps::Meet.conference_records_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Apps::Meet::V2beta::ConferenceRecordsService::Rest::Client, client + end + end +end diff --git a/google-apps-meet/test/google/apps/meet/version_test.rb b/google-apps-meet/test/google/apps/meet/version_test.rb new file mode 100644 index 000000000000..14d6809f845f --- /dev/null +++ b/google-apps-meet/test/google/apps/meet/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/apps/meet/version" + +class Google::Apps::Meet::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Apps::Meet::VERSION + end +end diff --git a/google-apps-meet/test/helper.rb b/google-apps-meet/test/helper.rb new file mode 100644 index 000000000000..733ebfbb09ac --- /dev/null +++ b/google-apps-meet/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" diff --git a/release-please-config.json b/release-please-config.json index d0aa294a8903..1ef399955a2c 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -27,6 +27,10 @@ "component": "google-analytics-data-v1beta", "version_file": "lib/google/analytics/data/v1beta/version.rb" }, + "google-apps-meet": { + "component": "google-apps-meet", + "version_file": "lib/google/apps/meet/version.rb" + }, "google-apps-meet-v2beta": { "component": "google-apps-meet-v2beta", "version_file": "lib/google/apps/meet/v2beta/version.rb"