Class GoogleClientSecrets (1.35.2)

public final class GoogleClientSecrets extends GenericJson

OAuth 2.0 client secrets JSON model as specified in client_secrets.json file format.

Sample usage:


 static GoogleClientSecrets loadClientSecretsResource(JsonFactory jsonFactory)
   throws IOException {
     return GoogleClientSecrets.load(
       jsonFactory,
       new InputStreamReader(
         SampleClass.class.getResourceAsStream("/client_secrets.json"), "UTF-8"
       )
     );
 }
 

Inheritance

Object > java.util.AbstractMap > com.google.api.client.util.GenericData > com.google.api.client.json.GenericJson > GoogleClientSecrets

Static Methods

load(JsonFactory jsonFactory, Reader reader)

public static GoogleClientSecrets load(JsonFactory jsonFactory, Reader reader)

Loads the client_secrets.json file from the given reader.

Parameters
NameDescription
jsonFactorycom.google.api.client.json.JsonFactory
readerReader
Returns
TypeDescription
GoogleClientSecrets
Exceptions
TypeDescription
IOException

Constructors

GoogleClientSecrets()

public GoogleClientSecrets()

Methods

clone()

public GoogleClientSecrets clone()
Returns
TypeDescription
GoogleClientSecrets
Overrides
com.google.api.client.json.GenericJson.clone()

getDetails()

public GoogleClientSecrets.Details getDetails()

Returns the details for either installed or web applications.

Returns
TypeDescription
GoogleClientSecrets.Details

getInstalled()

public GoogleClientSecrets.Details getInstalled()

Returns the details for installed applications.

Returns
TypeDescription
GoogleClientSecrets.Details

getWeb()

public GoogleClientSecrets.Details getWeb()

Returns the details for web applications.

Returns
TypeDescription
GoogleClientSecrets.Details

set(String fieldName, Object value)

public GoogleClientSecrets set(String fieldName, Object value)
Parameters
NameDescription
fieldNameString
valueObject
Returns
TypeDescription
GoogleClientSecrets
Overrides
com.google.api.client.json.GenericJson.set(java.lang.String,java.lang.Object)

setInstalled(GoogleClientSecrets.Details installed)

public GoogleClientSecrets setInstalled(GoogleClientSecrets.Details installed)

Sets the details for installed applications.

Parameter
NameDescription
installedGoogleClientSecrets.Details
Returns
TypeDescription
GoogleClientSecrets

setWeb(GoogleClientSecrets.Details web)

public GoogleClientSecrets setWeb(GoogleClientSecrets.Details web)

Sets the details for web applications.

Parameter
NameDescription
webGoogleClientSecrets.Details
Returns
TypeDescription
GoogleClientSecrets