Class SheetsServiceProvider | Localization | 0.7.1-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class SheetsServiceProvider

    Configuration for connecting to a Google Sheet. Includes the Authorization properties and general sheet properties such as default sheet styles etc.

    Inheritance
    Object
    SheetsServiceProvider
    Namespace: UnityEditor.Localization.Plugins.Google
    Syntax
    public class SheetsServiceProvider : ScriptableObject, IGoogleSheetsService

    Properties

    ApiKey

    The API Key to use when using APIKey authentication.

    Declaration
    public string ApiKey { get; }
    Property Value
    Type Description
    String

    ApplicationName

    The name of the application that will be sent when connecting.

    Declaration
    public string ApplicationName { get; set; }
    Property Value
    Type Description
    String

    Authentication

    The authorization methodology to use. See https://developers.google.com/sheets/api/guides/authorizing

    Declaration
    public AuthenticationType Authentication { get; }
    Property Value
    Type Description
    AuthenticationType

    ClientId

    Client Id when using OAuth authentication.

    See also

    Declaration
    public string ClientId { get; }
    Property Value
    Type Description
    String

    ClientSecret

    Client secret when using OAuth authentication.

    See also

    Declaration
    public string ClientSecret { get; }
    Property Value
    Type Description
    String

    DataStore

    Used to make sure the access and refresh tokens persist. Uses a FileDataStore by default with "Library/Google/{name}" as the path.

    Declaration
    public IDataStore DataStore { get; set; }
    Property Value
    Type Description
    IDataStore

    NewSheetProperties

    Properties to use when creating a new Google Spreadsheet sheet.

    Declaration
    public NewSheetProperties NewSheetProperties { get; set; }
    Property Value
    Type Description
    NewSheetProperties

    Service

    The Google Sheet service that will be created using the Authorization API.

    Declaration
    public virtual SheetsService Service { get; }
    Property Value
    Type Description
    SheetsService
    Implements
    IGoogleSheetsService.Service

    Methods

    AuthoizeOAuth()

    Call to preauthorize when using OAuth authorization. This will cause a browser to open a Google authorization page after which the token will be stored in so that this does not need to be done each time. If this is not called then the first time Service is called it will be performed then.

    Declaration
    public UserCredential AuthoizeOAuth()
    Returns
    Type Description
    UserCredential

    OnEnable()

    Declaration
    public void OnEnable()

    SetApiKey(String)

    Set the API Key. An API key can only be used for reading from a public Google Spreadsheet.

    Declaration
    public void SetApiKey(string apiKey)
    Parameters
    Type Name Description
    String apiKey

    SetOAuthCrendtials(String)

    Enable OAuth 2.0 authentication and extract the ClientId and ClientSecret from the supplied json.

    Declaration
    public void SetOAuthCrendtials(string credentialsJson)
    Parameters
    Type Name Description
    String credentialsJson

    SetOAuthCrendtials(String, String)

    Enable OAuth 2.0 authentication with the provided client Id and client secret.

    Declaration
    public void SetOAuthCrendtials(string clientId, string clientSecret)
    Parameters
    Type Name Description
    String clientId
    String clientSecret
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023