Search in sources :

Example 1 with MediaLocationSettings

use of com.google.api.ads.admanager.axis.v202108.MediaLocationSettings in project googleads-java-lib by googleads.

the class CreateCdnConfigurations method runExample.

/**
 * Runs the example.
 *
 * @param adManagerServices the services factory.
 * @param session the session.
 * @throws ApiException if the API request failed with one or more service errors.
 * @throws RemoteException if the API request failed due to other errors.
 */
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException {
    // Get the CdnConfigurationService.
    CdnConfigurationServiceInterface cdnConfigurationService = adManagerServices.get(session, CdnConfigurationServiceInterface.class);
    // Make CDN configuration objects.
    // Only LIVE_STREAM_SOURCE_CONTENT is currently supported by the API.
    // Basic example with no security policies.
    CdnConfiguration cdnConfigurationWithoutSecurityPolicy = new CdnConfiguration();
    SecurityPolicySettings noSecurityPolicy = new SecurityPolicySettings();
    noSecurityPolicy.setSecurityPolicyType(SecurityPolicyType.NONE);
    MediaLocationSettings mediaLocationSettings = new MediaLocationSettings();
    mediaLocationSettings.setUrlPrefix("example.google.com");
    mediaLocationSettings.setSecurityPolicy(noSecurityPolicy);
    SourceContentConfiguration sourceContentConfigWithNoSecurityPolicy = new SourceContentConfiguration();
    sourceContentConfigWithNoSecurityPolicy.setIngestSettings(mediaLocationSettings);
    sourceContentConfigWithNoSecurityPolicy.setDefaultDeliverySettings(mediaLocationSettings);
    cdnConfigurationWithoutSecurityPolicy.setName("ApiConfig1");
    cdnConfigurationWithoutSecurityPolicy.setCdnConfigurationType(CdnConfigurationType.LIVE_STREAM_SOURCE_CONTENT);
    cdnConfigurationWithoutSecurityPolicy.setSourceContentConfiguration(sourceContentConfigWithNoSecurityPolicy);
    // Complex example with security policies.
    CdnConfiguration cdnConfigurationWithSecurityPolicy = new CdnConfiguration();
    SecurityPolicySettings ingestSecurityPolicySettings = new SecurityPolicySettings();
    ingestSecurityPolicySettings.setSecurityPolicyType(SecurityPolicyType.AKAMAI);
    ingestSecurityPolicySettings.setDisableServerSideUrlSigning(false);
    ingestSecurityPolicySettings.setTokenAuthenticationKey("abc123");
    MediaLocationSettings ingestSettings = new MediaLocationSettings();
    ingestSettings.setUrlPrefix("example.google.com");
    ingestSettings.setSecurityPolicy(ingestSecurityPolicySettings);
    SecurityPolicySettings deliverySecurityPolicySettings = new SecurityPolicySettings();
    deliverySecurityPolicySettings.setSecurityPolicyType(SecurityPolicyType.AKAMAI);
    deliverySecurityPolicySettings.setDisableServerSideUrlSigning(false);
    deliverySecurityPolicySettings.setOriginForwardingType(OriginForwardingType.CONVENTIONAL);
    deliverySecurityPolicySettings.setOriginPathPrefix("/path/to/my/origin");
    MediaLocationSettings deliverySettings = new MediaLocationSettings();
    deliverySettings.setUrlPrefix("example.google.com");
    deliverySettings.setSecurityPolicy(deliverySecurityPolicySettings);
    SourceContentConfiguration sourceContentConfigurationWithSecurityPolicy = new SourceContentConfiguration();
    sourceContentConfigurationWithSecurityPolicy.setIngestSettings(ingestSettings);
    sourceContentConfigurationWithSecurityPolicy.setDefaultDeliverySettings(deliverySettings);
    cdnConfigurationWithSecurityPolicy.setName("ApiConfig2");
    cdnConfigurationWithSecurityPolicy.setCdnConfigurationType(CdnConfigurationType.LIVE_STREAM_SOURCE_CONTENT);
    cdnConfigurationWithSecurityPolicy.setSourceContentConfiguration(sourceContentConfigurationWithSecurityPolicy);
    // Create the cdnConfigurations on the server.
    CdnConfiguration[] cdnConfigurations = cdnConfigurationService.createCdnConfigurations(new CdnConfiguration[] { cdnConfigurationWithoutSecurityPolicy, cdnConfigurationWithSecurityPolicy });
    for (CdnConfiguration createdCdnConfiguration : cdnConfigurations) {
        System.out.printf("A CDN configuration with ID %d and name '%s' was created.%n", createdCdnConfiguration.getId(), createdCdnConfiguration.getName());
    }
}
Also used : CdnConfigurationServiceInterface(com.google.api.ads.admanager.axis.v202108.CdnConfigurationServiceInterface) SourceContentConfiguration(com.google.api.ads.admanager.axis.v202108.SourceContentConfiguration) SecurityPolicySettings(com.google.api.ads.admanager.axis.v202108.SecurityPolicySettings) CdnConfiguration(com.google.api.ads.admanager.axis.v202108.CdnConfiguration) MediaLocationSettings(com.google.api.ads.admanager.axis.v202108.MediaLocationSettings)

Example 2 with MediaLocationSettings

use of com.google.api.ads.admanager.axis.v202108.MediaLocationSettings in project googleads-java-lib by googleads.

the class CreateCdnConfigurations method runExample.

/**
 * Runs the example.
 *
 * @param adManagerServices the services factory.
 * @param session the session.
 * @throws ApiException if the API request failed with one or more service errors.
 * @throws RemoteException if the API request failed due to other errors.
 */
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException {
    // Get the CdnConfigurationService.
    CdnConfigurationServiceInterface cdnConfigurationService = adManagerServices.get(session, CdnConfigurationServiceInterface.class);
    // Make CDN configuration objects.
    // Only LIVE_STREAM_SOURCE_CONTENT is currently supported by the API.
    // Basic example with no security policies.
    CdnConfiguration cdnConfigurationWithoutSecurityPolicy = new CdnConfiguration();
    SecurityPolicySettings noSecurityPolicy = new SecurityPolicySettings();
    noSecurityPolicy.setSecurityPolicyType(SecurityPolicyType.NONE);
    MediaLocationSettings mediaLocationSettings = new MediaLocationSettings();
    mediaLocationSettings.setUrlPrefix("example.google.com");
    mediaLocationSettings.setSecurityPolicy(noSecurityPolicy);
    SourceContentConfiguration sourceContentConfigWithNoSecurityPolicy = new SourceContentConfiguration();
    sourceContentConfigWithNoSecurityPolicy.setIngestSettings(mediaLocationSettings);
    sourceContentConfigWithNoSecurityPolicy.setDefaultDeliverySettings(mediaLocationSettings);
    cdnConfigurationWithoutSecurityPolicy.setName("ApiConfig1");
    cdnConfigurationWithoutSecurityPolicy.setCdnConfigurationType(CdnConfigurationType.LIVE_STREAM_SOURCE_CONTENT);
    cdnConfigurationWithoutSecurityPolicy.setSourceContentConfiguration(sourceContentConfigWithNoSecurityPolicy);
    // Complex example with security policies.
    CdnConfiguration cdnConfigurationWithSecurityPolicy = new CdnConfiguration();
    SecurityPolicySettings ingestSecurityPolicySettings = new SecurityPolicySettings();
    ingestSecurityPolicySettings.setSecurityPolicyType(SecurityPolicyType.AKAMAI);
    ingestSecurityPolicySettings.setDisableServerSideUrlSigning(false);
    ingestSecurityPolicySettings.setTokenAuthenticationKey("abc123");
    MediaLocationSettings ingestSettings = new MediaLocationSettings();
    ingestSettings.setUrlPrefix("example.google.com");
    ingestSettings.setSecurityPolicy(ingestSecurityPolicySettings);
    SecurityPolicySettings deliverySecurityPolicySettings = new SecurityPolicySettings();
    deliverySecurityPolicySettings.setSecurityPolicyType(SecurityPolicyType.AKAMAI);
    deliverySecurityPolicySettings.setDisableServerSideUrlSigning(false);
    deliverySecurityPolicySettings.setOriginForwardingType(OriginForwardingType.CONVENTIONAL);
    deliverySecurityPolicySettings.setOriginPathPrefix("/path/to/my/origin");
    MediaLocationSettings deliverySettings = new MediaLocationSettings();
    deliverySettings.setUrlPrefix("example.google.com");
    deliverySettings.setSecurityPolicy(deliverySecurityPolicySettings);
    SourceContentConfiguration sourceContentConfigurationWithSecurityPolicy = new SourceContentConfiguration();
    sourceContentConfigurationWithSecurityPolicy.setIngestSettings(ingestSettings);
    sourceContentConfigurationWithSecurityPolicy.setDefaultDeliverySettings(deliverySettings);
    cdnConfigurationWithSecurityPolicy.setName("ApiConfig2");
    cdnConfigurationWithSecurityPolicy.setCdnConfigurationType(CdnConfigurationType.LIVE_STREAM_SOURCE_CONTENT);
    cdnConfigurationWithSecurityPolicy.setSourceContentConfiguration(sourceContentConfigurationWithSecurityPolicy);
    // Create the cdnConfigurations on the server.
    CdnConfiguration[] cdnConfigurations = cdnConfigurationService.createCdnConfigurations(new CdnConfiguration[] { cdnConfigurationWithoutSecurityPolicy, cdnConfigurationWithSecurityPolicy });
    for (CdnConfiguration createdCdnConfiguration : cdnConfigurations) {
        System.out.printf("A CDN configuration with ID %d and name '%s' was created.%n", createdCdnConfiguration.getId(), createdCdnConfiguration.getName());
    }
}
Also used : CdnConfigurationServiceInterface(com.google.api.ads.admanager.axis.v202111.CdnConfigurationServiceInterface) SourceContentConfiguration(com.google.api.ads.admanager.axis.v202111.SourceContentConfiguration) SecurityPolicySettings(com.google.api.ads.admanager.axis.v202111.SecurityPolicySettings) CdnConfiguration(com.google.api.ads.admanager.axis.v202111.CdnConfiguration) MediaLocationSettings(com.google.api.ads.admanager.axis.v202111.MediaLocationSettings)

Example 3 with MediaLocationSettings

use of com.google.api.ads.admanager.axis.v202108.MediaLocationSettings in project googleads-java-lib by googleads.

the class CreateCdnConfigurations method runExample.

/**
 * Runs the example.
 *
 * @param adManagerServices the services factory.
 * @param session the session.
 * @throws ApiException if the API request failed with one or more service errors.
 * @throws RemoteException if the API request failed due to other errors.
 */
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException {
    // Get the CdnConfigurationService.
    CdnConfigurationServiceInterface cdnConfigurationService = adManagerServices.get(session, CdnConfigurationServiceInterface.class);
    // Make CDN configuration objects.
    // Only LIVE_STREAM_SOURCE_CONTENT is currently supported by the API.
    // Basic example with no security policies.
    CdnConfiguration cdnConfigurationWithoutSecurityPolicy = new CdnConfiguration();
    SecurityPolicySettings noSecurityPolicy = new SecurityPolicySettings();
    noSecurityPolicy.setSecurityPolicyType(SecurityPolicyType.NONE);
    MediaLocationSettings mediaLocationSettings = new MediaLocationSettings();
    mediaLocationSettings.setUrlPrefix("example.google.com");
    mediaLocationSettings.setSecurityPolicy(noSecurityPolicy);
    SourceContentConfiguration sourceContentConfigWithNoSecurityPolicy = new SourceContentConfiguration();
    sourceContentConfigWithNoSecurityPolicy.setIngestSettings(mediaLocationSettings);
    sourceContentConfigWithNoSecurityPolicy.setDefaultDeliverySettings(mediaLocationSettings);
    cdnConfigurationWithoutSecurityPolicy.setName("ApiConfig1");
    cdnConfigurationWithoutSecurityPolicy.setCdnConfigurationType(CdnConfigurationType.LIVE_STREAM_SOURCE_CONTENT);
    cdnConfigurationWithoutSecurityPolicy.setSourceContentConfiguration(sourceContentConfigWithNoSecurityPolicy);
    // Complex example with security policies.
    CdnConfiguration cdnConfigurationWithSecurityPolicy = new CdnConfiguration();
    SecurityPolicySettings ingestSecurityPolicySettings = new SecurityPolicySettings();
    ingestSecurityPolicySettings.setSecurityPolicyType(SecurityPolicyType.AKAMAI);
    ingestSecurityPolicySettings.setDisableServerSideUrlSigning(false);
    ingestSecurityPolicySettings.setTokenAuthenticationKey("abc123");
    MediaLocationSettings ingestSettings = new MediaLocationSettings();
    ingestSettings.setUrlPrefix("example.google.com");
    ingestSettings.setSecurityPolicy(ingestSecurityPolicySettings);
    SecurityPolicySettings deliverySecurityPolicySettings = new SecurityPolicySettings();
    deliverySecurityPolicySettings.setSecurityPolicyType(SecurityPolicyType.AKAMAI);
    deliverySecurityPolicySettings.setDisableServerSideUrlSigning(false);
    deliverySecurityPolicySettings.setOriginForwardingType(OriginForwardingType.CONVENTIONAL);
    deliverySecurityPolicySettings.setOriginPathPrefix("/path/to/my/origin");
    MediaLocationSettings deliverySettings = new MediaLocationSettings();
    deliverySettings.setUrlPrefix("example.google.com");
    deliverySettings.setSecurityPolicy(deliverySecurityPolicySettings);
    SourceContentConfiguration sourceContentConfigurationWithSecurityPolicy = new SourceContentConfiguration();
    sourceContentConfigurationWithSecurityPolicy.setIngestSettings(ingestSettings);
    sourceContentConfigurationWithSecurityPolicy.setDefaultDeliverySettings(deliverySettings);
    cdnConfigurationWithSecurityPolicy.setName("ApiConfig2");
    cdnConfigurationWithSecurityPolicy.setCdnConfigurationType(CdnConfigurationType.LIVE_STREAM_SOURCE_CONTENT);
    cdnConfigurationWithSecurityPolicy.setSourceContentConfiguration(sourceContentConfigurationWithSecurityPolicy);
    // Create the cdnConfigurations on the server.
    CdnConfiguration[] cdnConfigurations = cdnConfigurationService.createCdnConfigurations(new CdnConfiguration[] { cdnConfigurationWithoutSecurityPolicy, cdnConfigurationWithSecurityPolicy });
    for (CdnConfiguration createdCdnConfiguration : cdnConfigurations) {
        System.out.printf("A CDN configuration with ID %d and name '%s' was created.%n", createdCdnConfiguration.getId(), createdCdnConfiguration.getName());
    }
}
Also used : CdnConfigurationServiceInterface(com.google.api.ads.admanager.axis.v202202.CdnConfigurationServiceInterface) SourceContentConfiguration(com.google.api.ads.admanager.axis.v202202.SourceContentConfiguration) SecurityPolicySettings(com.google.api.ads.admanager.axis.v202202.SecurityPolicySettings) CdnConfiguration(com.google.api.ads.admanager.axis.v202202.CdnConfiguration) MediaLocationSettings(com.google.api.ads.admanager.axis.v202202.MediaLocationSettings)

Aggregations

CdnConfiguration (com.google.api.ads.admanager.axis.v202108.CdnConfiguration)1 CdnConfigurationServiceInterface (com.google.api.ads.admanager.axis.v202108.CdnConfigurationServiceInterface)1 MediaLocationSettings (com.google.api.ads.admanager.axis.v202108.MediaLocationSettings)1 SecurityPolicySettings (com.google.api.ads.admanager.axis.v202108.SecurityPolicySettings)1 SourceContentConfiguration (com.google.api.ads.admanager.axis.v202108.SourceContentConfiguration)1 CdnConfiguration (com.google.api.ads.admanager.axis.v202111.CdnConfiguration)1 CdnConfigurationServiceInterface (com.google.api.ads.admanager.axis.v202111.CdnConfigurationServiceInterface)1 MediaLocationSettings (com.google.api.ads.admanager.axis.v202111.MediaLocationSettings)1 SecurityPolicySettings (com.google.api.ads.admanager.axis.v202111.SecurityPolicySettings)1 SourceContentConfiguration (com.google.api.ads.admanager.axis.v202111.SourceContentConfiguration)1 CdnConfiguration (com.google.api.ads.admanager.axis.v202202.CdnConfiguration)1 CdnConfigurationServiceInterface (com.google.api.ads.admanager.axis.v202202.CdnConfigurationServiceInterface)1 MediaLocationSettings (com.google.api.ads.admanager.axis.v202202.MediaLocationSettings)1 SecurityPolicySettings (com.google.api.ads.admanager.axis.v202202.SecurityPolicySettings)1 SourceContentConfiguration (com.google.api.ads.admanager.axis.v202202.SourceContentConfiguration)1