Skip to content

Commit

Permalink
Merge branch 'release-1.28.71'
Browse files Browse the repository at this point in the history
* release-1.28.71:
  Bumping version to 1.28.71
  Add changelog entries from botocore
  add client context params to boto3 docs (#3911)
  Update config guide to include client context params usage (#3894)
  remove period
  • Loading branch information
aws-sdk-python-automation committed Oct 25, 2023
2 parents c3cdbb4 + 1c0db71 commit d8d3d73
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .changes/1.28.71.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"category": "Configuration",
"description": "[``botocore``] Adds client context params support to ``Config``.",
"type": "enhancement"
},
{
"category": "``connectcases``",
"description": "[``botocore``] Increase maximum length of CommentBody to 3000, and increase maximum length of StringValue to 1500",
"type": "api-change"
},
{
"category": "``groundstation``",
"description": "[``botocore``] This release will allow KMS alias names to be used when creating Mission Profiles",
"type": "api-change"
},
{
"category": "``iam``",
"description": "[``botocore``] Updates to GetAccessKeyLastUsed action to replace NoSuchEntity error with AccessDeniedException error.",
"type": "api-change"
}
]
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
CHANGELOG
=========

1.28.71
=======

* enhancement:Configuration: [``botocore``] Adds client context params support to ``Config``.
* api-change:``connectcases``: [``botocore``] Increase maximum length of CommentBody to 3000, and increase maximum length of StringValue to 1500
* api-change:``groundstation``: [``botocore``] This release will allow KMS alias names to be used when creating Mission Profiles
* api-change:``iam``: [``botocore``] Updates to GetAccessKeyLastUsed action to replace NoSuchEntity error with AccessDeniedException error.


1.28.70
=======

Expand Down
2 changes: 1 addition & 1 deletion boto3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from boto3.session import Session

__author__ = 'Amazon Web Services'
__version__ = '1.28.70'
__version__ = '1.28.71'


# The default Boto3 session; autoloaded when needed.
Expand Down
3 changes: 3 additions & 0 deletions boto3/docs/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self, service_name, session, root_docs_path):
'waiters',
'resources',
'examples',
'context-params',
]
self._root_docs_path = root_docs_path
self._USER_GUIDE_LINK = (
Expand All @@ -69,6 +70,8 @@ def document_service(self):
if self._service_resource:
self.resource_section(doc_structure.get_section('resources'))
self._document_examples(doc_structure.get_section('examples'))
context_params_section = doc_structure.get_section('context-params')
self.client_context_params(context_params_section)
return doc_structure.flush_structure()

def client_api(self, section):
Expand Down
2 changes: 1 addition & 1 deletion boto3/docs/waiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def document_resource_waiter(
service_module_name = get_service_module_name(service_model)
description = (
'Waits until this {} is {}. This method calls '
':py:meth:`{}.Waiter.{}.wait` which polls. '
':py:meth:`{}.Waiter.{}.wait` which polls '
':py:meth:`{}.Client.{}` every {} seconds until '
'a successful state is reached. An error is returned '
'after {} failed checks.'.format(
Expand Down
25 changes: 25 additions & 0 deletions docs/source/guide/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,31 @@ You can configure how Boto3 uses proxies by specifying the ``proxies_config`` op
With the addition of the ``proxies_config`` option shown here, the proxy will use the specified certificate file for authentication when using the HTTPS proxy.

Using client context parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some services have configuration settings that are specific to their clients. These settings are called client context parameters. Please refer to the ``Client Context Parameters`` section of a service client's documentation for a list of available parameters and information on how to use them.

.. _configure_client_context:

Configuring client context parameters
'''''''''''''''''''''''''''''''''''''
You can configure client context parameters by passing a dictionary of key-value pairs to the ``client_context_params`` parameter in your ``Config``. Invalid parameter values or parameters that are not modeled by the service will be ignored.

.. code-block:: python
import boto3
from botocore.config import Config
my_config = Config(
region_name='us-east-2',
client_context_params={
'my_great_context_param': 'foo'
}
)
client = boto3.client('kinesis', config=my_config)
Boto3 does not support setting ``client_context_params`` per request. Differing configurations will require creation of a new client.

Using environment variables
---------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = 0

[metadata]
requires_dist =
botocore>=1.31.70,<1.32.0
botocore>=1.31.71,<1.32.0
jmespath>=0.7.1,<2.0.0
s3transfer>=0.7.0,<0.8.0

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


requires = [
'botocore>=1.31.70,<1.32.0',
'botocore>=1.31.71,<1.32.0',
'jmespath>=0.7.1,<2.0.0',
's3transfer>=0.7.0,<0.8.0',
]
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/docs/test_docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def test_resource_waiter_help(self):
(
' Waits until this Sample is complete. This method calls '
':py:meth:`MyService.Waiter.sample_operation_complete.wait` '
'which polls. :py:meth:`MyService.Client.sample_operation` every '
'which polls :py:meth:`MyService.Client.sample_operation` every '
'15 seconds until a successful state is reached. An error '
'is returned after 40 failed checks.'
),
Expand Down
20 changes: 20 additions & 0 deletions tests/unit/docs/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,23 @@ def test_injects_examples_when_found(self):
contents = service_documenter.document_service().decode('utf-8')
assert 'This is an example' in contents
assert 'This is for another service' not in contents

def test_service_with_context_params(self):
self.json_model['clientContextParams'] = {
'MyContextParam': {
'documentation': 'This is my context param',
'type': 'boolean',
}
}
self.setup_client_and_resource()
service_documenter = ServiceDocumenter(
'myservice', self.session, self.root_services_path
)
contents = service_documenter.document_service().decode('utf-8')
lines = [
"=========================",
"Client Context Parameters",
"=========================",
"* ``my_context_param`` (boolean) - This is my context param",
]
self.assert_contains_lines_in_order(lines, contents)
2 changes: 1 addition & 1 deletion tests/unit/docs/test_waiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_document_resource_waiters(self):
(
' Waits until this Sample is complete. This method calls '
':py:meth:`MyService.Waiter.sample_operation_complete.wait` '
'which polls. :py:meth:`MyService.Client.sample_operation` '
'which polls :py:meth:`MyService.Client.sample_operation` '
'every 15 seconds until a successful state is reached. An '
'error is returned after 40 failed checks.'
),
Expand Down

0 comments on commit d8d3d73

Please sign in to comment.