Java क्लाइंट लाइब्रेरी कॉन्फ़िगरेशन

लाइब्रेरी, System.getProperty("user.home") + "/searchads360.properties" में मौजूद कॉन्फ़िगरेशन फ़ाइल ढूंढती है.

कॉन्फ़िगरेशन फ़ाइल का फ़ॉर्मैट, Java प्रॉपर्टी की वैल्यू पेयर की फ़ाइल जैसा होता है. काम करने वाली कुंजियां, पुष्टि करने के चुने गए फ़्लो के आधार पर अलग-अलग होती हैं.

डेस्कटॉप और वेब ऐप्लिकेशन फ़्लो के लिए काम करने वाली कुंजियां

अगर डेस्कटॉप या वेब ऐप्लिकेशन फ़्लो का इस्तेमाल किया जा रहा है, तो इन कुंजियों का इस्तेमाल किया जा सकता है:

# Credential for accessing Google's OAuth servers.
# Provided by console.cloud.google.com.
api.searchads360.clientId=INSERT_CLIENT_ID_HERE

# Credential for accessing Google's OAuth servers.
# Provided by console.cloud.google.com.
api.searchads360.clientSecret=INSERT_CLIENT_SECRET_HERE

# Renewable OAuth credential associated with 1 or more Search Ads accounts.
api.searchads360.refreshToken=INSERT_REFRESH_TOKEN_HERE

# Required for manager accounts only: Specify the login customer ID used to
# authenticate API calls. This will be the customer ID of the authenticated
# manager account. You can also specify this later in code if your application
# uses multiple manager account + OAuth pairs.
#
# api.searchads360.loginCustomerId=INSERT_LOGIN_CUSTOMER_ID_HERE


कॉन्फ़िगरेशन के तरीके मिलाना

SearchAds360Client और इसका बिल्डर, कॉन्फ़िगरेशन की अलग-अलग रणनीति को एक साथ इस्तेमाल करने में मदद करता है. उदाहरण के लिए, नीचे दिए गए स्निपेट का इस्तेमाल करके, इंस्टेंस के क्रेडेंशियल और दूसरे एट्रिब्यूट कॉन्फ़िगर करने के लिए, प्रॉपर्टी फ़ाइल का इस्तेमाल किया जा सकता है.

SearchAds360Client searchAds360Client = SearchAds360Client.newBuilder()
    .fromPropertiesFile()
    .build();

build() को कॉल करने से पहले, बिल्डर के कॉन्फ़िगरेशन के अन्य तरीकों का इस्तेमाल करके रनटाइम के दौरान और बदलाव किए जा सकते हैं.

अगर आप मैनेजर खाते के तौर पर पुष्टि कर रहे हैं, तो आपको यह भी बताना होगा:

api.searchads360.loginCustomerId --> Manager account ID (with hyphens removed).