Delphi Google Cloud SDK

Google Cloud Platform, offered by Google, is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search, Gmail, Google Drive, and YouTube. Google Cloud Platform provides infrastructure as a service, platform as a service, and serverless computing environments.

Our sgcOpenAPI Client Parser can read the OpenAPI / Swagger Google Cloud specifications and create automatically client interfaces in 100% pascal code, so it can be integrated in any Delphi, CBuilder or Lazarus Application.

You can check here the full list of more than 250 Google Cloud Services:

https://www.esegece.com/openapi/apis/google-cloud-sdk

The list includes popular services like:

  • Google Calendar
  • Google Docs
  • Google Gmail
  • Firebase
  • Google Maps
  • And many more services !!!


Google Cloud Client 

The sgcOpenAPI Google Client (TsgcOpenAPI_Google_Client) has it's own OpenAPI Client which inherits from TsgcOpenAPI_Client.

This component has a property called GoogleOptions that includes all required configurations to connect to Google Cloud Servers.

GoogleOptions

The OpenAPI Google client allows to authenticate using the following methods:

  1. OAuth2 Code: is interactive, which means requires the intervention of the user.
  2. JWT (service accounts): is non-interactive, so can run as a service for example.

The authentication is configured in the property GoogleOptions.Authentication, allows the following values:

  • oagaOAuth2: interactive.
  • oagaJWT: non-interactive. You can import the settings from a JSON file, using the method LoadSettingsFromFile. This method will fill the following properties automatically:
    • API_Endpoint
    • ClientEmail
    • PrivateKeyId
    • PrivateKey

OAuth2 Credentials
 

In order to use the OpenAPI Google Cloud components and Authenticate using OAuth2, first you must obtain the OAuth2 Key from Google Cloud.

Find below the steps to get Google OAuth2 Keys and how configure in our PubSub sample application.

First login to your Google Cloud Account and use an existing project or create a new one.

After that, go to Credentials menu and press the button CREATE CREDENTIALS, select the option OAuth Client ID.

Select your application type and set a description name 

If successful, you will get your Client Id and Client Secret.

Service Account Credentials 

In order to use the OpenAPI Google Cloud components and Authenticate using Service Accounts, first you must obtain the Private Key Certificate from Google Cloud.

Find below the steps to get Google Private Key Certificate and how configure in our sample application.

First login to your Google Cloud Account and use an existing project or create a new one.

Select CREATE SERVICE ACCOUNT and a new page will be shown where you must set the service account name and description

Then select at least one Role, I select PubSub Admin to allow the client publish and subscribe topics, but you can select other role with less privileges

Press CONTINUE and finally you can grant access to other users

Press DONE when you finish and a new record will be shown

Delphi Google Cloud SDK Video 

Delphi Google Cloud SDK

Delphi Components 100% full native code without external dependencies. Available for Rad Studio, Delphi, CBuilder, Lazarus and .NET. Create a single application and compile for the following personalities: Windows, MacOSX, Android, iOS and Linux.
×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

Delphi Microsoft Azure SDK
Delphi Amazon AWS SDK

Related Posts