text stringlengths 0 828 |
|---|
:param bool scheduled: A boolean indicating whether or not to schedule stepdown. |
:param bool weekly: A boolean indicating whether or not to schedule compaction weekly. |
"""""" |
# Ensure a logical start and endtime is requested. |
if not start < end: |
raise TypeError('Parameter ""start"" must occur earlier in time than ""end"".') |
# Ensure specified window is less than a week in length. |
week_delta = datetime.timedelta(days=7) |
if not ((end - start) <= week_delta): |
raise TypeError('Stepdown windows can not be longer than 1 week in length.') |
url = self._service_url + 'stepdown/' |
data = { |
'start': int(start.strftime('%s')), |
'end': int(end.strftime('%s')), |
'enabled': enabled, |
'scheduled': scheduled, |
'weekly': weekly, |
} |
response = requests.post( |
url, |
data=json.dumps(data), |
**self._instances._default_request_kwargs |
) |
return response.json()" |
4521,"def _get_connection(self, ssl): |
""""""Get a live connection to this instance."""""" |
# Use SSL/TLS if requested and available. |
connect_string = self.connect_string |
if ssl and self.ssl_connect_string: |
connect_string = self.ssl_connect_string |
return pymongo.MongoClient(connect_string)" |
4522,"def get_shard_stats(self): |
"""""" |
:return: get stats for this mongodb shard |
"""""" |
return requests.get(self._stats_url, params={'include_stats': True}, |
headers={'X-Auth-Token': self._client.auth._token} |
).json()['data']['stats']" |
4523,"def brand(self, brand): |
""""""Sets the brand of this PaymentCard. |
:param brand: The brand of this PaymentCard. |
:type: str |
"""""" |
allowed_values = [""visa"", ""mastercard"", ""americanExpress"", ""discover""] |
if brand is not None and brand not in allowed_values: |
raise ValueError( |
""Invalid value for `brand` ({0}), must be one of {1}"" |
.format(brand, allowed_values) |
) |
self._brand = brand" |
4524,"def create_payment_card(cls, payment_card, **kwargs): |
""""""Create PaymentCard |
Create a new PaymentCard |
This method makes a synchronous HTTP request by default. To make an |
asynchronous HTTP request, please pass async=True |
>>> thread = api.create_payment_card(payment_card, async=True) |
>>> result = thread.get() |
:param async bool |
:param PaymentCard payment_card: Attributes of paymentCard to create (required) |
:return: PaymentCard |
If the method is called asynchronously, |
returns the request thread. |
"""""" |
kwargs['_return_http_data_only'] = True |
if kwargs.get('async'): |
return cls._create_payment_card_with_http_info(payment_card, **kwargs) |
else: |
(data) = cls._create_payment_card_with_http_info(payment_card, **kwargs) |
return data" |
4525,"def delete_payment_card_by_id(cls, payment_card_id, **kwargs): |
""""""Delete PaymentCard |
Delete an instance of PaymentCard by its ID. |
This method makes a synchronous HTTP request by default. To make an |
asynchronous HTTP request, please pass async=True |
>>> thread = api.delete_payment_card_by_id(payment_card_id, async=True) |
>>> result = thread.get() |
:param async bool |
:param str payment_card_id: ID of paymentCard to delete. (required) |
:return: None |
If the method is called asynchronously, |
returns the request thread. |
"""""" |
kwargs['_return_http_data_only'] = True |
if kwargs.get('async'): |
return cls._delete_payment_card_by_id_with_http_info(payment_card_id, **kwargs) |
else: |
(data) = cls._delete_payment_card_by_id_with_http_info(payment_card_id, **kwargs) |
return data" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.