content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
""" This is free and unencumbered software released into the public domain. For more details, please visit <http://unlicense.org/>. """ _v = "1.0.2"
""" This is free and unencumbered software released into the public domain. For more details, please visit <http://unlicense.org/>. """ _v = '1.0.2'
class MultiFuture(object): def __init__(self, futures, merger=None): self.merger = merger if hasattr(futures, "__len__"): self.futures = futures else: self.futures = [futures] def done(self): for f in self.futures: if not f.done(): return False return True def result(self): if len(self.futures) == 1: return self.futures[0].result() if not self.merger is None: return self.merger([f.result() for f in self.futures]) return [f.result() for f in self.futures]
class Multifuture(object): def __init__(self, futures, merger=None): self.merger = merger if hasattr(futures, '__len__'): self.futures = futures else: self.futures = [futures] def done(self): for f in self.futures: if not f.done(): return False return True def result(self): if len(self.futures) == 1: return self.futures[0].result() if not self.merger is None: return self.merger([f.result() for f in self.futures]) return [f.result() for f in self.futures]
"""Beaker exception classes""" class BeakerException(Exception): pass class BeakerWarning(RuntimeWarning): """Issued at runtime.""" class CreationAbortedError(Exception): """Deprecated.""" class InvalidCacheBackendError(BeakerException, ImportError): pass class MissingCacheParameter(BeakerException): pass class LockError(BeakerException): pass class InvalidCryptoBackendError(BeakerException): pass
"""Beaker exception classes""" class Beakerexception(Exception): pass class Beakerwarning(RuntimeWarning): """Issued at runtime.""" class Creationabortederror(Exception): """Deprecated.""" class Invalidcachebackenderror(BeakerException, ImportError): pass class Missingcacheparameter(BeakerException): pass class Lockerror(BeakerException): pass class Invalidcryptobackenderror(BeakerException): pass
class AutoTiler: def __init__(self): self.autoMap = {'UDLR': 0, 'DLR': 32, 'UDL': 64, 'ULR': 96, 'UDR': 128, 'DL': 160, 'UL': 192, 'UR': 224, 'DR': 256, 'LR': 288, 'UD': 320, 'U': 352, 'R': 384, 'D': 416, 'L': 448, '': 480} def auto_tile(self, tile_map): # Do base terrain/void transitions for i in range(0, tile_map.width): for j in range(0, tile_map.height): if not tile_map.get_tile([i, j]) is None and tile_map.get_tile([i, j]).tileable: tile_string = '' if not tile_map.valid_tile([i, j + 1]) or tile_map.get_tile([i, j + 1]) is not None: tile_string += 'U' if not tile_map.valid_tile([i, j - 1]) or tile_map.get_tile([i, j - 1]) is not None: tile_string += 'D' if not tile_map.valid_tile([i - 1, j]) or tile_map.get_tile([i - 1, j]) is not None: tile_string += 'L' if not tile_map.valid_tile([i + 1, j]) or tile_map.get_tile([i + 1, j]) is not None: tile_string += 'R' image_region = tile_map.tiles[i][j].image_region image_region[0] = self.autoMap[tile_string] tile_map.tiles[i][j].set_sprite(tile_map.tiles[i][j].image_name, image_region, batch=tile_map.tiles[i][j].batch, group=tile_map.tiles[i][j].group)
class Autotiler: def __init__(self): self.autoMap = {'UDLR': 0, 'DLR': 32, 'UDL': 64, 'ULR': 96, 'UDR': 128, 'DL': 160, 'UL': 192, 'UR': 224, 'DR': 256, 'LR': 288, 'UD': 320, 'U': 352, 'R': 384, 'D': 416, 'L': 448, '': 480} def auto_tile(self, tile_map): for i in range(0, tile_map.width): for j in range(0, tile_map.height): if not tile_map.get_tile([i, j]) is None and tile_map.get_tile([i, j]).tileable: tile_string = '' if not tile_map.valid_tile([i, j + 1]) or tile_map.get_tile([i, j + 1]) is not None: tile_string += 'U' if not tile_map.valid_tile([i, j - 1]) or tile_map.get_tile([i, j - 1]) is not None: tile_string += 'D' if not tile_map.valid_tile([i - 1, j]) or tile_map.get_tile([i - 1, j]) is not None: tile_string += 'L' if not tile_map.valid_tile([i + 1, j]) or tile_map.get_tile([i + 1, j]) is not None: tile_string += 'R' image_region = tile_map.tiles[i][j].image_region image_region[0] = self.autoMap[tile_string] tile_map.tiles[i][j].set_sprite(tile_map.tiles[i][j].image_name, image_region, batch=tile_map.tiles[i][j].batch, group=tile_map.tiles[i][j].group)
########## Default Octave C = 261.63 #C CS = 277.18 #C_Sharp DF = 277.18 #D_Flat D = 293.66 #D DS = 311.13 #D_Sharp EF = 311.13 #E_Flat E = 329.63 #E F = 349.23 #F FS = 369.99 #F_Sharp GF = 369.99 #G_Flat G = 392.00 #G GS = 415.30 #G_Sharp AF = 415.30 #A_Flat A = 440.00 #A AS = 466.16 #A_Sharp BF = 466.16 #B_Flat B = 493.88 #B ########## Octave 0 C0 = 16.35 CS0 = 17.32 DF0 = 17.32 D0 = 18.35 DS0 = 19.45 EF0 = 19.45 E0 = 20.60 F0 = 21.83 FS0 = 23.12 GF0 = 23.12 G0 = 24.50 GS0 = 25.96 AF0 = 25.96 A0 = 27.50 AS0 = 29.14 BF0 = 29.14 B0 = 30.87 ########## Octave 1 C1 = 32.70 CS1 = 34.65 DF1 = 34.65 D1 = 36.71 DS1 = 38.89 EF1 = 38.89 E1 = 41.20 F1 = 43.65 FS1 = 46.25 GF1 = 46.25 G1 = 49.00 GS1 = 51.91 AF1 = 51.91 A1 = 55.00 AS1 = 58.27 BF1 = 58.27 B1 = 61.74 ########## Octave 2 C2 = 65.41 CS2 = 69.30 DF2 = 69.30 D2 = 73.42 DS2 = 77.78 EF2 = 77.78 E2 = 82.41 F2 = 87.31 FS2 = 92.50 GF2 = 92.50 G2 = 98.00 GS2 = 103.83 AF2 = 103.83 A2 = 110.00 AS2 = 116.54 BF2 = 116.54 B2 = 123.47 ########## Octave 3 C3 = 130.81 CS3 = 138.59 DF3 = 138.59 D3 = 146.83 DS3 = 155.56 EF3 = 155.56 E3 = 164.81 F3 = 174.61 FS3 = 185.00 GF3 = 185.00 G3 = 196.00 GS3 = 207.65 AF3 = 207.65 A3 = 220.00 AS3 = 233.08 BF3 = 233.08 B3 = 246.94 ########## Octave 4 C4 = 261.63 CS4 = 277.18 DF4 = 277.18 D4 = 293.66 DS4 = 311.13 EF4 = 311.13 E4 = 329.63 F4 = 349.23 FS4 = 369.99 GF4 = 369.99 G4 = 392.00 GS4 = 415.30 AF4 = 415.30 A4 = 440.00 AS4 = 466.16 BF4 = 466.16 B4 = 493.88 ########## Octave 5 C5 = 523.25 CS5 = 554.37 DF5 = 554.378 D5 = 587.33 DS5 = 622.25 EF5 = 622.25 E5 = 659.25 F5 = 698.46 FS5 = 739.99 GF5 = 739.99 G5 = 783.99 GS5 = 830.61 AF5 = 830.61 A5 = 880.00 AS5 = 932.33 BF5 = 932.33 B5 = 987.77 ########## Octave 6 C6 = 1046.50 CS6 = 1108.73 DF6 = 1108.73 D6 = 1174.66 DS6 = 1244.51 EF6 = 1244.51 E6 = 1318.51 F6 = 1396.91 FS6 = 1479.98 GF6 = 1479.98 G6 = 1567.98 GS6 = 1661.22 AF6 = 1661.22 A6 = 1760.00 AS6 = 1864.66 BF6 = 1864.66 B6 = 1975.53 ########## Octave 7 C7 = 2093.00 CS7 = 2217.46 DF7 = 2217.46 D7 = 2349.32 DS7 = 2489.02 EF7 = 2489.02 E7 = 2637.02 F7 = 2793.83 FS7 = 2959.96 GF7 = 2959.96 G7 = 3135.96 GS7 = 3322.44 AF7 = 3322.44 A7 = 3520.00 AS7 = 3729.31 BF7 = 3729.31 B7 = 3951.07 ########## Octave 8 C8 = 4186.01 CS8 = 4434.92 DF8 = 4434.92 D8 = 4698.63 DS8 = 4978.03 EF8 = 4978.03 E8 = 5274.04 F8 = 5587.65 FS8 = 5919.91 GF8 = 5919.91 G8 = 6271.93 GS8 = 6644.88 AF8 = 6644.88 A8 = 7040.00 AS8 = 7458.62 BF8 = 7458.62 B8 = 7902.13
c = 261.63 cs = 277.18 df = 277.18 d = 293.66 ds = 311.13 ef = 311.13 e = 329.63 f = 349.23 fs = 369.99 gf = 369.99 g = 392.0 gs = 415.3 af = 415.3 a = 440.0 as = 466.16 bf = 466.16 b = 493.88 c0 = 16.35 cs0 = 17.32 df0 = 17.32 d0 = 18.35 ds0 = 19.45 ef0 = 19.45 e0 = 20.6 f0 = 21.83 fs0 = 23.12 gf0 = 23.12 g0 = 24.5 gs0 = 25.96 af0 = 25.96 a0 = 27.5 as0 = 29.14 bf0 = 29.14 b0 = 30.87 c1 = 32.7 cs1 = 34.65 df1 = 34.65 d1 = 36.71 ds1 = 38.89 ef1 = 38.89 e1 = 41.2 f1 = 43.65 fs1 = 46.25 gf1 = 46.25 g1 = 49.0 gs1 = 51.91 af1 = 51.91 a1 = 55.0 as1 = 58.27 bf1 = 58.27 b1 = 61.74 c2 = 65.41 cs2 = 69.3 df2 = 69.3 d2 = 73.42 ds2 = 77.78 ef2 = 77.78 e2 = 82.41 f2 = 87.31 fs2 = 92.5 gf2 = 92.5 g2 = 98.0 gs2 = 103.83 af2 = 103.83 a2 = 110.0 as2 = 116.54 bf2 = 116.54 b2 = 123.47 c3 = 130.81 cs3 = 138.59 df3 = 138.59 d3 = 146.83 ds3 = 155.56 ef3 = 155.56 e3 = 164.81 f3 = 174.61 fs3 = 185.0 gf3 = 185.0 g3 = 196.0 gs3 = 207.65 af3 = 207.65 a3 = 220.0 as3 = 233.08 bf3 = 233.08 b3 = 246.94 c4 = 261.63 cs4 = 277.18 df4 = 277.18 d4 = 293.66 ds4 = 311.13 ef4 = 311.13 e4 = 329.63 f4 = 349.23 fs4 = 369.99 gf4 = 369.99 g4 = 392.0 gs4 = 415.3 af4 = 415.3 a4 = 440.0 as4 = 466.16 bf4 = 466.16 b4 = 493.88 c5 = 523.25 cs5 = 554.37 df5 = 554.378 d5 = 587.33 ds5 = 622.25 ef5 = 622.25 e5 = 659.25 f5 = 698.46 fs5 = 739.99 gf5 = 739.99 g5 = 783.99 gs5 = 830.61 af5 = 830.61 a5 = 880.0 as5 = 932.33 bf5 = 932.33 b5 = 987.77 c6 = 1046.5 cs6 = 1108.73 df6 = 1108.73 d6 = 1174.66 ds6 = 1244.51 ef6 = 1244.51 e6 = 1318.51 f6 = 1396.91 fs6 = 1479.98 gf6 = 1479.98 g6 = 1567.98 gs6 = 1661.22 af6 = 1661.22 a6 = 1760.0 as6 = 1864.66 bf6 = 1864.66 b6 = 1975.53 c7 = 2093.0 cs7 = 2217.46 df7 = 2217.46 d7 = 2349.32 ds7 = 2489.02 ef7 = 2489.02 e7 = 2637.02 f7 = 2793.83 fs7 = 2959.96 gf7 = 2959.96 g7 = 3135.96 gs7 = 3322.44 af7 = 3322.44 a7 = 3520.0 as7 = 3729.31 bf7 = 3729.31 b7 = 3951.07 c8 = 4186.01 cs8 = 4434.92 df8 = 4434.92 d8 = 4698.63 ds8 = 4978.03 ef8 = 4978.03 e8 = 5274.04 f8 = 5587.65 fs8 = 5919.91 gf8 = 5919.91 g8 = 6271.93 gs8 = 6644.88 af8 = 6644.88 a8 = 7040.0 as8 = 7458.62 bf8 = 7458.62 b8 = 7902.13
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY # # To compare versions robustly, use `numpy.lib.NumpyVersion` short_version = '1.13.3' version = '1.13.3' full_version = '1.13.3' git_revision = '31465473c491829d636c9104c390062cba005681' release = True if not release: version = full_version
short_version = '1.13.3' version = '1.13.3' full_version = '1.13.3' git_revision = '31465473c491829d636c9104c390062cba005681' release = True if not release: version = full_version
ETHEREUM_TEST_PARAMETERS = ['ethrpc_endpoint,ethereum_manager_connect_at_start', [ # Query etherscan ('', False), # For real node querying let's use blockscout ('https://mainnet-nethermind.blockscout.com', True), ]]
ethereum_test_parameters = ['ethrpc_endpoint,ethereum_manager_connect_at_start', [('', False), ('https://mainnet-nethermind.blockscout.com', True)]]
class DataGridViewRowCancelEventArgs(CancelEventArgs): """ Provides data for the System.Windows.Forms.DataGridView.UserDeletingRow event of a System.Windows.Forms.DataGridView. DataGridViewRowCancelEventArgs(dataGridViewRow: DataGridViewRow) """ @staticmethod def __new__(self,dataGridViewRow): """ __new__(cls: type,dataGridViewRow: DataGridViewRow) """ pass Row=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the row that the user is deleting. Get: Row(self: DataGridViewRowCancelEventArgs) -> DataGridViewRow """
class Datagridviewrowcanceleventargs(CancelEventArgs): """ Provides data for the System.Windows.Forms.DataGridView.UserDeletingRow event of a System.Windows.Forms.DataGridView. DataGridViewRowCancelEventArgs(dataGridViewRow: DataGridViewRow) """ @staticmethod def __new__(self, dataGridViewRow): """ __new__(cls: type,dataGridViewRow: DataGridViewRow) """ pass row = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Gets the row that the user is deleting.\n\n\n\nGet: Row(self: DataGridViewRowCancelEventArgs) -> DataGridViewRow\n\n\n\n'
# Copyright 2016 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Rules for configuring the C++ toolchain (experimental).""" load("@bazel_tools//tools/cpp:windows_cc_configure.bzl", "configure_windows_toolchain") load("@bazel_tools//tools/cpp:osx_cc_configure.bzl", "configure_osx_toolchain") load("@bazel_tools//tools/cpp:unix_cc_configure.bzl", "configure_unix_toolchain") load("@bazel_tools//tools/cpp:lib_cc_configure.bzl", "get_cpu_value") def _impl(repository_ctx): repository_ctx.symlink( Label("@bazel_tools//tools/cpp:dummy_toolchain.bzl"), "dummy_toolchain.bzl") # cpu_value = get_cpu_value(repository_ctx) cpu_value = "arm" if cpu_value == "freebsd": # This is defaulting to the static crosstool, we should eventually # autoconfigure this platform too. Theorically, FreeBSD should be # straightforward to add but we cannot run it in a docker container so # skipping until we have proper tests for FreeBSD. repository_ctx.symlink(Label("@bazel_tools//tools/cpp:CROSSTOOL"), "CROSSTOOL") repository_ctx.symlink(Label("@bazel_tools//tools/cpp:BUILD.static"), "BUILD") elif cpu_value == "x64_windows": configure_windows_toolchain(repository_ctx) elif cpu_value == "darwin": configure_osx_toolchain(repository_ctx) else: configure_unix_toolchain(repository_ctx, cpu_value) cc_autoconf = repository_rule( implementation=_impl, environ = [ "ABI_LIBC_VERSION", "ABI_VERSION", "BAZEL_COMPILER", "BAZEL_HOST_SYSTEM", "BAZEL_PYTHON", "BAZEL_SH", "BAZEL_TARGET_CPU", "BAZEL_TARGET_LIBC", "BAZEL_TARGET_SYSTEM", "BAZEL_VC", "BAZEL_VS", "CC", "CC_CONFIGURE_DEBUG", "CC_TOOLCHAIN_NAME", "CPLUS_INCLUDE_PATH", "CUDA_COMPUTE_CAPABILITIES", "CUDA_PATH", "HOMEBREW_RUBY_PATH", "NO_WHOLE_ARCHIVE_OPTION", "USE_DYNAMIC_CRT", "USE_MSVC_WRAPPER", "SYSTEMROOT", "VS90COMNTOOLS", "VS100COMNTOOLS", "VS110COMNTOOLS", "VS120COMNTOOLS", "VS140COMNTOOLS"]) def cc_configure(): """A C++ configuration rules that generate the crosstool file.""" cc_autoconf(name="local_config_cc") native.bind(name="cc_toolchain", actual="@local_config_cc//:toolchain")
"""Rules for configuring the C++ toolchain (experimental).""" load('@bazel_tools//tools/cpp:windows_cc_configure.bzl', 'configure_windows_toolchain') load('@bazel_tools//tools/cpp:osx_cc_configure.bzl', 'configure_osx_toolchain') load('@bazel_tools//tools/cpp:unix_cc_configure.bzl', 'configure_unix_toolchain') load('@bazel_tools//tools/cpp:lib_cc_configure.bzl', 'get_cpu_value') def _impl(repository_ctx): repository_ctx.symlink(label('@bazel_tools//tools/cpp:dummy_toolchain.bzl'), 'dummy_toolchain.bzl') cpu_value = 'arm' if cpu_value == 'freebsd': repository_ctx.symlink(label('@bazel_tools//tools/cpp:CROSSTOOL'), 'CROSSTOOL') repository_ctx.symlink(label('@bazel_tools//tools/cpp:BUILD.static'), 'BUILD') elif cpu_value == 'x64_windows': configure_windows_toolchain(repository_ctx) elif cpu_value == 'darwin': configure_osx_toolchain(repository_ctx) else: configure_unix_toolchain(repository_ctx, cpu_value) cc_autoconf = repository_rule(implementation=_impl, environ=['ABI_LIBC_VERSION', 'ABI_VERSION', 'BAZEL_COMPILER', 'BAZEL_HOST_SYSTEM', 'BAZEL_PYTHON', 'BAZEL_SH', 'BAZEL_TARGET_CPU', 'BAZEL_TARGET_LIBC', 'BAZEL_TARGET_SYSTEM', 'BAZEL_VC', 'BAZEL_VS', 'CC', 'CC_CONFIGURE_DEBUG', 'CC_TOOLCHAIN_NAME', 'CPLUS_INCLUDE_PATH', 'CUDA_COMPUTE_CAPABILITIES', 'CUDA_PATH', 'HOMEBREW_RUBY_PATH', 'NO_WHOLE_ARCHIVE_OPTION', 'USE_DYNAMIC_CRT', 'USE_MSVC_WRAPPER', 'SYSTEMROOT', 'VS90COMNTOOLS', 'VS100COMNTOOLS', 'VS110COMNTOOLS', 'VS120COMNTOOLS', 'VS140COMNTOOLS']) def cc_configure(): """A C++ configuration rules that generate the crosstool file.""" cc_autoconf(name='local_config_cc') native.bind(name='cc_toolchain', actual='@local_config_cc//:toolchain')
BASE_URL = 'https://twitter.com' TIMELINE_SEARCH_URL = 'https://twitter.com/i/search/timeline' SEARCH_URL = 'https://twitter.com/search/' LOGIN_URL = 'https://twitter.com/login' SESSIONS_URL = 'https://twitter.com/sessions' RETWEET_URL = 'https://api.twitter.com/1.1/statuses/retweet.json' FOLLOW_URL = 'https://api.twitter.com/1.1/friendships/create.json' LIKE_URL = 'https://api.twitter.com/1.1/favorites/create.json' COOKIES_FILE = 'cookies.txt' BEARER = '''Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw''' UI_METRICS = '{"rf":{"c6fc1daac14ef08ff96ef7aa26f8642a197bfaad9c65746a6592d55075ef01af":3,"a77e6e7ab2880be27e81075edd6cac9c0b749cc266e1cea17ffc9670a9698252":-1,"ad3dbab6c68043a1127defab5b7d37e45d17f56a6997186b3a08a27544b606e8":252,"ac2624a3b325d64286579b4a61dd242539a755a5a7fa508c44eb1c373257d569":-125},"s":"fTQyo6c8mP7d6L8Og_iS8ulzPObBOzl3Jxa2jRwmtbOBJSk4v8ClmBbF9njbZHRLZx0mTAUPsImZ4OnbZV95f-2gD6-03SZZ8buYdTDkwV-xItDu5lBVCQ_EAiv3F5EuTpVl7F52FTIykWowpNIzowvh_bhCM0_6ReTGj6990294mIKUFM_mPHCyZ xkIUAtC3dVeYPXff92alrVFdrncrO8VnJHOlm9gnSwTLcbHvvpvC0rvtwapSbTja-cGxhxBdekFhcoFo8edCBiMB9pip-VoquZ-ddbQEbpuzE7xBhyk759yQyN4NmRFwdIjjedWYtFyOiy_XtGLp6zKvMjF8QAAAWE468LY"}'
base_url = 'https://twitter.com' timeline_search_url = 'https://twitter.com/i/search/timeline' search_url = 'https://twitter.com/search/' login_url = 'https://twitter.com/login' sessions_url = 'https://twitter.com/sessions' retweet_url = 'https://api.twitter.com/1.1/statuses/retweet.json' follow_url = 'https://api.twitter.com/1.1/friendships/create.json' like_url = 'https://api.twitter.com/1.1/favorites/create.json' cookies_file = 'cookies.txt' bearer = 'Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw' ui_metrics = '{"rf":{"c6fc1daac14ef08ff96ef7aa26f8642a197bfaad9c65746a6592d55075ef01af":3,"a77e6e7ab2880be27e81075edd6cac9c0b749cc266e1cea17ffc9670a9698252":-1,"ad3dbab6c68043a1127defab5b7d37e45d17f56a6997186b3a08a27544b606e8":252,"ac2624a3b325d64286579b4a61dd242539a755a5a7fa508c44eb1c373257d569":-125},"s":"fTQyo6c8mP7d6L8Og_iS8ulzPObBOzl3Jxa2jRwmtbOBJSk4v8ClmBbF9njbZHRLZx0mTAUPsImZ4OnbZV95f-2gD6-03SZZ8buYdTDkwV-xItDu5lBVCQ_EAiv3F5EuTpVl7F52FTIykWowpNIzowvh_bhCM0_6ReTGj6990294mIKUFM_mPHCyZ xkIUAtC3dVeYPXff92alrVFdrncrO8VnJHOlm9gnSwTLcbHvvpvC0rvtwapSbTja-cGxhxBdekFhcoFo8edCBiMB9pip-VoquZ-ddbQEbpuzE7xBhyk759yQyN4NmRFwdIjjedWYtFyOiy_XtGLp6zKvMjF8QAAAWE468LY"}'
arr=list(map(int,input().split())) left=0 right=len(arr)-1 while(left<=right): #print(left) #print(right) if arr[left]<0 and arr[right]<0: left+=1 elif arr[left]>0 and arr[right]<0: arr[left],arr[right]=arr[right],arr[left] left+=1 right-=1 elif arr[left]>0 and arr[right]>0: right-=1 else: left+=1 right-=1 print(arr)
arr = list(map(int, input().split())) left = 0 right = len(arr) - 1 while left <= right: if arr[left] < 0 and arr[right] < 0: left += 1 elif arr[left] > 0 and arr[right] < 0: (arr[left], arr[right]) = (arr[right], arr[left]) left += 1 right -= 1 elif arr[left] > 0 and arr[right] > 0: right -= 1 else: left += 1 right -= 1 print(arr)
class Solution: def profitableSchemes(self, G: int, P: int, group: List[int], profit: List[int]) -> int: @lru_cache(maxsize=None) def schemes(G, P, start): if G<0: return 0 if start==len(group): if P<=0: return 1 else: return 0 return schemes(G,P,start+1)+schemes(G-group[start], max(0,P-profit[start]), start+1) return schemes(G,P,0)%1000000007
class Solution: def profitable_schemes(self, G: int, P: int, group: List[int], profit: List[int]) -> int: @lru_cache(maxsize=None) def schemes(G, P, start): if G < 0: return 0 if start == len(group): if P <= 0: return 1 else: return 0 return schemes(G, P, start + 1) + schemes(G - group[start], max(0, P - profit[start]), start + 1) return schemes(G, P, 0) % 1000000007
def theSieve(n): '''# Finds all primes less than or equal to n using the Sieve of Eratosthenes''' # Create a boolean array # "prime[0..n]" and initialize # all entries it as true. # A value in prime[i] will # finally be false if i is # Not a prime, else true. prime = [True for i in range(n+1)] p = 2 results = [] while (p * p <= n): # If prime[p] is not # changed, then it is a prime if (prime[p] == True): # Update all multiples of p for i in range(p * p, n+1, p): prime[i] = False p += 1 # Add all prime numbers to our list for p in range(2, n+1): if prime[p]: # print(p) results.append(p) return results # Driver code if __name__ == '__main__': n = 10000 print("Following are the prime numbers smaller than or equal to", n) print(str(theSieve(n)))
def the_sieve(n): """# Finds all primes less than or equal to n using the Sieve of Eratosthenes""" prime = [True for i in range(n + 1)] p = 2 results = [] while p * p <= n: if prime[p] == True: for i in range(p * p, n + 1, p): prime[i] = False p += 1 for p in range(2, n + 1): if prime[p]: results.append(p) return results if __name__ == '__main__': n = 10000 print('Following are the prime numbers smaller than or equal to', n) print(str(the_sieve(n)))
# Solution A class Solution: def groupAnagrams(self, strs: List[str]) -> List[List[str]]: mp = collections.defaultdict(list) for st in strs: key = ''.join(sorted(st)) mp[key].append(st) return list(mp.values()) # Solution B class Solution: def groupAnagrams(self, strs: List[str]) -> List[List[str]]: mp = collections.defaultdict(list) for st in strs: ct = [0] * 26 for ch in st: ct[ord(ch) - ord('a')] += 1 mp[tuple(ct)].append(st) return list(mp.values())
class Solution: def group_anagrams(self, strs: List[str]) -> List[List[str]]: mp = collections.defaultdict(list) for st in strs: key = ''.join(sorted(st)) mp[key].append(st) return list(mp.values()) class Solution: def group_anagrams(self, strs: List[str]) -> List[List[str]]: mp = collections.defaultdict(list) for st in strs: ct = [0] * 26 for ch in st: ct[ord(ch) - ord('a')] += 1 mp[tuple(ct)].append(st) return list(mp.values())
while True: friends = hero.findFriends() for friend in friends: enemy = friend.findNearestEnemy() if enemy and friend.distanceTo(enemy) < 30: hero.command(friend, "attack", enemy) else: hero.command(friend, "move", {"x": friend.pos.x + 2, "y": friend.pos.y})
while True: friends = hero.findFriends() for friend in friends: enemy = friend.findNearestEnemy() if enemy and friend.distanceTo(enemy) < 30: hero.command(friend, 'attack', enemy) else: hero.command(friend, 'move', {'x': friend.pos.x + 2, 'y': friend.pos.y})
""" Utility scripts for PyTables ============================ :Author: Ivan Vilata i Balaguer :Contact: ivan@selidor.net :Created: 2005-12-01 :License: BSD :Revision: $Id$ This package contains some modules which provide a ``main()`` function (with no arguments), so that they can be used as scripts. """
""" Utility scripts for PyTables ============================ :Author: Ivan Vilata i Balaguer :Contact: ivan@selidor.net :Created: 2005-12-01 :License: BSD :Revision: $Id$ This package contains some modules which provide a ``main()`` function (with no arguments), so that they can be used as scripts. """
n = int(input()) if n & (n-1) > 0: print("NO") else: print("YES")
n = int(input()) if n & n - 1 > 0: print('NO') else: print('YES')
#!/usr/bin/env python3 """ momentum """ def update_variables_momentum(alpha, beta1, var, grad, v): """ Create momentum """ dw = beta1 * v + (1 - beta1) * grad w = var - alpha * dw return w, dw
""" momentum """ def update_variables_momentum(alpha, beta1, var, grad, v): """ Create momentum """ dw = beta1 * v + (1 - beta1) * grad w = var - alpha * dw return (w, dw)
number = 9.0 # Float number division_result = number / 2 division_remainder = number % 2 multiplication_result = division_result * 2 addition_result = multiplication_result + division_remainder subtraction_result = number - multiplication_result floor_result = number // 2 power_result = multiplication_result ** 3 print("result = " + str(subtraction_result))
number = 9.0 division_result = number / 2 division_remainder = number % 2 multiplication_result = division_result * 2 addition_result = multiplication_result + division_remainder subtraction_result = number - multiplication_result floor_result = number // 2 power_result = multiplication_result ** 3 print('result = ' + str(subtraction_result))
class TokenType(tuple): parent = None def __contains__(self, item): return item is not None and (self is item or item[:len(self)] == self) def __getattr__(self, name): new = TokenType(self + (name,)) setattr(self, name, new) new.parent = self return new def __repr__(self): return 'Token' + ('.' if self else '') + '.'.join(self) token_type = TokenType() # - Literals Literal = token_type.Literal # -- Primitive String = Literal.String Number = Literal.Number Integer = Number.Integer Float = Number.Float Boolean = Literal.Boolean None_ = Literal.None_ # -- Compound List = Literal.List # - Operators Operator = token_type.Operator # -- Comparison = Operator.Comparison Logical = Operator.Logical # - Identifier Identifier = token_type.Identifier Path = Identifier.Path # - Expression Expression = token_type.Expression
class Tokentype(tuple): parent = None def __contains__(self, item): return item is not None and (self is item or item[:len(self)] == self) def __getattr__(self, name): new = token_type(self + (name,)) setattr(self, name, new) new.parent = self return new def __repr__(self): return 'Token' + ('.' if self else '') + '.'.join(self) token_type = token_type() literal = token_type.Literal string = Literal.String number = Literal.Number integer = Number.Integer float = Number.Float boolean = Literal.Boolean none_ = Literal.None_ list = Literal.List operator = token_type.Operator comparison = Operator.Comparison logical = Operator.Logical identifier = token_type.Identifier path = Identifier.Path expression = token_type.Expression
""" 1. Clarification 2. Possible solutions - HashMap 3. Coding 4. Tests """ # T=O(n), S=O(min(n, k)) class Solution: def containsNearbyDuplicate(self, nums: List[int], k: int) -> bool: d = dict() for i in range(len(nums)): if nums[i] in d and i - d[nums[i]] <= k: return True d[nums[i]] = i return False
""" 1. Clarification 2. Possible solutions - HashMap 3. Coding 4. Tests """ class Solution: def contains_nearby_duplicate(self, nums: List[int], k: int) -> bool: d = dict() for i in range(len(nums)): if nums[i] in d and i - d[nums[i]] <= k: return True d[nums[i]] = i return False
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def hasCycle(self, head: ListNode) -> bool: if not head or not head.next: return False a, b = head, head.next while b and b.next and b.next.next: if a is b: return True a = a.next b = b.next.next return False
class Solution: def has_cycle(self, head: ListNode) -> bool: if not head or not head.next: return False (a, b) = (head, head.next) while b and b.next and b.next.next: if a is b: return True a = a.next b = b.next.next return False
class Node(): def __init__(self, val): self.val = val self.left = None self.right = None def search(root, val): if root is None or root.val == val: return root if root.val < val: return search(root.left, val) else: return search(root.right, val) def search_iterative(root, val): while root: if val > root.val: root = root.right elif val < root.val: root = root.left else: return True return False
class Node: def __init__(self, val): self.val = val self.left = None self.right = None def search(root, val): if root is None or root.val == val: return root if root.val < val: return search(root.left, val) else: return search(root.right, val) def search_iterative(root, val): while root: if val > root.val: root = root.right elif val < root.val: root = root.left else: return True return False
def show_cmd(task): return "executing... %s" % task.name def task_custom_display(): return {'actions':['echo abc efg'], 'title': show_cmd}
def show_cmd(task): return 'executing... %s' % task.name def task_custom_display(): return {'actions': ['echo abc efg'], 'title': show_cmd}
# This is an input class. Do not edit. class LinkedList: def __init__(self, value): self.value = value self.next = None def findLoop(head): slow = head.next fast = head.next.next while slow != fast: slow = slow.next fast = fast.next.next while head != slow: head = head.next slow = slow.next return head
class Linkedlist: def __init__(self, value): self.value = value self.next = None def find_loop(head): slow = head.next fast = head.next.next while slow != fast: slow = slow.next fast = fast.next.next while head != slow: head = head.next slow = slow.next return head
class NoMessageException(AssertionError): pass class ConnectionClosed(Exception): pass
class Nomessageexception(AssertionError): pass class Connectionclosed(Exception): pass
# Multiplying each element in a list by 2 original_list = [1,2,3,4] new_list = [2*x for x in original_list] print(new_list) # [2,4,6,8]
original_list = [1, 2, 3, 4] new_list = [2 * x for x in original_list] print(new_list)
# Created by MechAviv # Map ID :: 940205100 # Ravaged Base Remnants : Ravaged Eastern Base 1 sm.addPopUpSay(3001500, 1000, "#face8#There are more enemies every moment.", "") sm.systemMessage("Clear out all of the monsters first.")
sm.addPopUpSay(3001500, 1000, '#face8#There are more enemies every moment.', '') sm.systemMessage('Clear out all of the monsters first.')
# This is merely a tag type to avoid circular import issues. # Yes, this is a terrible solution but ultimately it is the only solution. # This was moved out of the ext.commands namespace so discord.Cog/CogMeta # could be imported into it for backwards compatibility. class _BaseCommand: __slots__ = ()
class _Basecommand: __slots__ = ()
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def alpaca_deps(): """Loads dependencies need to compile and test with the alpaca library.""" # googletest is a testing framework developed by Google. if "com_github_google_gooogletest" not in native.existing_rules(): http_archive( name = "com_github_google_googletest", strip_prefix = "googletest-release-1.10.0", urls = ["https://github.com/google/googletest/archive/release-1.10.0.tar.gz"], sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", ) # gflags is a C++ library that implements commandline flags processing. if "com_github_gflags_gflags" not in native.existing_rules(): http_archive( name = "com_github_gflags_gflags", strip_prefix = "gflags-2.2.2", urls = ["https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"], sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf", ) # glog is a C++ implementation of the Google logging module. if "com_github_google_glog" not in native.existing_rules(): http_archive( name = "com_github_google_glog", strip_prefix = "glog-0.4.0", urls = ["https://github.com/google/glog/archive/v0.4.0.tar.gz"], sha256 = "f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c", ) # RapidJSON is a fast JSON parser/generator for C++ with both SAX/DOM style API. if "com_github_tencent_rapidjson" not in native.existing_rules(): http_archive( name = "com_github_tencent_rapidjson", strip_prefix = "rapidjson-1.1.0", urls = ["https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz"], build_file = "@//bazel/third_party/rapidjson:BUILD", sha256 = "bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e", ) # cpp-httplib is a C++ header-only HTTP/HTTPS server and client library. if "com_github_yhirose_cpp-httplib" not in native.existing_rules(): http_archive( name = "com_github_yhirose_cpp_httplib", strip_prefix = "cpp-httplib-0.5.7", urls = ["https://github.com/yhirose/cpp-httplib/archive/v0.5.7.tar.gz"], build_file = "@//bazel/third_party/cpphttplib:BUILD", sha256 = "27b7f6346bdeb1ead9d17bd7cea89d9ad491f50f0479081053cc6e5742a89e64", ) # BoringSSL is a fork of OpenSSL that is designed to meet Google's needs. if "com_github_google_boringssl" not in native.existing_rules(): http_archive( name = "com_github_google_boringssl", strip_prefix = "boringssl-master-with-bazel", urls = ["https://github.com/google/boringssl/archive/master-with-bazel.tar.gz"], ) # zlib is a general purpose data compression library. if "com_github_madler_zlib" not in native.existing_rules(): http_archive( name = "com_github_madler_zlib", strip_prefix = "zlib-1.2.11", urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"], build_file = "@//bazel/third_party/zlib:BUILD", sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff", ) # libuv is a multi-platform support library with a focus on asynchronous I/O. if "com_github_libuv_libuv" not in native.existing_rules(): http_archive( name = "com_github_libuv_libuv", strip_prefix = "libuv-1.23.2", urls = ["https://github.com/libuv/libuv/archive/v1.23.2.tar.gz"], build_file = "@//bazel/third_party/libuv:BUILD", sha256 = "30af979c4f4b8d1b895ae6d115f7400c751542ccb9e656350fc89fda08d4eabd", ) # uWebsockets is a simple, secure & standards compliant web I/O library. if "com_github_unetworking_uwebsockets" not in native.existing_rules(): http_archive( name = "com_github_unetworking_uwebsockets", strip_prefix = "uWebSockets-0.14.8", urls = ["https://github.com/uNetworking/uWebSockets/archive/v0.14.8.tar.gz"], build_file = "@//bazel/third_party/uwebsockets:BUILD", sha256 = "663a22b521c8258e215e34e01c7fcdbbd500296aab2c31d36857228424bb7675", )
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') def alpaca_deps(): """Loads dependencies need to compile and test with the alpaca library.""" if 'com_github_google_gooogletest' not in native.existing_rules(): http_archive(name='com_github_google_googletest', strip_prefix='googletest-release-1.10.0', urls=['https://github.com/google/googletest/archive/release-1.10.0.tar.gz'], sha256='9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb') if 'com_github_gflags_gflags' not in native.existing_rules(): http_archive(name='com_github_gflags_gflags', strip_prefix='gflags-2.2.2', urls=['https://github.com/gflags/gflags/archive/v2.2.2.tar.gz'], sha256='34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf') if 'com_github_google_glog' not in native.existing_rules(): http_archive(name='com_github_google_glog', strip_prefix='glog-0.4.0', urls=['https://github.com/google/glog/archive/v0.4.0.tar.gz'], sha256='f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c') if 'com_github_tencent_rapidjson' not in native.existing_rules(): http_archive(name='com_github_tencent_rapidjson', strip_prefix='rapidjson-1.1.0', urls=['https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz'], build_file='@//bazel/third_party/rapidjson:BUILD', sha256='bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e') if 'com_github_yhirose_cpp-httplib' not in native.existing_rules(): http_archive(name='com_github_yhirose_cpp_httplib', strip_prefix='cpp-httplib-0.5.7', urls=['https://github.com/yhirose/cpp-httplib/archive/v0.5.7.tar.gz'], build_file='@//bazel/third_party/cpphttplib:BUILD', sha256='27b7f6346bdeb1ead9d17bd7cea89d9ad491f50f0479081053cc6e5742a89e64') if 'com_github_google_boringssl' not in native.existing_rules(): http_archive(name='com_github_google_boringssl', strip_prefix='boringssl-master-with-bazel', urls=['https://github.com/google/boringssl/archive/master-with-bazel.tar.gz']) if 'com_github_madler_zlib' not in native.existing_rules(): http_archive(name='com_github_madler_zlib', strip_prefix='zlib-1.2.11', urls=['https://github.com/madler/zlib/archive/v1.2.11.tar.gz'], build_file='@//bazel/third_party/zlib:BUILD', sha256='629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff') if 'com_github_libuv_libuv' not in native.existing_rules(): http_archive(name='com_github_libuv_libuv', strip_prefix='libuv-1.23.2', urls=['https://github.com/libuv/libuv/archive/v1.23.2.tar.gz'], build_file='@//bazel/third_party/libuv:BUILD', sha256='30af979c4f4b8d1b895ae6d115f7400c751542ccb9e656350fc89fda08d4eabd') if 'com_github_unetworking_uwebsockets' not in native.existing_rules(): http_archive(name='com_github_unetworking_uwebsockets', strip_prefix='uWebSockets-0.14.8', urls=['https://github.com/uNetworking/uWebSockets/archive/v0.14.8.tar.gz'], build_file='@//bazel/third_party/uwebsockets:BUILD', sha256='663a22b521c8258e215e34e01c7fcdbbd500296aab2c31d36857228424bb7675')
# Uses python3 def calc_fib(number): '''Given an integer n, find the nth Fibonacci number Fn.''' if number <= 1: return number previous = 0 current = 1 for _ in range(number - 1): previous, current = current, previous + current return current if __name__ == '__main__': num = int(input()) print(calc_fib(num))
def calc_fib(number): """Given an integer n, find the nth Fibonacci number Fn.""" if number <= 1: return number previous = 0 current = 1 for _ in range(number - 1): (previous, current) = (current, previous + current) return current if __name__ == '__main__': num = int(input()) print(calc_fib(num))
data = list(map(int, open("05.txt"))) size = len(data) # Part 1 vm = data.copy() ip = tick = 0 while (ip >= 0 and ip < size): jr = vm[ip] vm[ip] += 1 ip += jr tick += 1 print(tick) # Part 2 vm = data ip = tick = 0 while (ip >= 0 and ip < size): jr = vm[ip] vm[ip] += 1 if jr < 3 else -1 ip += jr tick += 1 print(tick)
data = list(map(int, open('05.txt'))) size = len(data) vm = data.copy() ip = tick = 0 while ip >= 0 and ip < size: jr = vm[ip] vm[ip] += 1 ip += jr tick += 1 print(tick) vm = data ip = tick = 0 while ip >= 0 and ip < size: jr = vm[ip] vm[ip] += 1 if jr < 3 else -1 ip += jr tick += 1 print(tick)
class NetworkService: def __init__(self, client): self.client = client def deleteMember(self, address, id, headers=None, query_params=None, content_type="application/json"): """ Delete member from network It is method for DELETE /network/{id}/member/{address} """ uri = self.client.base_url + "/network/"+id+"/member/"+address return self.client.delete(uri, None, headers, query_params, content_type) def getMember(self, address, id, headers=None, query_params=None, content_type="application/json"): """ Get network member settings It is method for GET /network/{id}/member/{address} """ uri = self.client.base_url + "/network/"+id+"/member/"+address return self.client.get(uri, None, headers, query_params, content_type) def updateMember(self, data, address, id, headers=None, query_params=None, content_type="application/json"): """ Update member settings It is method for POST /network/{id}/member/{address} """ uri = self.client.base_url + "/network/"+id+"/member/"+address return self.client.post(uri, data, headers, query_params, content_type) def listMembers(self, id, headers=None, query_params=None, content_type="application/json"): """ Get a list of network members It is method for GET /network/{id}/member """ uri = self.client.base_url + "/network/"+id+"/member" return self.client.get(uri, None, headers, query_params, content_type) def deleteNetwork(self, id, headers=None, query_params=None, content_type="application/json"): """ Delete network It is method for DELETE /network/{id} """ uri = self.client.base_url + "/network/"+id return self.client.delete(uri, None, headers, query_params, content_type) def getNetwork(self, id, headers=None, query_params=None, content_type="application/json"): """ Get network configuration and status information It is method for GET /network/{id} """ uri = self.client.base_url + "/network/"+id return self.client.get(uri, None, headers, query_params, content_type) def updateNetwork(self, data, id, headers=None, query_params=None, content_type="application/json"): """ Update network configuration It is method for POST /network/{id} """ uri = self.client.base_url + "/network/"+id return self.client.post(uri, data, headers, query_params, content_type) def listNetworks(self, headers=None, query_params=None, content_type="application/json"): """ Get a list of networks this user owns or can view/edit It is method for GET /network """ uri = self.client.base_url + "/network" return self.client.get(uri, None, headers, query_params, content_type) def createNetwork(self, data, headers=None, query_params=None, content_type="application/json"): """ Create a new network It is method for POST /network """ uri = self.client.base_url + "/network" return self.client.post(uri, data, headers, query_params, content_type)
class Networkservice: def __init__(self, client): self.client = client def delete_member(self, address, id, headers=None, query_params=None, content_type='application/json'): """ Delete member from network It is method for DELETE /network/{id}/member/{address} """ uri = self.client.base_url + '/network/' + id + '/member/' + address return self.client.delete(uri, None, headers, query_params, content_type) def get_member(self, address, id, headers=None, query_params=None, content_type='application/json'): """ Get network member settings It is method for GET /network/{id}/member/{address} """ uri = self.client.base_url + '/network/' + id + '/member/' + address return self.client.get(uri, None, headers, query_params, content_type) def update_member(self, data, address, id, headers=None, query_params=None, content_type='application/json'): """ Update member settings It is method for POST /network/{id}/member/{address} """ uri = self.client.base_url + '/network/' + id + '/member/' + address return self.client.post(uri, data, headers, query_params, content_type) def list_members(self, id, headers=None, query_params=None, content_type='application/json'): """ Get a list of network members It is method for GET /network/{id}/member """ uri = self.client.base_url + '/network/' + id + '/member' return self.client.get(uri, None, headers, query_params, content_type) def delete_network(self, id, headers=None, query_params=None, content_type='application/json'): """ Delete network It is method for DELETE /network/{id} """ uri = self.client.base_url + '/network/' + id return self.client.delete(uri, None, headers, query_params, content_type) def get_network(self, id, headers=None, query_params=None, content_type='application/json'): """ Get network configuration and status information It is method for GET /network/{id} """ uri = self.client.base_url + '/network/' + id return self.client.get(uri, None, headers, query_params, content_type) def update_network(self, data, id, headers=None, query_params=None, content_type='application/json'): """ Update network configuration It is method for POST /network/{id} """ uri = self.client.base_url + '/network/' + id return self.client.post(uri, data, headers, query_params, content_type) def list_networks(self, headers=None, query_params=None, content_type='application/json'): """ Get a list of networks this user owns or can view/edit It is method for GET /network """ uri = self.client.base_url + '/network' return self.client.get(uri, None, headers, query_params, content_type) def create_network(self, data, headers=None, query_params=None, content_type='application/json'): """ Create a new network It is method for POST /network """ uri = self.client.base_url + '/network' return self.client.post(uri, data, headers, query_params, content_type)
class Category: def __init__(self, bot, name: str = '', description: str = '', fp: str = ''): bot.categories[name] = self self.bot = bot self.name = name self.description = description self.fp = fp self.cogs = [] def add_cogs(self, *cogs): for cog in cogs: self.add_cog(cog) def remove_cogs(self): for cog in self.cogs: self.bot.remove_cog(cog) self.cogs.clear() def remove_cog(self, cog): self.bot.unload_extension(f"cogs.{self.fp}.{cog.qualified_name.lower()}") self.cogs.remove(cog) def add_cog(self, cog): self.bot.load_extension(f"cogs.{self.fp}.{cog.__name__.lower()}") c = self.bot.get_cog(cog.__name__) c.category = self self.cogs.append(c) @property def commands(self): cmds = [] for n in self.cogs: cmds.extend(n.commands) return cmds
class Category: def __init__(self, bot, name: str='', description: str='', fp: str=''): bot.categories[name] = self self.bot = bot self.name = name self.description = description self.fp = fp self.cogs = [] def add_cogs(self, *cogs): for cog in cogs: self.add_cog(cog) def remove_cogs(self): for cog in self.cogs: self.bot.remove_cog(cog) self.cogs.clear() def remove_cog(self, cog): self.bot.unload_extension(f'cogs.{self.fp}.{cog.qualified_name.lower()}') self.cogs.remove(cog) def add_cog(self, cog): self.bot.load_extension(f'cogs.{self.fp}.{cog.__name__.lower()}') c = self.bot.get_cog(cog.__name__) c.category = self self.cogs.append(c) @property def commands(self): cmds = [] for n in self.cogs: cmds.extend(n.commands) return cmds
class Solution: def isSubsequence(self, s: str, t: str) -> bool: if not s: return True s_index = 0 t_index = 0 while t_index < len(t): if s[s_index] == t[t_index]: s_index += 1 if s_index == len(s): return True t_index += 1 return False
class Solution: def is_subsequence(self, s: str, t: str) -> bool: if not s: return True s_index = 0 t_index = 0 while t_index < len(t): if s[s_index] == t[t_index]: s_index += 1 if s_index == len(s): return True t_index += 1 return False
''' In this module we implement counting sort ''' def counting_sort(arr): ''' Sort array using counting sort ''' count = [0] * (max(arr)+1) sorted_list = [0]*len(arr) for i in arr: count[i] += 1 for i in range(1,len(count)): count[i] += count[i-1] for i in arr: sorted_list[count[i] - 1] = i count[i] -= 1 return sorted_list
""" In this module we implement counting sort """ def counting_sort(arr): """ Sort array using counting sort """ count = [0] * (max(arr) + 1) sorted_list = [0] * len(arr) for i in arr: count[i] += 1 for i in range(1, len(count)): count[i] += count[i - 1] for i in arr: sorted_list[count[i] - 1] = i count[i] -= 1 return sorted_list
class Menu: def event_button_up(self): raise("Not implemented") def event_button_down(self): raise("Not implemented") def event_button_left(self): raise("Not implemented") def event_button_right(self): raise("Not implemented") def event_button_a(self): return def event_button_x(self): return def event_button_y(self): return def event_button_lb(self): return def event_button_rb(self): return def event_button_lt(self): return def event_button_rt(self): return def draw(self, screen): raise ("Not implemented")
class Menu: def event_button_up(self): raise 'Not implemented' def event_button_down(self): raise 'Not implemented' def event_button_left(self): raise 'Not implemented' def event_button_right(self): raise 'Not implemented' def event_button_a(self): return def event_button_x(self): return def event_button_y(self): return def event_button_lb(self): return def event_button_rb(self): return def event_button_lt(self): return def event_button_rt(self): return def draw(self, screen): raise 'Not implemented'
for x in (1, 3, 5): #will iterate once with 1, 3, etc usrRange = 4 for x in range (1, usrRange): #variables can be used as well print ("I will repeat this the specified number of times")
for x in (1, 3, 5): usr_range = 4 for x in range(1, usrRange): print('I will repeat this the specified number of times')
# 2018-11-1 , Model default configurations # lEFT DOWN RIGHT UP arrow key to operation options = [0, 1, 2, 3] # op = [ 65, 83, 68, 87] #'A' 'S' 'D' 'W' character to operation. #operation index actions = [0,1,2,3] # ESC end_game = 27 LR = 1e-3 goal_steps = 2000000 score_requirement = 1024 initial_games = 100
options = [0, 1, 2, 3] op = [65, 83, 68, 87] actions = [0, 1, 2, 3] end_game = 27 lr = 0.001 goal_steps = 2000000 score_requirement = 1024 initial_games = 100
# dervied from http://farsitools.sf.net # Copyright (C) 2003-2011 Parspooyesh Fanavar (http://parspooyesh.com/) # see LICENSE.txt g_days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] j_days_in_month = [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29] class GregorianToJalali: def __init__(self, gyear, gmonth, gday): """ Convert gregorian date to jalali date gmonth: number of month in range 1-12 """ self.gyear = gyear self.gmonth = gmonth self.gday = gday self.__gregorianToJalali() def getJalaliList(self): return (self.jyear, self.jmonth, self.jday) def __gregorianToJalali(self): """ g_y: gregorian year g_m: gregorian month g_d: gregorian day """ global g_days_in_month, j_days_in_month gy = self.gyear - 1600 gm = self.gmonth - 1 gd = self.gday - 1 g_day_no = 365 * gy + (gy + 3) // 4 - (gy + 99) // 100 + (gy + 399) // 400 for i in range(gm): g_day_no += g_days_in_month[i] if gm > 1 and ((gy % 4 == 0 and gy % 100 != 0) or (gy % 400 == 0)): # leap and after Feb g_day_no += 1 g_day_no += gd j_day_no = g_day_no - 79 j_np = j_day_no // 12053 j_day_no %= 12053 jy = 979 + 33 * j_np + 4 * int(j_day_no // 1461) j_day_no %= 1461 if j_day_no >= 366: jy += (j_day_no - 1) // 365 j_day_no = (j_day_no - 1) % 365 for i in range(11): if not j_day_no >= j_days_in_month[i]: i -= 1 break j_day_no -= j_days_in_month[i] jm = i + 2 jd = j_day_no + 1 self.jyear = jy self.jmonth = jm self.jday = jd class JalaliToGregorian: def __init__(self, jyear, jmonth, jday): """ Convert db time stamp (in gregorian date) to jalali date """ self.jyear = jyear self.jmonth = jmonth self.jday = jday self.__jalaliToGregorian() def getGregorianList(self): return (self.gyear, self.gmonth, self.gday) def __jalaliToGregorian(self): global g_days_in_month, j_days_in_month jy = self.jyear - 979 jm = self.jmonth - 1 jd = self.jday - 1 j_day_no = 365 * jy + int(jy // 33) * 8 + (jy % 33 + 3) // 4 for i in range(jm): j_day_no += j_days_in_month[i] j_day_no += jd g_day_no = j_day_no + 79 gy = 1600 + 400 * int(g_day_no // 146097) # 146097 = 365*400 + 400/4 - 400/100 + 400/400 g_day_no = g_day_no % 146097 leap = 1 if g_day_no >= 36525: # 36525 = 365*100 + 100/4 g_day_no -= 1 gy += 100 * int(g_day_no // 36524) # 36524 = 365*100 + 100/4 - 100/100 g_day_no = g_day_no % 36524 if g_day_no >= 365: g_day_no += 1 else: leap = 0 gy += 4 * int(g_day_no // 1461) # 1461 = 365*4 + 4/4 g_day_no %= 1461 if g_day_no >= 366: leap = 0 g_day_no -= 1 gy += g_day_no // 365 g_day_no = g_day_no % 365 i = 0 while g_day_no >= g_days_in_month[i] + (i == 1 and leap): g_day_no -= g_days_in_month[i] + (i == 1 and leap) i += 1 self.gmonth = i + 1 self.gday = g_day_no + 1 self.gyear = gy
g_days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] j_days_in_month = [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29] class Gregoriantojalali: def __init__(self, gyear, gmonth, gday): """ Convert gregorian date to jalali date gmonth: number of month in range 1-12 """ self.gyear = gyear self.gmonth = gmonth self.gday = gday self.__gregorianToJalali() def get_jalali_list(self): return (self.jyear, self.jmonth, self.jday) def __gregorian_to_jalali(self): """ g_y: gregorian year g_m: gregorian month g_d: gregorian day """ global g_days_in_month, j_days_in_month gy = self.gyear - 1600 gm = self.gmonth - 1 gd = self.gday - 1 g_day_no = 365 * gy + (gy + 3) // 4 - (gy + 99) // 100 + (gy + 399) // 400 for i in range(gm): g_day_no += g_days_in_month[i] if gm > 1 and (gy % 4 == 0 and gy % 100 != 0 or gy % 400 == 0): g_day_no += 1 g_day_no += gd j_day_no = g_day_no - 79 j_np = j_day_no // 12053 j_day_no %= 12053 jy = 979 + 33 * j_np + 4 * int(j_day_no // 1461) j_day_no %= 1461 if j_day_no >= 366: jy += (j_day_no - 1) // 365 j_day_no = (j_day_no - 1) % 365 for i in range(11): if not j_day_no >= j_days_in_month[i]: i -= 1 break j_day_no -= j_days_in_month[i] jm = i + 2 jd = j_day_no + 1 self.jyear = jy self.jmonth = jm self.jday = jd class Jalalitogregorian: def __init__(self, jyear, jmonth, jday): """ Convert db time stamp (in gregorian date) to jalali date """ self.jyear = jyear self.jmonth = jmonth self.jday = jday self.__jalaliToGregorian() def get_gregorian_list(self): return (self.gyear, self.gmonth, self.gday) def __jalali_to_gregorian(self): global g_days_in_month, j_days_in_month jy = self.jyear - 979 jm = self.jmonth - 1 jd = self.jday - 1 j_day_no = 365 * jy + int(jy // 33) * 8 + (jy % 33 + 3) // 4 for i in range(jm): j_day_no += j_days_in_month[i] j_day_no += jd g_day_no = j_day_no + 79 gy = 1600 + 400 * int(g_day_no // 146097) g_day_no = g_day_no % 146097 leap = 1 if g_day_no >= 36525: g_day_no -= 1 gy += 100 * int(g_day_no // 36524) g_day_no = g_day_no % 36524 if g_day_no >= 365: g_day_no += 1 else: leap = 0 gy += 4 * int(g_day_no // 1461) g_day_no %= 1461 if g_day_no >= 366: leap = 0 g_day_no -= 1 gy += g_day_no // 365 g_day_no = g_day_no % 365 i = 0 while g_day_no >= g_days_in_month[i] + (i == 1 and leap): g_day_no -= g_days_in_month[i] + (i == 1 and leap) i += 1 self.gmonth = i + 1 self.gday = g_day_no + 1 self.gyear = gy
# -*- coding: utf-8 -*- # Scrapy settings for douban project # # For simplicity, this file contains only the most important settings by # default. All the other settings are documented here: # # http://doc.scrapy.org/en/latest/topics/settings.html # BOT_NAME = 'douban' SPIDER_MODULES = ['douban.spiders'] NEWSPIDER_MODULE = 'douban.spiders' DOWNLOAD_DELAY = 0.1 RANDOMIZE_DOWNLOAD_DELAY = True USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.54 Safari/536.5' COOKIES_ENABLED = True LOG_LEVEL = 'WARNING' # pipelines ITEM_PIPELINES = { 'douban.pipelines.DoubanPipeline': 300 } # set as BFS DEPTH_PRIORITY = 1 SCHEDULER_DISK_QUEUE = 'scrapy.squeue.PickleFifoDiskQueue' SCHEDULER_MEMORY_QUEUE = 'scrapy.squeue.FifoMemoryQueue' # Crawl responsibly by identifying yourself (and your website) on the user-agent # USER_AGENT = 'douban (+http://www.yourdomain.com)'
bot_name = 'douban' spider_modules = ['douban.spiders'] newspider_module = 'douban.spiders' download_delay = 0.1 randomize_download_delay = True user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.54 Safari/536.5' cookies_enabled = True log_level = 'WARNING' item_pipelines = {'douban.pipelines.DoubanPipeline': 300} depth_priority = 1 scheduler_disk_queue = 'scrapy.squeue.PickleFifoDiskQueue' scheduler_memory_queue = 'scrapy.squeue.FifoMemoryQueue'
12 + 5 + 1 x=12 x y=20 print("Use print") print(y)
12 + 5 + 1 x = 12 x y = 20 print('Use print') print(y)
# -*- coding: UTF-8 -*- def add_numbers(x, y): return x + y print(type('This is a string')) # <type 'str'> print(type(None)) # <type 'NoneType'> print(type(1)) # <type 'int'> print(type(1.0)) # <type 'float'> print(type(add_numbers)) # <type 'function'> print('----------------------------------------') x = (1, 'a', 2, 'b') print(type(x)) # <type 'tuple'> x = [1, 'a', 2, 'b'] print(type(x)) # <type 'list'> x.append(3.3) print(x) # [1, 'a', 2, 'b', 3.3] print('----------------------------------------') for item in x: print(item) i = 0 while i != len(x): print(x[i]) i += 1 print([1, 2] + [3, 4]) # [1, 2, 3, 4] print([1] * 3) # [1, 1, 1] print(1 in [1, 2, 3]) # True print('----------------------------------------') x = 'This is a string' print(x[0]) # first character # T print(x[0:1]) # first character, but we have explicitly set the end character # T print(x[0:2]) # first two characters # Th print(x[-1]) # g print(x[-4:-2]) # ri print(x[:3]) # Thi print(x[3:]) # s is a string print('----------------------------------------') firstname = 'Christopher' lastname = 'Brooks' print(firstname + ' ' + lastname) # Christopher Brooks print(firstname * 3) # ChristopherChristopherChristopher print('Chris' in firstname) # True firstname = 'Christopher Arthur Hansen Brooks'.split(' ')[0] # [0] selects the first element of the list lastname = 'Christopher Arthur Hansen Brooks'.split(' ')[-1] # [-1] selects the last element of the list print(firstname) # Christopher print(lastname) # Brooks print('Chris' + str(2)) # Chris2 print('----------------------------------------') x = {'Christopher Brooks': 'brooksch@umich.edu', 'Bill Gates': 'billg@microsoft.com'} print(x['Christopher Brooks']) # Retrieve a value by using the indexing operator # brooksch@umich.edu x['Kevyn Collins-Thompson'] = None print(x['Kevyn Collins-Thompson']) # None for name in x: print(x[name]) for email in x.values(): print(email) for name, email in x.items(): print(name) print(email) print('----------------------------------------') # x = ('Christopher', 'Brooks', 'brooksch@umich.edu', 'Ann Arbor') # Error is x has 4 elements x = ('Christopher', 'Brooks', 'brooksch@umich.edu') fname, lname, email = x print(fname) # Christopher print(lname) # Brooks
def add_numbers(x, y): return x + y print(type('This is a string')) print(type(None)) print(type(1)) print(type(1.0)) print(type(add_numbers)) print('----------------------------------------') x = (1, 'a', 2, 'b') print(type(x)) x = [1, 'a', 2, 'b'] print(type(x)) x.append(3.3) print(x) print('----------------------------------------') for item in x: print(item) i = 0 while i != len(x): print(x[i]) i += 1 print([1, 2] + [3, 4]) print([1] * 3) print(1 in [1, 2, 3]) print('----------------------------------------') x = 'This is a string' print(x[0]) print(x[0:1]) print(x[0:2]) print(x[-1]) print(x[-4:-2]) print(x[:3]) print(x[3:]) print('----------------------------------------') firstname = 'Christopher' lastname = 'Brooks' print(firstname + ' ' + lastname) print(firstname * 3) print('Chris' in firstname) firstname = 'Christopher Arthur Hansen Brooks'.split(' ')[0] lastname = 'Christopher Arthur Hansen Brooks'.split(' ')[-1] print(firstname) print(lastname) print('Chris' + str(2)) print('----------------------------------------') x = {'Christopher Brooks': 'brooksch@umich.edu', 'Bill Gates': 'billg@microsoft.com'} print(x['Christopher Brooks']) x['Kevyn Collins-Thompson'] = None print(x['Kevyn Collins-Thompson']) for name in x: print(x[name]) for email in x.values(): print(email) for (name, email) in x.items(): print(name) print(email) print('----------------------------------------') x = ('Christopher', 'Brooks', 'brooksch@umich.edu') (fname, lname, email) = x print(fname) print(lname)
############################################################# # 2016-09-26: MboxType.py # Author: Jeremy M. Gibson (State Archives of North Carolina) # # Description: Implementation of the mbox-type ############################################################## class Mbox: """""" def __init__(self, rel_path=None, eol=None, hsh=None): """Constructor for Mbox""" self.rel_path = rel_path # type: str self.eol = eol # type: str self.hsh = hsh # type: Hash
class Mbox: """""" def __init__(self, rel_path=None, eol=None, hsh=None): """Constructor for Mbox""" self.rel_path = rel_path self.eol = eol self.hsh = hsh
__all__ = ( "SetOptConfError", "NamingError", "DataTypeError", "MissingRequiredError", "ReadOnlyError", ) class SetOptConfError(Exception): pass class NamingError(SetOptConfError): pass class DataTypeError(SetOptConfError): pass class MissingRequiredError(SetOptConfError): pass class ReadOnlyError(SetOptConfError): pass
__all__ = ('SetOptConfError', 'NamingError', 'DataTypeError', 'MissingRequiredError', 'ReadOnlyError') class Setoptconferror(Exception): pass class Namingerror(SetOptConfError): pass class Datatypeerror(SetOptConfError): pass class Missingrequirederror(SetOptConfError): pass class Readonlyerror(SetOptConfError): pass
''' The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' def can_paginate(operation_name=None): """ Check if an operation can be paginated. :type operation_name: string :param operation_name: The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator('create_foo'). """ pass def create_cloud_front_origin_access_identity(CloudFrontOriginAccessIdentityConfig=None): """ Creates a new origin access identity. If you're using Amazon S3 for your origin, you can use an origin access identity to require users to access your content using a CloudFront URL instead of the Amazon S3 URL. For more information about how to use origin access identities, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . See also: AWS API Documentation :example: response = client.create_cloud_front_origin_access_identity( CloudFrontOriginAccessIdentityConfig={ 'CallerReference': 'string', 'Comment': 'string' } ) :type CloudFrontOriginAccessIdentityConfig: dict :param CloudFrontOriginAccessIdentityConfig: [REQUIRED] The current configuration information for the identity. CallerReference (string) -- [REQUIRED]A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the CloudFrontOriginAccessIdentityConfig object), a new origin access identity is created. If the CallerReference is a value already sent in a previous identity request, and the content of the CloudFrontOriginAccessIdentityConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create an identity, but the content of the CloudFrontOriginAccessIdentityConfig is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists error. Comment (string) -- [REQUIRED]Any comments you want to include about the origin access identity. :rtype: dict :return: { 'CloudFrontOriginAccessIdentity': { 'Id': 'string', 'S3CanonicalUserId': 'string', 'CloudFrontOriginAccessIdentityConfig': { 'CallerReference': 'string', 'Comment': 'string' } }, 'Location': 'string', 'ETag': 'string' } """ pass def create_distribution(DistributionConfig=None): """ Creates a new web distribution. Send a POST request to the /*CloudFront API version* /distribution /distribution ID resource. See also: AWS API Documentation :example: response = client.create_distribution( DistributionConfig={ 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } ) :type DistributionConfig: dict :param DistributionConfig: [REQUIRED] The distribution's configuration information. CallerReference (string) -- [REQUIRED]A unique value (for example, a date-time stamp) that ensures that the request can't be replayed. If the value of CallerReference is new (regardless of the content of the DistributionConfig object), CloudFront creates a new distribution. If CallerReference is a value you already sent in a previous request to create a distribution, and if the content of the DistributionConfig is identical to the original request (ignoring white space), CloudFront returns the same the response that it returned to the original request. If CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- DefaultRootObject (string) --The object that you want CloudFront to request from your origin (for example, index.html ) when a viewer requests the root URL for your distribution (http://www.example.com ) instead of an object in your distribution (http://www.example.com/product-description.html ). Specifying a default root object avoids exposing the contents of your distribution. Specify only the object name, for example, index.html . Do not add a / before the object name. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object. For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide . Origins (dict) -- [REQUIRED]A complex type that contains information about origins for this distribution. Quantity (integer) -- [REQUIRED]The number of origins for this distribution. Items (list) --A complex type that contains origins for this distribution. (dict) --A complex type that describes the Amazon S3 bucket or the HTTP server (for example, a web server) from which CloudFront gets your files. You must create at least one origin. For the current limit on the number of origins that you can create for a distribution, see Amazon CloudFront Limits in the AWS General Reference . Id (string) -- [REQUIRED]A unique identifier for the origin. The value of Id must be unique within the distribution. When you specify the value of TargetOriginId for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the Id element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide . DomainName (string) -- [REQUIRED] Amazon S3 origins : The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com . Constraints for Amazon S3 origins: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. Custom Origins : The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, www.example.com . Constraints for custom origins: DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters. The name cannot exceed 128 characters. OriginPath (string) --An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the OriginPath element, specify the directory name, beginning with a / . CloudFront appends the directory name to the value of DomainName , for example, example.com/production . Do not include a / at the end of the directory name. For example, suppose you've specified the following values for your distribution: DomainName : An Amazon S3 bucket named myawsbucket . OriginPath : /production CNAME : example.com When a user enters example.com/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/index.html . When a user enters example.com/acme/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/acme/index.html . CustomHeaders (dict) --A complex type that contains names and values for the custom headers that you want. Quantity (integer) -- [REQUIRED]The number of custom headers, if any, for this distribution. Items (list) -- Optional : A list that contains one OriginCustomHeader element for each custom header that you want CloudFront to forward to the origin. If Quantity is 0 , omit Items . (dict) --A complex type that contains HeaderName and HeaderValue elements, if any, for this distribution. HeaderName (string) -- [REQUIRED]The name of a header that you want CloudFront to forward to your origin. For more information, see Forwarding Custom Headers to Your Origin (Web Distributions Only) in the Amazon Amazon CloudFront Developer Guide . HeaderValue (string) -- [REQUIRED]The value for the header that you specified in the HeaderName field. S3OriginConfig (dict) --A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the CustomOriginConfig element instead. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is: origin-access-identity/CloudFront/ID-of-origin-access-identity where `` ID-of-origin-access-identity `` is the value that CloudFront returned in the ID element when you created the origin access identity. If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . CustomOriginConfig (dict) --A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the S3OriginConfig element instead. HTTPPort (integer) -- [REQUIRED]The HTTP port the custom origin listens on. HTTPSPort (integer) -- [REQUIRED]The HTTPS port the custom origin listens on. OriginProtocolPolicy (string) -- [REQUIRED]The origin protocol policy to apply to your origin. OriginSslProtocols (dict) --The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. Quantity (integer) -- [REQUIRED]The number of SSL/TLS protocols that you want to allow CloudFront to use when establishing an HTTPS connection with this origin. Items (list) -- [REQUIRED]A list that contains allowed SSL/TLS protocols for this distribution. (string) -- OriginReadTimeout (integer) --You can create a custom origin read timeout. All timeout units are in seconds. The default origin read timeout is 30 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 4 seconds; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . OriginKeepaliveTimeout (integer) --You can create a custom keep-alive timeout. All timeout units are in seconds. The default keep-alive timeout is 5 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 1 second; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . DefaultCacheBehavior (dict) -- [REQUIRED]A complex type that describes the default cache behavior if you do not specify a CacheBehavior element or if files don't match any of the values of PathPattern in CacheBehavior elements. You must create exactly one default cache behavior. TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) -- Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true ; if not, specify false . For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CacheBehaviors (dict) --A complex type that contains zero or more CacheBehavior elements. Quantity (integer) -- [REQUIRED]The number of cache behaviors for this distribution. Items (list) --Optional: A complex type that contains cache behaviors for this distribution. If Quantity is 0 , you can omit Items . (dict) --A complex type that describes how CloudFront processes requests. You must create at least as many cache behaviors (including the default cache behavior) as you have origins if you want CloudFront to distribute objects from all of the origins. Each cache behavior specifies the one origin from which you want CloudFront to get objects. If you have two origins and only the default cache behavior, the default cache behavior will cause CloudFront to get objects from one of the origins, but the other origin is never used. For the current limit on the number of cache behaviors that you can add to a distribution, see Amazon CloudFront Limits in the AWS General Reference . If you don't want to specify any cache behaviors, include only an empty CacheBehaviors element. Don't include an empty CacheBehavior element, or CloudFront returns a MalformedXML error. To delete all cache behaviors in an existing distribution, update the distribution configuration and include only an empty CacheBehaviors element. To add, change, or remove one or more cache behaviors, update the distribution configuration and specify all of the cache behaviors that you want to include in the updated distribution. For more information about cache behaviors, see Cache Behaviors in the Amazon CloudFront Developer Guide . PathPattern (string) -- [REQUIRED]The pattern (for example, images/*.jpg ) that specifies which requests to apply the behavior to. When CloudFront receives a viewer request, the requested path is compared with path patterns in the order in which cache behaviors are listed in the distribution. Note You can optionally include a slash (/ ) at the beginning of the path pattern. For example, /images/*.jpg . CloudFront behavior is the same with or without the leading / . The path pattern for the default cache behavior is * and cannot be changed. If the request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in the default cache behavior. For more information, see Path Pattern in the Amazon CloudFront Developer Guide . TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) --The maximum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CustomErrorResponses (dict) --A complex type that controls the following: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Quantity (integer) -- [REQUIRED]The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If Quantity is 0 , you can omit Items . Items (list) --A complex type that contains a CustomErrorResponse element for each HTTP status code for which you want to specify a custom error page and/or a caching duration. (dict) --A complex type that controls: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . ErrorCode (integer) -- [REQUIRED]The HTTP status code for which you want to specify a custom error page and/or a caching duration. ResponsePagePath (string) --The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by ErrorCode , for example, /4xx-errors/403-forbidden.html . If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true: The value of PathPattern matches the path to your custom error messages. For example, suppose you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors . Your distribution must include a cache behavior for which the path pattern routes requests for your custom error pages to that location, for example, /4xx-errors/* . The value of TargetOriginId specifies the value of the ID element for the origin that contains your custom error pages. If you specify a value for ResponsePagePath , you must also specify a value for ResponseCode . If you don't want to specify a value, include an empty element, ResponsePagePath , in the XML document. We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable. ResponseCode (string) --The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example: Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute 200 , the response typically won't be intercepted. If you don't care about distinguishing among different client errors or server errors, you can specify 400 or 500 as the ResponseCode for all 4xx or 5xx errors. You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down. If you specify a value for ResponseCode , you must also specify a value for ResponsePagePath . If you don't want to specify a value, include an empty element, ResponseCode , in the XML document. ErrorCachingMinTTL (integer) --The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode . When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available. If you don't want to specify a value, include an empty element, ErrorCachingMinTTL , in the XML document. For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Comment (string) -- [REQUIRED]Any comments you want to include about the distribution. If you don't want to specify a comment, include an empty Comment element. To delete an existing comment, update the distribution configuration and include an empty Comment element. To add or change a comment, update the distribution configuration and specify the new comment. Logging (dict) --A complex type that controls whether access logs are written for the distribution. For more information about logging, see Access Logs in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a distribution or if you want to disable logging for an existing distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket , prefix , and IncludeCookies , the values are automatically deleted. IncludeCookies (boolean) -- [REQUIRED]Specifies whether you want CloudFront to include cookies in access logs, specify true for IncludeCookies . If you choose to include cookies in logs, CloudFront logs all cookies regardless of how you configure the cache behaviors for this distribution. If you do not want to include cookies when you create a distribution or if you want to disable include cookies for an existing distribution, specify false for IncludeCookies . Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. PriceClass (string) --The price class that corresponds with the maximum price that you want to pay for CloudFront service. If you specify PriceClass_All , CloudFront responds to requests for your objects from all CloudFront edge locations. If you specify a price class other than PriceClass_All , CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower performance. For more information about price classes, see Choosing the Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide . For information about CloudFront pricing, including how price classes map to CloudFront regions, see Amazon CloudFront Pricing . Enabled (boolean) -- [REQUIRED]From this field, you can enable or disable the selected distribution. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. ViewerCertificate (dict) --A complex type that specifies the following: Which SSL/TLS certificate to use when viewers request objects using HTTPS Whether you want CloudFront to use dedicated IP addresses or SNI when you're using alternate domain names in your object names The minimum protocol version that you want CloudFront to use when communicating with viewers For more information, see Using an HTTPS Connection to Access Your Objects in the Amazon Amazon CloudFront Developer Guide . CloudFrontDefaultCertificate (boolean) -- IAMCertificateId (string) -- ACMCertificateArn (string) -- SSLSupportMethod (string) --If you specify a value for ACMCertificateArn or for IAMCertificateId , you must also specify how you want CloudFront to serve HTTPS requests: using a method that works for all clients or one that works for most clients: vip : CloudFront uses dedicated IP addresses for your content and can respond to HTTPS requests from any viewer. However, you will incur additional monthly charges. sni-only : CloudFront can respond to HTTPS requests from viewers that support Server Name Indication (SNI). All modern browsers support SNI, but some browsers still in use don't support SNI. If some of your users' browsers don't support SNI, we recommend that you do one of the following: Use the vip option (dedicated IP addresses) instead of sni-only . Use the CloudFront SSL/TLS certificate instead of a custom certificate. This requires that you use the CloudFront domain name of your distribution in the URLs for your objects, for example, https://d111111abcdef8.cloudfront.net/logo.png . If you can control which browser your users use, upgrade the browser to one that supports SNI. Use HTTP instead of HTTPS. Do not specify a value for SSLSupportMethod if you specified CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate . For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . MinimumProtocolVersion (string) --Specify the minimum version of the SSL/TLS protocol that you want CloudFront to use for HTTPS connections between viewers and CloudFront: SSLv3 or TLSv1 . CloudFront serves your objects only to viewers that support SSL/TLS version that you specify and later versions. The TLSv1 protocol is more secure, so we recommend that you specify SSLv3 only if your users are using browsers or devices that don't support TLSv1 . Note the following: If you specify CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate, the minimum SSL protocol version is TLSv1 and can't be changed. If you're using a custom certificate (if you specify a value for ACMCertificateArn or for IAMCertificateId ) and if you're using SNI (if you specify sni-only for SSLSupportMethod ), you must specify TLSv1 for MinimumProtocolVersion . Certificate (string) --Include one of these values to specify the following: Whether you want viewers to use HTTP or HTTPS to request your objects. If you want viewers to use HTTPS, whether you're using an alternate domain name such as example.com or the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net . If you're using an alternate domain name, whether AWS Certificate Manager (ACM) provided the certificate, or you purchased a certificate from a third-party certificate authority and imported it into ACM or uploaded it to the IAM certificate store. You must specify one (and only one) of the three values. Do not specify false for CloudFrontDefaultCertificate . If you want viewers to use HTTP to request your objects : Specify the following value:CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate In addition, specify allow-all for ViewerProtocolPolicy for all of your cache behaviors. If you want viewers to use HTTPS to request your objects : Choose the type of certificate that you want to use based on whether you're using an alternate domain name for your objects or the CloudFront domain name: If you're using an alternate domain name, such as example.com : Specify one of the following values, depending on whether ACM provided your certificate or you purchased your certificate from third-party certificate authority: ACMCertificateArnARN for ACM SSL/TLS certificateACMCertificateArn where ARN for ACM SSL/TLS certificate is the ARN for the ACM SSL/TLS certificate that you want to use for this distribution. IAMCertificateIdIAM certificate IDIAMCertificateId where IAM certificate ID is the ID that IAM returned when you added the certificate to the IAM certificate store. If you specify ACMCertificateArn or IAMCertificateId , you must also specify a value for SSLSupportMethod . If you choose to use an ACM certificate or a certificate in the IAM certificate store, we recommend that you use only an alternate domain name in your object URLs (https://example.com/logo.jpg ). If you use the domain name that is associated with your CloudFront distribution (https://d111111abcdef8.cloudfront.net/logo.jpg ) and the viewer supports SNI , then CloudFront behaves normally. However, if the browser does not support SNI, the user's experience depends on the value that you choose for SSLSupportMethod : vip : The viewer displays a warning because there is a mismatch between the CloudFront domain name and the domain name in your SSL/TLS certificate. sni-only : CloudFront drops the connection with the browser without returning the object. **If you're using the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net ** : Specify the following value: `` CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate`` If you want viewers to use HTTPS, you must also specify one of the following values in your cache behaviors: ViewerProtocolPolicyhttps-onlyViewerProtocolPolicy ViewerProtocolPolicyredirect-to-httpsViewerProtocolPolicy You can also optionally require that CloudFront use HTTPS to communicate with your origin by specifying one of the following values for the applicable origins: OriginProtocolPolicyhttps-onlyOriginProtocolPolicy OriginProtocolPolicymatch-viewerOriginProtocolPolicy For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . CertificateSource (string) -- Note This field is deprecated. You can use one of the following: [ACMCertificateArn , IAMCertificateId , or CloudFrontDefaultCertificate] . Restrictions (dict) --A complex type that identifies ways in which you want to restrict distribution of your content. GeoRestriction (dict) -- [REQUIRED]A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using MaxMind GeoIP databases. RestrictionType (string) -- [REQUIRED]The method that you want to use to restrict distribution of your content by country: none : No geo restriction is enabled, meaning access to content is not restricted by client geo location. blacklist : The Location elements specify the countries in which you do not want CloudFront to distribute your content. whitelist : The Location elements specify the countries in which you want CloudFront to distribute your content. Quantity (integer) -- [REQUIRED]When geo restriction is enabled , this is the number of countries in your whitelist or blacklist . Otherwise, when it is not enabled, Quantity is 0 , and you can omit Items . Items (list) --A complex type that contains a Location element for each country in which you want CloudFront either to distribute your content (whitelist ) or not distribute your content (blacklist ). The Location element is a two-letter, uppercase country code for a country that you want to include in your blacklist or whitelist . Include one Location element for each country. CloudFront and MaxMind both use ISO 3166 country codes. For the current list of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on the International Organization for Standardization website. You can also refer to the country list in the CloudFront console, which includes both country names and codes. (string) -- WebACLId (string) --A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of query strings, CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide . HttpVersion (string) --(Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier HTTP version. For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name Identification (SNI). In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve performance by optimizing for HTTP/2. For more information, do an Internet search for 'http/2 optimization.' IsIPV6Enabled (boolean) --If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify true . If you specify false , CloudFront responds to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution. In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom policy that includes the IpAddress parameter to restrict the IP addresses that can access your content, do not enable IPv6. If you want to restrict access to some content by IP address and not restrict access to other content (or restrict access but not by IP address), you can create two distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide . If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the following are true: You enable IPv6 for the distribution You're using alternate domain names in the URLs for your objects For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53 Developer Guide . If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address format of the viewer request. :rtype: dict :return: { 'Distribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'InProgressInvalidationBatches': 123, 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } }, 'Location': 'string', 'ETag': 'string' } :returns: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. """ pass def create_distribution_with_tags(DistributionConfigWithTags=None): """ Create a new distribution with tags. See also: AWS API Documentation :example: response = client.create_distribution_with_tags( DistributionConfigWithTags={ 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, 'Tags': { 'Items': [ { 'Key': 'string', 'Value': 'string' }, ] } } ) :type DistributionConfigWithTags: dict :param DistributionConfigWithTags: [REQUIRED] The distribution's configuration information. DistributionConfig (dict) -- [REQUIRED]A distribution configuration. CallerReference (string) -- [REQUIRED]A unique value (for example, a date-time stamp) that ensures that the request can't be replayed. If the value of CallerReference is new (regardless of the content of the DistributionConfig object), CloudFront creates a new distribution. If CallerReference is a value you already sent in a previous request to create a distribution, and if the content of the DistributionConfig is identical to the original request (ignoring white space), CloudFront returns the same the response that it returned to the original request. If CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- DefaultRootObject (string) --The object that you want CloudFront to request from your origin (for example, index.html ) when a viewer requests the root URL for your distribution (http://www.example.com ) instead of an object in your distribution (http://www.example.com/product-description.html ). Specifying a default root object avoids exposing the contents of your distribution. Specify only the object name, for example, index.html . Do not add a / before the object name. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object. For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide . Origins (dict) -- [REQUIRED]A complex type that contains information about origins for this distribution. Quantity (integer) -- [REQUIRED]The number of origins for this distribution. Items (list) --A complex type that contains origins for this distribution. (dict) --A complex type that describes the Amazon S3 bucket or the HTTP server (for example, a web server) from which CloudFront gets your files. You must create at least one origin. For the current limit on the number of origins that you can create for a distribution, see Amazon CloudFront Limits in the AWS General Reference . Id (string) -- [REQUIRED]A unique identifier for the origin. The value of Id must be unique within the distribution. When you specify the value of TargetOriginId for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the Id element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide . DomainName (string) -- [REQUIRED] Amazon S3 origins : The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com . Constraints for Amazon S3 origins: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. Custom Origins : The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, www.example.com . Constraints for custom origins: DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters. The name cannot exceed 128 characters. OriginPath (string) --An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the OriginPath element, specify the directory name, beginning with a / . CloudFront appends the directory name to the value of DomainName , for example, example.com/production . Do not include a / at the end of the directory name. For example, suppose you've specified the following values for your distribution: DomainName : An Amazon S3 bucket named myawsbucket . OriginPath : /production CNAME : example.com When a user enters example.com/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/index.html . When a user enters example.com/acme/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/acme/index.html . CustomHeaders (dict) --A complex type that contains names and values for the custom headers that you want. Quantity (integer) -- [REQUIRED]The number of custom headers, if any, for this distribution. Items (list) -- Optional : A list that contains one OriginCustomHeader element for each custom header that you want CloudFront to forward to the origin. If Quantity is 0 , omit Items . (dict) --A complex type that contains HeaderName and HeaderValue elements, if any, for this distribution. HeaderName (string) -- [REQUIRED]The name of a header that you want CloudFront to forward to your origin. For more information, see Forwarding Custom Headers to Your Origin (Web Distributions Only) in the Amazon Amazon CloudFront Developer Guide . HeaderValue (string) -- [REQUIRED]The value for the header that you specified in the HeaderName field. S3OriginConfig (dict) --A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the CustomOriginConfig element instead. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is: origin-access-identity/CloudFront/ID-of-origin-access-identity where `` ID-of-origin-access-identity `` is the value that CloudFront returned in the ID element when you created the origin access identity. If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . CustomOriginConfig (dict) --A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the S3OriginConfig element instead. HTTPPort (integer) -- [REQUIRED]The HTTP port the custom origin listens on. HTTPSPort (integer) -- [REQUIRED]The HTTPS port the custom origin listens on. OriginProtocolPolicy (string) -- [REQUIRED]The origin protocol policy to apply to your origin. OriginSslProtocols (dict) --The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. Quantity (integer) -- [REQUIRED]The number of SSL/TLS protocols that you want to allow CloudFront to use when establishing an HTTPS connection with this origin. Items (list) -- [REQUIRED]A list that contains allowed SSL/TLS protocols for this distribution. (string) -- OriginReadTimeout (integer) --You can create a custom origin read timeout. All timeout units are in seconds. The default origin read timeout is 30 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 4 seconds; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . OriginKeepaliveTimeout (integer) --You can create a custom keep-alive timeout. All timeout units are in seconds. The default keep-alive timeout is 5 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 1 second; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . DefaultCacheBehavior (dict) -- [REQUIRED]A complex type that describes the default cache behavior if you do not specify a CacheBehavior element or if files don't match any of the values of PathPattern in CacheBehavior elements. You must create exactly one default cache behavior. TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) -- Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true ; if not, specify false . For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CacheBehaviors (dict) --A complex type that contains zero or more CacheBehavior elements. Quantity (integer) -- [REQUIRED]The number of cache behaviors for this distribution. Items (list) --Optional: A complex type that contains cache behaviors for this distribution. If Quantity is 0 , you can omit Items . (dict) --A complex type that describes how CloudFront processes requests. You must create at least as many cache behaviors (including the default cache behavior) as you have origins if you want CloudFront to distribute objects from all of the origins. Each cache behavior specifies the one origin from which you want CloudFront to get objects. If you have two origins and only the default cache behavior, the default cache behavior will cause CloudFront to get objects from one of the origins, but the other origin is never used. For the current limit on the number of cache behaviors that you can add to a distribution, see Amazon CloudFront Limits in the AWS General Reference . If you don't want to specify any cache behaviors, include only an empty CacheBehaviors element. Don't include an empty CacheBehavior element, or CloudFront returns a MalformedXML error. To delete all cache behaviors in an existing distribution, update the distribution configuration and include only an empty CacheBehaviors element. To add, change, or remove one or more cache behaviors, update the distribution configuration and specify all of the cache behaviors that you want to include in the updated distribution. For more information about cache behaviors, see Cache Behaviors in the Amazon CloudFront Developer Guide . PathPattern (string) -- [REQUIRED]The pattern (for example, images/*.jpg ) that specifies which requests to apply the behavior to. When CloudFront receives a viewer request, the requested path is compared with path patterns in the order in which cache behaviors are listed in the distribution. Note You can optionally include a slash (/ ) at the beginning of the path pattern. For example, /images/*.jpg . CloudFront behavior is the same with or without the leading / . The path pattern for the default cache behavior is * and cannot be changed. If the request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in the default cache behavior. For more information, see Path Pattern in the Amazon CloudFront Developer Guide . TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) --The maximum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CustomErrorResponses (dict) --A complex type that controls the following: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Quantity (integer) -- [REQUIRED]The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If Quantity is 0 , you can omit Items . Items (list) --A complex type that contains a CustomErrorResponse element for each HTTP status code for which you want to specify a custom error page and/or a caching duration. (dict) --A complex type that controls: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . ErrorCode (integer) -- [REQUIRED]The HTTP status code for which you want to specify a custom error page and/or a caching duration. ResponsePagePath (string) --The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by ErrorCode , for example, /4xx-errors/403-forbidden.html . If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true: The value of PathPattern matches the path to your custom error messages. For example, suppose you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors . Your distribution must include a cache behavior for which the path pattern routes requests for your custom error pages to that location, for example, /4xx-errors/* . The value of TargetOriginId specifies the value of the ID element for the origin that contains your custom error pages. If you specify a value for ResponsePagePath , you must also specify a value for ResponseCode . If you don't want to specify a value, include an empty element, ResponsePagePath , in the XML document. We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable. ResponseCode (string) --The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example: Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute 200 , the response typically won't be intercepted. If you don't care about distinguishing among different client errors or server errors, you can specify 400 or 500 as the ResponseCode for all 4xx or 5xx errors. You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down. If you specify a value for ResponseCode , you must also specify a value for ResponsePagePath . If you don't want to specify a value, include an empty element, ResponseCode , in the XML document. ErrorCachingMinTTL (integer) --The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode . When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available. If you don't want to specify a value, include an empty element, ErrorCachingMinTTL , in the XML document. For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Comment (string) -- [REQUIRED]Any comments you want to include about the distribution. If you don't want to specify a comment, include an empty Comment element. To delete an existing comment, update the distribution configuration and include an empty Comment element. To add or change a comment, update the distribution configuration and specify the new comment. Logging (dict) --A complex type that controls whether access logs are written for the distribution. For more information about logging, see Access Logs in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a distribution or if you want to disable logging for an existing distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket , prefix , and IncludeCookies , the values are automatically deleted. IncludeCookies (boolean) -- [REQUIRED]Specifies whether you want CloudFront to include cookies in access logs, specify true for IncludeCookies . If you choose to include cookies in logs, CloudFront logs all cookies regardless of how you configure the cache behaviors for this distribution. If you do not want to include cookies when you create a distribution or if you want to disable include cookies for an existing distribution, specify false for IncludeCookies . Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. PriceClass (string) --The price class that corresponds with the maximum price that you want to pay for CloudFront service. If you specify PriceClass_All , CloudFront responds to requests for your objects from all CloudFront edge locations. If you specify a price class other than PriceClass_All , CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower performance. For more information about price classes, see Choosing the Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide . For information about CloudFront pricing, including how price classes map to CloudFront regions, see Amazon CloudFront Pricing . Enabled (boolean) -- [REQUIRED]From this field, you can enable or disable the selected distribution. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. ViewerCertificate (dict) --A complex type that specifies the following: Which SSL/TLS certificate to use when viewers request objects using HTTPS Whether you want CloudFront to use dedicated IP addresses or SNI when you're using alternate domain names in your object names The minimum protocol version that you want CloudFront to use when communicating with viewers For more information, see Using an HTTPS Connection to Access Your Objects in the Amazon Amazon CloudFront Developer Guide . CloudFrontDefaultCertificate (boolean) -- IAMCertificateId (string) -- ACMCertificateArn (string) -- SSLSupportMethod (string) --If you specify a value for ACMCertificateArn or for IAMCertificateId , you must also specify how you want CloudFront to serve HTTPS requests: using a method that works for all clients or one that works for most clients: vip : CloudFront uses dedicated IP addresses for your content and can respond to HTTPS requests from any viewer. However, you will incur additional monthly charges. sni-only : CloudFront can respond to HTTPS requests from viewers that support Server Name Indication (SNI). All modern browsers support SNI, but some browsers still in use don't support SNI. If some of your users' browsers don't support SNI, we recommend that you do one of the following: Use the vip option (dedicated IP addresses) instead of sni-only . Use the CloudFront SSL/TLS certificate instead of a custom certificate. This requires that you use the CloudFront domain name of your distribution in the URLs for your objects, for example, https://d111111abcdef8.cloudfront.net/logo.png . If you can control which browser your users use, upgrade the browser to one that supports SNI. Use HTTP instead of HTTPS. Do not specify a value for SSLSupportMethod if you specified CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate . For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . MinimumProtocolVersion (string) --Specify the minimum version of the SSL/TLS protocol that you want CloudFront to use for HTTPS connections between viewers and CloudFront: SSLv3 or TLSv1 . CloudFront serves your objects only to viewers that support SSL/TLS version that you specify and later versions. The TLSv1 protocol is more secure, so we recommend that you specify SSLv3 only if your users are using browsers or devices that don't support TLSv1 . Note the following: If you specify CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate, the minimum SSL protocol version is TLSv1 and can't be changed. If you're using a custom certificate (if you specify a value for ACMCertificateArn or for IAMCertificateId ) and if you're using SNI (if you specify sni-only for SSLSupportMethod ), you must specify TLSv1 for MinimumProtocolVersion . Certificate (string) --Include one of these values to specify the following: Whether you want viewers to use HTTP or HTTPS to request your objects. If you want viewers to use HTTPS, whether you're using an alternate domain name such as example.com or the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net . If you're using an alternate domain name, whether AWS Certificate Manager (ACM) provided the certificate, or you purchased a certificate from a third-party certificate authority and imported it into ACM or uploaded it to the IAM certificate store. You must specify one (and only one) of the three values. Do not specify false for CloudFrontDefaultCertificate . If you want viewers to use HTTP to request your objects : Specify the following value:CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate In addition, specify allow-all for ViewerProtocolPolicy for all of your cache behaviors. If you want viewers to use HTTPS to request your objects : Choose the type of certificate that you want to use based on whether you're using an alternate domain name for your objects or the CloudFront domain name: If you're using an alternate domain name, such as example.com : Specify one of the following values, depending on whether ACM provided your certificate or you purchased your certificate from third-party certificate authority: ACMCertificateArnARN for ACM SSL/TLS certificateACMCertificateArn where ARN for ACM SSL/TLS certificate is the ARN for the ACM SSL/TLS certificate that you want to use for this distribution. IAMCertificateIdIAM certificate IDIAMCertificateId where IAM certificate ID is the ID that IAM returned when you added the certificate to the IAM certificate store. If you specify ACMCertificateArn or IAMCertificateId , you must also specify a value for SSLSupportMethod . If you choose to use an ACM certificate or a certificate in the IAM certificate store, we recommend that you use only an alternate domain name in your object URLs (https://example.com/logo.jpg ). If you use the domain name that is associated with your CloudFront distribution (https://d111111abcdef8.cloudfront.net/logo.jpg ) and the viewer supports SNI , then CloudFront behaves normally. However, if the browser does not support SNI, the user's experience depends on the value that you choose for SSLSupportMethod : vip : The viewer displays a warning because there is a mismatch between the CloudFront domain name and the domain name in your SSL/TLS certificate. sni-only : CloudFront drops the connection with the browser without returning the object. **If you're using the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net ** : Specify the following value: `` CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate`` If you want viewers to use HTTPS, you must also specify one of the following values in your cache behaviors: ViewerProtocolPolicyhttps-onlyViewerProtocolPolicy ViewerProtocolPolicyredirect-to-httpsViewerProtocolPolicy You can also optionally require that CloudFront use HTTPS to communicate with your origin by specifying one of the following values for the applicable origins: OriginProtocolPolicyhttps-onlyOriginProtocolPolicy OriginProtocolPolicymatch-viewerOriginProtocolPolicy For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . CertificateSource (string) -- Note This field is deprecated. You can use one of the following: [ACMCertificateArn , IAMCertificateId , or CloudFrontDefaultCertificate] . Restrictions (dict) --A complex type that identifies ways in which you want to restrict distribution of your content. GeoRestriction (dict) -- [REQUIRED]A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using MaxMind GeoIP databases. RestrictionType (string) -- [REQUIRED]The method that you want to use to restrict distribution of your content by country: none : No geo restriction is enabled, meaning access to content is not restricted by client geo location. blacklist : The Location elements specify the countries in which you do not want CloudFront to distribute your content. whitelist : The Location elements specify the countries in which you want CloudFront to distribute your content. Quantity (integer) -- [REQUIRED]When geo restriction is enabled , this is the number of countries in your whitelist or blacklist . Otherwise, when it is not enabled, Quantity is 0 , and you can omit Items . Items (list) --A complex type that contains a Location element for each country in which you want CloudFront either to distribute your content (whitelist ) or not distribute your content (blacklist ). The Location element is a two-letter, uppercase country code for a country that you want to include in your blacklist or whitelist . Include one Location element for each country. CloudFront and MaxMind both use ISO 3166 country codes. For the current list of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on the International Organization for Standardization website. You can also refer to the country list in the CloudFront console, which includes both country names and codes. (string) -- WebACLId (string) --A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of query strings, CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide . HttpVersion (string) --(Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier HTTP version. For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name Identification (SNI). In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve performance by optimizing for HTTP/2. For more information, do an Internet search for 'http/2 optimization.' IsIPV6Enabled (boolean) --If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify true . If you specify false , CloudFront responds to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution. In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom policy that includes the IpAddress parameter to restrict the IP addresses that can access your content, do not enable IPv6. If you want to restrict access to some content by IP address and not restrict access to other content (or restrict access but not by IP address), you can create two distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide . If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the following are true: You enable IPv6 for the distribution You're using alternate domain names in the URLs for your objects For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53 Developer Guide . If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address format of the viewer request. Tags (dict) -- [REQUIRED]A complex type that contains zero or more Tag elements. Items (list) --A complex type that contains Tag elements. (dict) --A complex type that contains Tag key and Tag value. Key (string) -- [REQUIRED]A string that contains Tag key. The string length should be between 1 and 128 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . Value (string) --A string that contains an optional Tag value. The string length should be between 0 and 256 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . :rtype: dict :return: { 'Distribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'InProgressInvalidationBatches': 123, 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } }, 'Location': 'string', 'ETag': 'string' } :returns: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. """ pass def create_invalidation(DistributionId=None, InvalidationBatch=None): """ Create a new invalidation. See also: AWS API Documentation :example: response = client.create_invalidation( DistributionId='string', InvalidationBatch={ 'Paths': { 'Quantity': 123, 'Items': [ 'string', ] }, 'CallerReference': 'string' } ) :type DistributionId: string :param DistributionId: [REQUIRED] The distribution's id. :type InvalidationBatch: dict :param InvalidationBatch: [REQUIRED] The batch information for the invalidation. Paths (dict) -- [REQUIRED]A complex type that contains information about the objects that you want to invalidate. For more information, see Specifying the Objects to Invalidate in the Amazon CloudFront Developer Guide . Quantity (integer) -- [REQUIRED]The number of objects that you want to invalidate. Items (list) --A complex type that contains a list of the paths that you want to invalidate. (string) -- CallerReference (string) -- [REQUIRED]A value that you specify to uniquely identify an invalidation request. CloudFront uses the value to prevent you from accidentally resubmitting an identical request. Whenever you create a new invalidation request, you must specify a new value for CallerReference and change other values in the request as applicable. One way to ensure that the value of CallerReference is unique is to use a timestamp , for example, 20120301090000 . If you make a second invalidation request with the same value for CallerReference , and if the rest of the request is the same, CloudFront doesn't create a new invalidation request. Instead, CloudFront returns information about the invalidation request that you previously created with the same CallerReference . If CallerReference is a value you already sent in a previous invalidation batch request but the content of any Path is different from the original request, CloudFront returns an InvalidationBatchAlreadyExists error. :rtype: dict :return: { 'Location': 'string', 'Invalidation': { 'Id': 'string', 'Status': 'string', 'CreateTime': datetime(2015, 1, 1), 'InvalidationBatch': { 'Paths': { 'Quantity': 123, 'Items': [ 'string', ] }, 'CallerReference': 'string' } } } :returns: (string) -- """ pass def create_streaming_distribution(StreamingDistributionConfig=None): """ Creates a new RMTP distribution. An RTMP distribution is similar to a web distribution, but an RTMP distribution streams media files using the Adobe Real-Time Messaging Protocol (RTMP) instead of serving files using HTTP. To create a new web distribution, submit a POST request to the CloudFront API version /distribution resource. The request body must include a document with a StreamingDistributionConfig element. The response echoes the StreamingDistributionConfig element and returns other information about the RTMP distribution. To get the status of your request, use the GET StreamingDistribution API action. When the value of Enabled is true and the value of Status is Deployed , your distribution is ready. A distribution usually deploys in less than 15 minutes. For more information about web distributions, see Working with RTMP Distributions in the Amazon CloudFront Developer Guide . See also: AWS API Documentation :example: response = client.create_streaming_distribution( StreamingDistributionConfig={ 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } ) :type StreamingDistributionConfig: dict :param StreamingDistributionConfig: [REQUIRED] The streaming distribution's configuration information. CallerReference (string) -- [REQUIRED]A unique number that ensures that the request can't be replayed. If the CallerReference is new (no matter the content of the StreamingDistributionConfig object), a new streaming distribution is created. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution, and the content of the StreamingDistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution but the content of the StreamingDistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. S3Origin (dict) -- [REQUIRED]A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution. DomainName (string) -- [REQUIRED]The DNS name of the Amazon S3 origin. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the RTMP distribution. Use an origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 bucket through CloudFront. If you want end users to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information, see Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content in the Amazon Amazon CloudFront Developer Guide . Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this streaming distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- Comment (string) -- [REQUIRED]Any comments you want to include about the streaming distribution. Logging (dict) --A complex type that controls whether access logs are written for the streaming distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a streaming distribution or if you want to disable logging for an existing streaming distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this streaming distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. TrustedSigners (dict) -- [REQUIRED]A complex type that specifies any AWS accounts that you want to permit to create signed URLs for private content. If you want the distribution to use signed URLs, include this element; if you want the distribution to use public URLs, remove this element. For more information, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- PriceClass (string) --A complex type that contains information about price class for this streaming distribution. Enabled (boolean) -- [REQUIRED]Whether the streaming distribution is enabled to accept user requests for content. :rtype: dict :return: { 'StreamingDistribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } }, 'Location': 'string', 'ETag': 'string' } :returns: (string) -- """ pass def create_streaming_distribution_with_tags(StreamingDistributionConfigWithTags=None): """ Create a new streaming distribution with tags. See also: AWS API Documentation :example: response = client.create_streaming_distribution_with_tags( StreamingDistributionConfigWithTags={ 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False }, 'Tags': { 'Items': [ { 'Key': 'string', 'Value': 'string' }, ] } } ) :type StreamingDistributionConfigWithTags: dict :param StreamingDistributionConfigWithTags: [REQUIRED] The streaming distribution's configuration information. StreamingDistributionConfig (dict) -- [REQUIRED]A streaming distribution Configuration. CallerReference (string) -- [REQUIRED]A unique number that ensures that the request can't be replayed. If the CallerReference is new (no matter the content of the StreamingDistributionConfig object), a new streaming distribution is created. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution, and the content of the StreamingDistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution but the content of the StreamingDistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. S3Origin (dict) -- [REQUIRED]A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution. DomainName (string) -- [REQUIRED]The DNS name of the Amazon S3 origin. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the RTMP distribution. Use an origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 bucket through CloudFront. If you want end users to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information, see Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content in the Amazon Amazon CloudFront Developer Guide . Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this streaming distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- Comment (string) -- [REQUIRED]Any comments you want to include about the streaming distribution. Logging (dict) --A complex type that controls whether access logs are written for the streaming distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a streaming distribution or if you want to disable logging for an existing streaming distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this streaming distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. TrustedSigners (dict) -- [REQUIRED]A complex type that specifies any AWS accounts that you want to permit to create signed URLs for private content. If you want the distribution to use signed URLs, include this element; if you want the distribution to use public URLs, remove this element. For more information, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- PriceClass (string) --A complex type that contains information about price class for this streaming distribution. Enabled (boolean) -- [REQUIRED]Whether the streaming distribution is enabled to accept user requests for content. Tags (dict) -- [REQUIRED]A complex type that contains zero or more Tag elements. Items (list) --A complex type that contains Tag elements. (dict) --A complex type that contains Tag key and Tag value. Key (string) -- [REQUIRED]A string that contains Tag key. The string length should be between 1 and 128 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . Value (string) --A string that contains an optional Tag value. The string length should be between 0 and 256 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . :rtype: dict :return: { 'StreamingDistribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } }, 'Location': 'string', 'ETag': 'string' } :returns: (string) -- """ pass def delete_cloud_front_origin_access_identity(Id=None, IfMatch=None): """ Delete an origin access identity. See also: AWS API Documentation :example: response = client.delete_cloud_front_origin_access_identity( Id='string', IfMatch='string' ) :type Id: string :param Id: [REQUIRED] The origin access identity's ID. :type IfMatch: string :param IfMatch: The value of the ETag header you received from a previous GET or PUT request. For example: E2QWRUHAPOMQZL . """ pass def delete_distribution(Id=None, IfMatch=None): """ Delete a distribution. See also: AWS API Documentation :example: response = client.delete_distribution( Id='string', IfMatch='string' ) :type Id: string :param Id: [REQUIRED] The distribution ID. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when you disabled the distribution. For example: E2QWRUHAPOMQZL . """ pass def delete_streaming_distribution(Id=None, IfMatch=None): """ Delete a streaming distribution. To delete an RTMP distribution using the CloudFront API, perform the following steps. For information about deleting a distribution using the CloudFront console, see Deleting a Distribution in the Amazon CloudFront Developer Guide . See also: AWS API Documentation :example: response = client.delete_streaming_distribution( Id='string', IfMatch='string' ) :type Id: string :param Id: [REQUIRED] The distribution ID. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when you disabled the streaming distribution. For example: E2QWRUHAPOMQZL . :returns: Id (string) -- [REQUIRED] The distribution ID. IfMatch (string) -- The value of the ETag header that you received when you disabled the streaming distribution. For example: E2QWRUHAPOMQZL . """ pass def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None): """ Generate a presigned url given a client, its method, and arguments :type ClientMethod: string :param ClientMethod: The client method to presign for :type Params: dict :param Params: The parameters normally passed to ClientMethod. :type ExpiresIn: int :param ExpiresIn: The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds) :type HttpMethod: string :param HttpMethod: The http method to use on the generated url. By default, the http method is whatever is used in the method's model. """ pass def get_cloud_front_origin_access_identity(Id=None): """ Get the information about an origin access identity. See also: AWS API Documentation :example: response = client.get_cloud_front_origin_access_identity( Id='string' ) :type Id: string :param Id: [REQUIRED] The identity's ID. :rtype: dict :return: { 'CloudFrontOriginAccessIdentity': { 'Id': 'string', 'S3CanonicalUserId': 'string', 'CloudFrontOriginAccessIdentityConfig': { 'CallerReference': 'string', 'Comment': 'string' } }, 'ETag': 'string' } """ pass def get_cloud_front_origin_access_identity_config(Id=None): """ Get the configuration information about an origin access identity. See also: AWS API Documentation :example: response = client.get_cloud_front_origin_access_identity_config( Id='string' ) :type Id: string :param Id: [REQUIRED] The identity's ID. :rtype: dict :return: { 'CloudFrontOriginAccessIdentityConfig': { 'CallerReference': 'string', 'Comment': 'string' }, 'ETag': 'string' } """ pass def get_distribution(Id=None): """ Get the information about a distribution. See also: AWS API Documentation :example: response = client.get_distribution( Id='string' ) :type Id: string :param Id: [REQUIRED] The distribution's ID. :rtype: dict :return: { 'Distribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'InProgressInvalidationBatches': 123, 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } }, 'ETag': 'string' } :returns: (string) -- """ pass def get_distribution_config(Id=None): """ Get the configuration information about a distribution. See also: AWS API Documentation :example: response = client.get_distribution_config( Id='string' ) :type Id: string :param Id: [REQUIRED] The distribution's ID. :rtype: dict :return: { 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, 'ETag': 'string' } :returns: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. """ pass def get_invalidation(DistributionId=None, Id=None): """ Get the information about an invalidation. See also: AWS API Documentation :example: response = client.get_invalidation( DistributionId='string', Id='string' ) :type DistributionId: string :param DistributionId: [REQUIRED] The distribution's ID. :type Id: string :param Id: [REQUIRED] The identifier for the invalidation request, for example, IDFDVBD632BHDS5 . :rtype: dict :return: { 'Invalidation': { 'Id': 'string', 'Status': 'string', 'CreateTime': datetime(2015, 1, 1), 'InvalidationBatch': { 'Paths': { 'Quantity': 123, 'Items': [ 'string', ] }, 'CallerReference': 'string' } } } :returns: (string) -- """ pass def get_paginator(operation_name=None): """ Create a paginator for an operation. :type operation_name: string :param operation_name: The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator('create_foo'). :rtype: L{botocore.paginate.Paginator} """ pass def get_streaming_distribution(Id=None): """ Gets information about a specified RTMP distribution, including the distribution configuration. See also: AWS API Documentation :example: response = client.get_streaming_distribution( Id='string' ) :type Id: string :param Id: [REQUIRED] The streaming distribution's ID. :rtype: dict :return: { 'StreamingDistribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } }, 'ETag': 'string' } :returns: (string) -- """ pass def get_streaming_distribution_config(Id=None): """ Get the configuration information about a streaming distribution. See also: AWS API Documentation :example: response = client.get_streaming_distribution_config( Id='string' ) :type Id: string :param Id: [REQUIRED] The streaming distribution's ID. :rtype: dict :return: { 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False }, 'ETag': 'string' } :returns: (string) -- """ pass def get_waiter(): """ """ pass def list_cloud_front_origin_access_identities(Marker=None, MaxItems=None): """ Lists origin access identities. See also: AWS API Documentation :example: response = client.list_cloud_front_origin_access_identities( Marker='string', MaxItems='string' ) :type Marker: string :param Marker: Use this when paginating results to indicate where to begin in your list of origin access identities. The results include identities in the list that occur after the marker. To get the next page of results, set the Marker to the value of the NextMarker from the current page's response (which is also the ID of the last identity on that page). :type MaxItems: string :param MaxItems: The maximum number of origin access identities you want in the response body. :rtype: dict :return: { 'CloudFrontOriginAccessIdentityList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'S3CanonicalUserId': 'string', 'Comment': 'string' }, ] } } """ pass def list_distributions(Marker=None, MaxItems=None): """ List distributions. See also: AWS API Documentation :example: response = client.list_distributions( Marker='string', MaxItems='string' ) :type Marker: string :param Marker: Use this when paginating results to indicate where to begin in your list of distributions. The results include distributions in the list that occur after the marker. To get the next page of results, set the Marker to the value of the NextMarker from the current page's response (which is also the ID of the last distribution on that page). :type MaxItems: string :param MaxItems: The maximum number of distributions you want in the response body. :rtype: dict :return: { 'DistributionList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, ] } } :returns: (string) -- """ pass def list_distributions_by_web_acl_id(Marker=None, MaxItems=None, WebACLId=None): """ List the distributions that are associated with a specified AWS WAF web ACL. See also: AWS API Documentation :example: response = client.list_distributions_by_web_acl_id( Marker='string', MaxItems='string', WebACLId='string' ) :type Marker: string :param Marker: Use Marker and MaxItems to control pagination of results. If you have more than MaxItems distributions that satisfy the request, the response includes a NextMarker element. To get the next page of results, submit another request. For the value of Marker , specify the value of NextMarker from the last response. (For the first request, omit Marker .) :type MaxItems: string :param MaxItems: The maximum number of distributions that you want CloudFront to return in the response body. The maximum and default values are both 100. :type WebACLId: string :param WebACLId: [REQUIRED] The ID of the AWS WAF web ACL that you want to list the associated distributions. If you specify 'null' for the ID, the request returns a list of the distributions that aren't associated with a web ACL. :rtype: dict :return: { 'DistributionList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, ] } } :returns: (string) -- """ pass def list_invalidations(DistributionId=None, Marker=None, MaxItems=None): """ Lists invalidation batches. See also: AWS API Documentation :example: response = client.list_invalidations( DistributionId='string', Marker='string', MaxItems='string' ) :type DistributionId: string :param DistributionId: [REQUIRED] The distribution's ID. :type Marker: string :param Marker: Use this parameter when paginating results to indicate where to begin in your list of invalidation batches. Because the results are returned in decreasing order from most recent to oldest, the most recent results are on the first page, the second page will contain earlier results, and so on. To get the next page of results, set Marker to the value of the NextMarker from the current page's response. This value is the same as the ID of the last invalidation batch on that page. :type MaxItems: string :param MaxItems: The maximum number of invalidation batches that you want in the response body. :rtype: dict :return: { 'InvalidationList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'CreateTime': datetime(2015, 1, 1), 'Status': 'string' }, ] } } """ pass def list_streaming_distributions(Marker=None, MaxItems=None): """ List streaming distributions. See also: AWS API Documentation :example: response = client.list_streaming_distributions( Marker='string', MaxItems='string' ) :type Marker: string :param Marker: The value that you provided for the Marker request parameter. :type MaxItems: string :param MaxItems: The value that you provided for the MaxItems request parameter. :rtype: dict :return: { 'StreamingDistributionList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False }, ] } } :returns: (string) -- """ pass def list_tags_for_resource(Resource=None): """ List tags for a CloudFront resource. See also: AWS API Documentation :example: response = client.list_tags_for_resource( Resource='string' ) :type Resource: string :param Resource: [REQUIRED] An ARN of a CloudFront resource. :rtype: dict :return: { 'Tags': { 'Items': [ { 'Key': 'string', 'Value': 'string' }, ] } } """ pass def tag_resource(Resource=None, Tags=None): """ Add tags to a CloudFront resource. See also: AWS API Documentation :example: response = client.tag_resource( Resource='string', Tags={ 'Items': [ { 'Key': 'string', 'Value': 'string' }, ] } ) :type Resource: string :param Resource: [REQUIRED] An ARN of a CloudFront resource. :type Tags: dict :param Tags: [REQUIRED] A complex type that contains zero or more Tag elements. Items (list) --A complex type that contains Tag elements. (dict) --A complex type that contains Tag key and Tag value. Key (string) -- [REQUIRED]A string that contains Tag key. The string length should be between 1 and 128 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . Value (string) --A string that contains an optional Tag value. The string length should be between 0 and 256 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . """ pass def untag_resource(Resource=None, TagKeys=None): """ Remove tags from a CloudFront resource. See also: AWS API Documentation :example: response = client.untag_resource( Resource='string', TagKeys={ 'Items': [ 'string', ] } ) :type Resource: string :param Resource: [REQUIRED] An ARN of a CloudFront resource. :type TagKeys: dict :param TagKeys: [REQUIRED] A complex type that contains zero or more Tag key elements. Items (list) --A complex type that contains Tag key elements. (string) --A string that contains Tag key. The string length should be between 1 and 128 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . """ pass def update_cloud_front_origin_access_identity(CloudFrontOriginAccessIdentityConfig=None, Id=None, IfMatch=None): """ Update an origin access identity. See also: AWS API Documentation :example: response = client.update_cloud_front_origin_access_identity( CloudFrontOriginAccessIdentityConfig={ 'CallerReference': 'string', 'Comment': 'string' }, Id='string', IfMatch='string' ) :type CloudFrontOriginAccessIdentityConfig: dict :param CloudFrontOriginAccessIdentityConfig: [REQUIRED] The identity's configuration information. CallerReference (string) -- [REQUIRED]A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the CloudFrontOriginAccessIdentityConfig object), a new origin access identity is created. If the CallerReference is a value already sent in a previous identity request, and the content of the CloudFrontOriginAccessIdentityConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create an identity, but the content of the CloudFrontOriginAccessIdentityConfig is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists error. Comment (string) -- [REQUIRED]Any comments you want to include about the origin access identity. :type Id: string :param Id: [REQUIRED] The identity's id. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when retrieving the identity's configuration. For example: E2QWRUHAPOMQZL . :rtype: dict :return: { 'CloudFrontOriginAccessIdentity': { 'Id': 'string', 'S3CanonicalUserId': 'string', 'CloudFrontOriginAccessIdentityConfig': { 'CallerReference': 'string', 'Comment': 'string' } }, 'ETag': 'string' } """ pass def update_distribution(DistributionConfig=None, Id=None, IfMatch=None): """ Update a distribution. See also: AWS API Documentation :example: response = client.update_distribution( DistributionConfig={ 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, Id='string', IfMatch='string' ) :type DistributionConfig: dict :param DistributionConfig: [REQUIRED] The distribution's configuration information. CallerReference (string) -- [REQUIRED]A unique value (for example, a date-time stamp) that ensures that the request can't be replayed. If the value of CallerReference is new (regardless of the content of the DistributionConfig object), CloudFront creates a new distribution. If CallerReference is a value you already sent in a previous request to create a distribution, and if the content of the DistributionConfig is identical to the original request (ignoring white space), CloudFront returns the same the response that it returned to the original request. If CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- DefaultRootObject (string) --The object that you want CloudFront to request from your origin (for example, index.html ) when a viewer requests the root URL for your distribution (http://www.example.com ) instead of an object in your distribution (http://www.example.com/product-description.html ). Specifying a default root object avoids exposing the contents of your distribution. Specify only the object name, for example, index.html . Do not add a / before the object name. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object. For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide . Origins (dict) -- [REQUIRED]A complex type that contains information about origins for this distribution. Quantity (integer) -- [REQUIRED]The number of origins for this distribution. Items (list) --A complex type that contains origins for this distribution. (dict) --A complex type that describes the Amazon S3 bucket or the HTTP server (for example, a web server) from which CloudFront gets your files. You must create at least one origin. For the current limit on the number of origins that you can create for a distribution, see Amazon CloudFront Limits in the AWS General Reference . Id (string) -- [REQUIRED]A unique identifier for the origin. The value of Id must be unique within the distribution. When you specify the value of TargetOriginId for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the Id element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide . DomainName (string) -- [REQUIRED] Amazon S3 origins : The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com . Constraints for Amazon S3 origins: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. Custom Origins : The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, www.example.com . Constraints for custom origins: DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters. The name cannot exceed 128 characters. OriginPath (string) --An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the OriginPath element, specify the directory name, beginning with a / . CloudFront appends the directory name to the value of DomainName , for example, example.com/production . Do not include a / at the end of the directory name. For example, suppose you've specified the following values for your distribution: DomainName : An Amazon S3 bucket named myawsbucket . OriginPath : /production CNAME : example.com When a user enters example.com/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/index.html . When a user enters example.com/acme/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/acme/index.html . CustomHeaders (dict) --A complex type that contains names and values for the custom headers that you want. Quantity (integer) -- [REQUIRED]The number of custom headers, if any, for this distribution. Items (list) -- Optional : A list that contains one OriginCustomHeader element for each custom header that you want CloudFront to forward to the origin. If Quantity is 0 , omit Items . (dict) --A complex type that contains HeaderName and HeaderValue elements, if any, for this distribution. HeaderName (string) -- [REQUIRED]The name of a header that you want CloudFront to forward to your origin. For more information, see Forwarding Custom Headers to Your Origin (Web Distributions Only) in the Amazon Amazon CloudFront Developer Guide . HeaderValue (string) -- [REQUIRED]The value for the header that you specified in the HeaderName field. S3OriginConfig (dict) --A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the CustomOriginConfig element instead. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is: origin-access-identity/CloudFront/ID-of-origin-access-identity where `` ID-of-origin-access-identity `` is the value that CloudFront returned in the ID element when you created the origin access identity. If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . CustomOriginConfig (dict) --A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the S3OriginConfig element instead. HTTPPort (integer) -- [REQUIRED]The HTTP port the custom origin listens on. HTTPSPort (integer) -- [REQUIRED]The HTTPS port the custom origin listens on. OriginProtocolPolicy (string) -- [REQUIRED]The origin protocol policy to apply to your origin. OriginSslProtocols (dict) --The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. Quantity (integer) -- [REQUIRED]The number of SSL/TLS protocols that you want to allow CloudFront to use when establishing an HTTPS connection with this origin. Items (list) -- [REQUIRED]A list that contains allowed SSL/TLS protocols for this distribution. (string) -- OriginReadTimeout (integer) --You can create a custom origin read timeout. All timeout units are in seconds. The default origin read timeout is 30 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 4 seconds; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . OriginKeepaliveTimeout (integer) --You can create a custom keep-alive timeout. All timeout units are in seconds. The default keep-alive timeout is 5 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 1 second; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . DefaultCacheBehavior (dict) -- [REQUIRED]A complex type that describes the default cache behavior if you do not specify a CacheBehavior element or if files don't match any of the values of PathPattern in CacheBehavior elements. You must create exactly one default cache behavior. TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) -- Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true ; if not, specify false . For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CacheBehaviors (dict) --A complex type that contains zero or more CacheBehavior elements. Quantity (integer) -- [REQUIRED]The number of cache behaviors for this distribution. Items (list) --Optional: A complex type that contains cache behaviors for this distribution. If Quantity is 0 , you can omit Items . (dict) --A complex type that describes how CloudFront processes requests. You must create at least as many cache behaviors (including the default cache behavior) as you have origins if you want CloudFront to distribute objects from all of the origins. Each cache behavior specifies the one origin from which you want CloudFront to get objects. If you have two origins and only the default cache behavior, the default cache behavior will cause CloudFront to get objects from one of the origins, but the other origin is never used. For the current limit on the number of cache behaviors that you can add to a distribution, see Amazon CloudFront Limits in the AWS General Reference . If you don't want to specify any cache behaviors, include only an empty CacheBehaviors element. Don't include an empty CacheBehavior element, or CloudFront returns a MalformedXML error. To delete all cache behaviors in an existing distribution, update the distribution configuration and include only an empty CacheBehaviors element. To add, change, or remove one or more cache behaviors, update the distribution configuration and specify all of the cache behaviors that you want to include in the updated distribution. For more information about cache behaviors, see Cache Behaviors in the Amazon CloudFront Developer Guide . PathPattern (string) -- [REQUIRED]The pattern (for example, images/*.jpg ) that specifies which requests to apply the behavior to. When CloudFront receives a viewer request, the requested path is compared with path patterns in the order in which cache behaviors are listed in the distribution. Note You can optionally include a slash (/ ) at the beginning of the path pattern. For example, /images/*.jpg . CloudFront behavior is the same with or without the leading / . The path pattern for the default cache behavior is * and cannot be changed. If the request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in the default cache behavior. For more information, see Path Pattern in the Amazon CloudFront Developer Guide . TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) --The maximum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CustomErrorResponses (dict) --A complex type that controls the following: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Quantity (integer) -- [REQUIRED]The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If Quantity is 0 , you can omit Items . Items (list) --A complex type that contains a CustomErrorResponse element for each HTTP status code for which you want to specify a custom error page and/or a caching duration. (dict) --A complex type that controls: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . ErrorCode (integer) -- [REQUIRED]The HTTP status code for which you want to specify a custom error page and/or a caching duration. ResponsePagePath (string) --The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by ErrorCode , for example, /4xx-errors/403-forbidden.html . If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true: The value of PathPattern matches the path to your custom error messages. For example, suppose you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors . Your distribution must include a cache behavior for which the path pattern routes requests for your custom error pages to that location, for example, /4xx-errors/* . The value of TargetOriginId specifies the value of the ID element for the origin that contains your custom error pages. If you specify a value for ResponsePagePath , you must also specify a value for ResponseCode . If you don't want to specify a value, include an empty element, ResponsePagePath , in the XML document. We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable. ResponseCode (string) --The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example: Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute 200 , the response typically won't be intercepted. If you don't care about distinguishing among different client errors or server errors, you can specify 400 or 500 as the ResponseCode for all 4xx or 5xx errors. You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down. If you specify a value for ResponseCode , you must also specify a value for ResponsePagePath . If you don't want to specify a value, include an empty element, ResponseCode , in the XML document. ErrorCachingMinTTL (integer) --The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode . When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available. If you don't want to specify a value, include an empty element, ErrorCachingMinTTL , in the XML document. For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Comment (string) -- [REQUIRED]Any comments you want to include about the distribution. If you don't want to specify a comment, include an empty Comment element. To delete an existing comment, update the distribution configuration and include an empty Comment element. To add or change a comment, update the distribution configuration and specify the new comment. Logging (dict) --A complex type that controls whether access logs are written for the distribution. For more information about logging, see Access Logs in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a distribution or if you want to disable logging for an existing distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket , prefix , and IncludeCookies , the values are automatically deleted. IncludeCookies (boolean) -- [REQUIRED]Specifies whether you want CloudFront to include cookies in access logs, specify true for IncludeCookies . If you choose to include cookies in logs, CloudFront logs all cookies regardless of how you configure the cache behaviors for this distribution. If you do not want to include cookies when you create a distribution or if you want to disable include cookies for an existing distribution, specify false for IncludeCookies . Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. PriceClass (string) --The price class that corresponds with the maximum price that you want to pay for CloudFront service. If you specify PriceClass_All , CloudFront responds to requests for your objects from all CloudFront edge locations. If you specify a price class other than PriceClass_All , CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower performance. For more information about price classes, see Choosing the Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide . For information about CloudFront pricing, including how price classes map to CloudFront regions, see Amazon CloudFront Pricing . Enabled (boolean) -- [REQUIRED]From this field, you can enable or disable the selected distribution. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. ViewerCertificate (dict) --A complex type that specifies the following: Which SSL/TLS certificate to use when viewers request objects using HTTPS Whether you want CloudFront to use dedicated IP addresses or SNI when you're using alternate domain names in your object names The minimum protocol version that you want CloudFront to use when communicating with viewers For more information, see Using an HTTPS Connection to Access Your Objects in the Amazon Amazon CloudFront Developer Guide . CloudFrontDefaultCertificate (boolean) -- IAMCertificateId (string) -- ACMCertificateArn (string) -- SSLSupportMethod (string) --If you specify a value for ACMCertificateArn or for IAMCertificateId , you must also specify how you want CloudFront to serve HTTPS requests: using a method that works for all clients or one that works for most clients: vip : CloudFront uses dedicated IP addresses for your content and can respond to HTTPS requests from any viewer. However, you will incur additional monthly charges. sni-only : CloudFront can respond to HTTPS requests from viewers that support Server Name Indication (SNI). All modern browsers support SNI, but some browsers still in use don't support SNI. If some of your users' browsers don't support SNI, we recommend that you do one of the following: Use the vip option (dedicated IP addresses) instead of sni-only . Use the CloudFront SSL/TLS certificate instead of a custom certificate. This requires that you use the CloudFront domain name of your distribution in the URLs for your objects, for example, https://d111111abcdef8.cloudfront.net/logo.png . If you can control which browser your users use, upgrade the browser to one that supports SNI. Use HTTP instead of HTTPS. Do not specify a value for SSLSupportMethod if you specified CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate . For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . MinimumProtocolVersion (string) --Specify the minimum version of the SSL/TLS protocol that you want CloudFront to use for HTTPS connections between viewers and CloudFront: SSLv3 or TLSv1 . CloudFront serves your objects only to viewers that support SSL/TLS version that you specify and later versions. The TLSv1 protocol is more secure, so we recommend that you specify SSLv3 only if your users are using browsers or devices that don't support TLSv1 . Note the following: If you specify CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate, the minimum SSL protocol version is TLSv1 and can't be changed. If you're using a custom certificate (if you specify a value for ACMCertificateArn or for IAMCertificateId ) and if you're using SNI (if you specify sni-only for SSLSupportMethod ), you must specify TLSv1 for MinimumProtocolVersion . Certificate (string) --Include one of these values to specify the following: Whether you want viewers to use HTTP or HTTPS to request your objects. If you want viewers to use HTTPS, whether you're using an alternate domain name such as example.com or the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net . If you're using an alternate domain name, whether AWS Certificate Manager (ACM) provided the certificate, or you purchased a certificate from a third-party certificate authority and imported it into ACM or uploaded it to the IAM certificate store. You must specify one (and only one) of the three values. Do not specify false for CloudFrontDefaultCertificate . If you want viewers to use HTTP to request your objects : Specify the following value:CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate In addition, specify allow-all for ViewerProtocolPolicy for all of your cache behaviors. If you want viewers to use HTTPS to request your objects : Choose the type of certificate that you want to use based on whether you're using an alternate domain name for your objects or the CloudFront domain name: If you're using an alternate domain name, such as example.com : Specify one of the following values, depending on whether ACM provided your certificate or you purchased your certificate from third-party certificate authority: ACMCertificateArnARN for ACM SSL/TLS certificateACMCertificateArn where ARN for ACM SSL/TLS certificate is the ARN for the ACM SSL/TLS certificate that you want to use for this distribution. IAMCertificateIdIAM certificate IDIAMCertificateId where IAM certificate ID is the ID that IAM returned when you added the certificate to the IAM certificate store. If you specify ACMCertificateArn or IAMCertificateId , you must also specify a value for SSLSupportMethod . If you choose to use an ACM certificate or a certificate in the IAM certificate store, we recommend that you use only an alternate domain name in your object URLs (https://example.com/logo.jpg ). If you use the domain name that is associated with your CloudFront distribution (https://d111111abcdef8.cloudfront.net/logo.jpg ) and the viewer supports SNI , then CloudFront behaves normally. However, if the browser does not support SNI, the user's experience depends on the value that you choose for SSLSupportMethod : vip : The viewer displays a warning because there is a mismatch between the CloudFront domain name and the domain name in your SSL/TLS certificate. sni-only : CloudFront drops the connection with the browser without returning the object. **If you're using the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net ** : Specify the following value: `` CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate`` If you want viewers to use HTTPS, you must also specify one of the following values in your cache behaviors: ViewerProtocolPolicyhttps-onlyViewerProtocolPolicy ViewerProtocolPolicyredirect-to-httpsViewerProtocolPolicy You can also optionally require that CloudFront use HTTPS to communicate with your origin by specifying one of the following values for the applicable origins: OriginProtocolPolicyhttps-onlyOriginProtocolPolicy OriginProtocolPolicymatch-viewerOriginProtocolPolicy For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . CertificateSource (string) -- Note This field is deprecated. You can use one of the following: [ACMCertificateArn , IAMCertificateId , or CloudFrontDefaultCertificate] . Restrictions (dict) --A complex type that identifies ways in which you want to restrict distribution of your content. GeoRestriction (dict) -- [REQUIRED]A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using MaxMind GeoIP databases. RestrictionType (string) -- [REQUIRED]The method that you want to use to restrict distribution of your content by country: none : No geo restriction is enabled, meaning access to content is not restricted by client geo location. blacklist : The Location elements specify the countries in which you do not want CloudFront to distribute your content. whitelist : The Location elements specify the countries in which you want CloudFront to distribute your content. Quantity (integer) -- [REQUIRED]When geo restriction is enabled , this is the number of countries in your whitelist or blacklist . Otherwise, when it is not enabled, Quantity is 0 , and you can omit Items . Items (list) --A complex type that contains a Location element for each country in which you want CloudFront either to distribute your content (whitelist ) or not distribute your content (blacklist ). The Location element is a two-letter, uppercase country code for a country that you want to include in your blacklist or whitelist . Include one Location element for each country. CloudFront and MaxMind both use ISO 3166 country codes. For the current list of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on the International Organization for Standardization website. You can also refer to the country list in the CloudFront console, which includes both country names and codes. (string) -- WebACLId (string) --A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of query strings, CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide . HttpVersion (string) --(Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier HTTP version. For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name Identification (SNI). In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve performance by optimizing for HTTP/2. For more information, do an Internet search for 'http/2 optimization.' IsIPV6Enabled (boolean) --If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify true . If you specify false , CloudFront responds to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution. In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom policy that includes the IpAddress parameter to restrict the IP addresses that can access your content, do not enable IPv6. If you want to restrict access to some content by IP address and not restrict access to other content (or restrict access but not by IP address), you can create two distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide . If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the following are true: You enable IPv6 for the distribution You're using alternate domain names in the URLs for your objects For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53 Developer Guide . If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address format of the viewer request. :type Id: string :param Id: [REQUIRED] The distribution's id. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when retrieving the distribution's configuration. For example: E2QWRUHAPOMQZL . :rtype: dict :return: { 'Distribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'InProgressInvalidationBatches': 123, 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } }, 'ETag': 'string' } :returns: self , which is the AWS account used to create the distribution. An AWS account number. """ pass def update_streaming_distribution(StreamingDistributionConfig=None, Id=None, IfMatch=None): """ Update a streaming distribution. See also: AWS API Documentation :example: response = client.update_streaming_distribution( StreamingDistributionConfig={ 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False }, Id='string', IfMatch='string' ) :type StreamingDistributionConfig: dict :param StreamingDistributionConfig: [REQUIRED] The streaming distribution's configuration information. CallerReference (string) -- [REQUIRED]A unique number that ensures that the request can't be replayed. If the CallerReference is new (no matter the content of the StreamingDistributionConfig object), a new streaming distribution is created. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution, and the content of the StreamingDistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution but the content of the StreamingDistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. S3Origin (dict) -- [REQUIRED]A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution. DomainName (string) -- [REQUIRED]The DNS name of the Amazon S3 origin. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the RTMP distribution. Use an origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 bucket through CloudFront. If you want end users to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information, see Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content in the Amazon Amazon CloudFront Developer Guide . Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this streaming distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- Comment (string) -- [REQUIRED]Any comments you want to include about the streaming distribution. Logging (dict) --A complex type that controls whether access logs are written for the streaming distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a streaming distribution or if you want to disable logging for an existing streaming distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this streaming distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. TrustedSigners (dict) -- [REQUIRED]A complex type that specifies any AWS accounts that you want to permit to create signed URLs for private content. If you want the distribution to use signed URLs, include this element; if you want the distribution to use public URLs, remove this element. For more information, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- PriceClass (string) --A complex type that contains information about price class for this streaming distribution. Enabled (boolean) -- [REQUIRED]Whether the streaming distribution is enabled to accept user requests for content. :type Id: string :param Id: [REQUIRED] The streaming distribution's id. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when retrieving the streaming distribution's configuration. For example: E2QWRUHAPOMQZL . :rtype: dict :return: { 'StreamingDistribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } }, 'ETag': 'string' } :returns: self , which is the AWS account used to create the distribution. An AWS account number. """ pass
""" The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ def can_paginate(operation_name=None): """ Check if an operation can be paginated. :type operation_name: string :param operation_name: The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator('create_foo'). """ pass def create_cloud_front_origin_access_identity(CloudFrontOriginAccessIdentityConfig=None): """ Creates a new origin access identity. If you're using Amazon S3 for your origin, you can use an origin access identity to require users to access your content using a CloudFront URL instead of the Amazon S3 URL. For more information about how to use origin access identities, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . See also: AWS API Documentation :example: response = client.create_cloud_front_origin_access_identity( CloudFrontOriginAccessIdentityConfig={ 'CallerReference': 'string', 'Comment': 'string' } ) :type CloudFrontOriginAccessIdentityConfig: dict :param CloudFrontOriginAccessIdentityConfig: [REQUIRED] The current configuration information for the identity. CallerReference (string) -- [REQUIRED]A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the CloudFrontOriginAccessIdentityConfig object), a new origin access identity is created. If the CallerReference is a value already sent in a previous identity request, and the content of the CloudFrontOriginAccessIdentityConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create an identity, but the content of the CloudFrontOriginAccessIdentityConfig is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists error. Comment (string) -- [REQUIRED]Any comments you want to include about the origin access identity. :rtype: dict :return: { 'CloudFrontOriginAccessIdentity': { 'Id': 'string', 'S3CanonicalUserId': 'string', 'CloudFrontOriginAccessIdentityConfig': { 'CallerReference': 'string', 'Comment': 'string' } }, 'Location': 'string', 'ETag': 'string' } """ pass def create_distribution(DistributionConfig=None): """ Creates a new web distribution. Send a POST request to the /*CloudFront API version* /distribution /distribution ID resource. See also: AWS API Documentation :example: response = client.create_distribution( DistributionConfig={ 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } ) :type DistributionConfig: dict :param DistributionConfig: [REQUIRED] The distribution's configuration information. CallerReference (string) -- [REQUIRED]A unique value (for example, a date-time stamp) that ensures that the request can't be replayed. If the value of CallerReference is new (regardless of the content of the DistributionConfig object), CloudFront creates a new distribution. If CallerReference is a value you already sent in a previous request to create a distribution, and if the content of the DistributionConfig is identical to the original request (ignoring white space), CloudFront returns the same the response that it returned to the original request. If CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- DefaultRootObject (string) --The object that you want CloudFront to request from your origin (for example, index.html ) when a viewer requests the root URL for your distribution (http://www.example.com ) instead of an object in your distribution (http://www.example.com/product-description.html ). Specifying a default root object avoids exposing the contents of your distribution. Specify only the object name, for example, index.html . Do not add a / before the object name. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object. For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide . Origins (dict) -- [REQUIRED]A complex type that contains information about origins for this distribution. Quantity (integer) -- [REQUIRED]The number of origins for this distribution. Items (list) --A complex type that contains origins for this distribution. (dict) --A complex type that describes the Amazon S3 bucket or the HTTP server (for example, a web server) from which CloudFront gets your files. You must create at least one origin. For the current limit on the number of origins that you can create for a distribution, see Amazon CloudFront Limits in the AWS General Reference . Id (string) -- [REQUIRED]A unique identifier for the origin. The value of Id must be unique within the distribution. When you specify the value of TargetOriginId for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the Id element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide . DomainName (string) -- [REQUIRED] Amazon S3 origins : The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com . Constraints for Amazon S3 origins: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. Custom Origins : The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, www.example.com . Constraints for custom origins: DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters. The name cannot exceed 128 characters. OriginPath (string) --An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the OriginPath element, specify the directory name, beginning with a / . CloudFront appends the directory name to the value of DomainName , for example, example.com/production . Do not include a / at the end of the directory name. For example, suppose you've specified the following values for your distribution: DomainName : An Amazon S3 bucket named myawsbucket . OriginPath : /production CNAME : example.com When a user enters example.com/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/index.html . When a user enters example.com/acme/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/acme/index.html . CustomHeaders (dict) --A complex type that contains names and values for the custom headers that you want. Quantity (integer) -- [REQUIRED]The number of custom headers, if any, for this distribution. Items (list) -- Optional : A list that contains one OriginCustomHeader element for each custom header that you want CloudFront to forward to the origin. If Quantity is 0 , omit Items . (dict) --A complex type that contains HeaderName and HeaderValue elements, if any, for this distribution. HeaderName (string) -- [REQUIRED]The name of a header that you want CloudFront to forward to your origin. For more information, see Forwarding Custom Headers to Your Origin (Web Distributions Only) in the Amazon Amazon CloudFront Developer Guide . HeaderValue (string) -- [REQUIRED]The value for the header that you specified in the HeaderName field. S3OriginConfig (dict) --A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the CustomOriginConfig element instead. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is: origin-access-identity/CloudFront/ID-of-origin-access-identity where `` ID-of-origin-access-identity `` is the value that CloudFront returned in the ID element when you created the origin access identity. If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . CustomOriginConfig (dict) --A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the S3OriginConfig element instead. HTTPPort (integer) -- [REQUIRED]The HTTP port the custom origin listens on. HTTPSPort (integer) -- [REQUIRED]The HTTPS port the custom origin listens on. OriginProtocolPolicy (string) -- [REQUIRED]The origin protocol policy to apply to your origin. OriginSslProtocols (dict) --The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. Quantity (integer) -- [REQUIRED]The number of SSL/TLS protocols that you want to allow CloudFront to use when establishing an HTTPS connection with this origin. Items (list) -- [REQUIRED]A list that contains allowed SSL/TLS protocols for this distribution. (string) -- OriginReadTimeout (integer) --You can create a custom origin read timeout. All timeout units are in seconds. The default origin read timeout is 30 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 4 seconds; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . OriginKeepaliveTimeout (integer) --You can create a custom keep-alive timeout. All timeout units are in seconds. The default keep-alive timeout is 5 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 1 second; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . DefaultCacheBehavior (dict) -- [REQUIRED]A complex type that describes the default cache behavior if you do not specify a CacheBehavior element or if files don't match any of the values of PathPattern in CacheBehavior elements. You must create exactly one default cache behavior. TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) -- Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true ; if not, specify false . For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CacheBehaviors (dict) --A complex type that contains zero or more CacheBehavior elements. Quantity (integer) -- [REQUIRED]The number of cache behaviors for this distribution. Items (list) --Optional: A complex type that contains cache behaviors for this distribution. If Quantity is 0 , you can omit Items . (dict) --A complex type that describes how CloudFront processes requests. You must create at least as many cache behaviors (including the default cache behavior) as you have origins if you want CloudFront to distribute objects from all of the origins. Each cache behavior specifies the one origin from which you want CloudFront to get objects. If you have two origins and only the default cache behavior, the default cache behavior will cause CloudFront to get objects from one of the origins, but the other origin is never used. For the current limit on the number of cache behaviors that you can add to a distribution, see Amazon CloudFront Limits in the AWS General Reference . If you don't want to specify any cache behaviors, include only an empty CacheBehaviors element. Don't include an empty CacheBehavior element, or CloudFront returns a MalformedXML error. To delete all cache behaviors in an existing distribution, update the distribution configuration and include only an empty CacheBehaviors element. To add, change, or remove one or more cache behaviors, update the distribution configuration and specify all of the cache behaviors that you want to include in the updated distribution. For more information about cache behaviors, see Cache Behaviors in the Amazon CloudFront Developer Guide . PathPattern (string) -- [REQUIRED]The pattern (for example, images/*.jpg ) that specifies which requests to apply the behavior to. When CloudFront receives a viewer request, the requested path is compared with path patterns in the order in which cache behaviors are listed in the distribution. Note You can optionally include a slash (/ ) at the beginning of the path pattern. For example, /images/*.jpg . CloudFront behavior is the same with or without the leading / . The path pattern for the default cache behavior is * and cannot be changed. If the request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in the default cache behavior. For more information, see Path Pattern in the Amazon CloudFront Developer Guide . TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) --The maximum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CustomErrorResponses (dict) --A complex type that controls the following: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Quantity (integer) -- [REQUIRED]The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If Quantity is 0 , you can omit Items . Items (list) --A complex type that contains a CustomErrorResponse element for each HTTP status code for which you want to specify a custom error page and/or a caching duration. (dict) --A complex type that controls: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . ErrorCode (integer) -- [REQUIRED]The HTTP status code for which you want to specify a custom error page and/or a caching duration. ResponsePagePath (string) --The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by ErrorCode , for example, /4xx-errors/403-forbidden.html . If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true: The value of PathPattern matches the path to your custom error messages. For example, suppose you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors . Your distribution must include a cache behavior for which the path pattern routes requests for your custom error pages to that location, for example, /4xx-errors/* . The value of TargetOriginId specifies the value of the ID element for the origin that contains your custom error pages. If you specify a value for ResponsePagePath , you must also specify a value for ResponseCode . If you don't want to specify a value, include an empty element, ResponsePagePath , in the XML document. We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable. ResponseCode (string) --The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example: Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute 200 , the response typically won't be intercepted. If you don't care about distinguishing among different client errors or server errors, you can specify 400 or 500 as the ResponseCode for all 4xx or 5xx errors. You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down. If you specify a value for ResponseCode , you must also specify a value for ResponsePagePath . If you don't want to specify a value, include an empty element, ResponseCode , in the XML document. ErrorCachingMinTTL (integer) --The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode . When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available. If you don't want to specify a value, include an empty element, ErrorCachingMinTTL , in the XML document. For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Comment (string) -- [REQUIRED]Any comments you want to include about the distribution. If you don't want to specify a comment, include an empty Comment element. To delete an existing comment, update the distribution configuration and include an empty Comment element. To add or change a comment, update the distribution configuration and specify the new comment. Logging (dict) --A complex type that controls whether access logs are written for the distribution. For more information about logging, see Access Logs in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a distribution or if you want to disable logging for an existing distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket , prefix , and IncludeCookies , the values are automatically deleted. IncludeCookies (boolean) -- [REQUIRED]Specifies whether you want CloudFront to include cookies in access logs, specify true for IncludeCookies . If you choose to include cookies in logs, CloudFront logs all cookies regardless of how you configure the cache behaviors for this distribution. If you do not want to include cookies when you create a distribution or if you want to disable include cookies for an existing distribution, specify false for IncludeCookies . Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. PriceClass (string) --The price class that corresponds with the maximum price that you want to pay for CloudFront service. If you specify PriceClass_All , CloudFront responds to requests for your objects from all CloudFront edge locations. If you specify a price class other than PriceClass_All , CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower performance. For more information about price classes, see Choosing the Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide . For information about CloudFront pricing, including how price classes map to CloudFront regions, see Amazon CloudFront Pricing . Enabled (boolean) -- [REQUIRED]From this field, you can enable or disable the selected distribution. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. ViewerCertificate (dict) --A complex type that specifies the following: Which SSL/TLS certificate to use when viewers request objects using HTTPS Whether you want CloudFront to use dedicated IP addresses or SNI when you're using alternate domain names in your object names The minimum protocol version that you want CloudFront to use when communicating with viewers For more information, see Using an HTTPS Connection to Access Your Objects in the Amazon Amazon CloudFront Developer Guide . CloudFrontDefaultCertificate (boolean) -- IAMCertificateId (string) -- ACMCertificateArn (string) -- SSLSupportMethod (string) --If you specify a value for ACMCertificateArn or for IAMCertificateId , you must also specify how you want CloudFront to serve HTTPS requests: using a method that works for all clients or one that works for most clients: vip : CloudFront uses dedicated IP addresses for your content and can respond to HTTPS requests from any viewer. However, you will incur additional monthly charges. sni-only : CloudFront can respond to HTTPS requests from viewers that support Server Name Indication (SNI). All modern browsers support SNI, but some browsers still in use don't support SNI. If some of your users' browsers don't support SNI, we recommend that you do one of the following: Use the vip option (dedicated IP addresses) instead of sni-only . Use the CloudFront SSL/TLS certificate instead of a custom certificate. This requires that you use the CloudFront domain name of your distribution in the URLs for your objects, for example, https://d111111abcdef8.cloudfront.net/logo.png . If you can control which browser your users use, upgrade the browser to one that supports SNI. Use HTTP instead of HTTPS. Do not specify a value for SSLSupportMethod if you specified CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate . For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . MinimumProtocolVersion (string) --Specify the minimum version of the SSL/TLS protocol that you want CloudFront to use for HTTPS connections between viewers and CloudFront: SSLv3 or TLSv1 . CloudFront serves your objects only to viewers that support SSL/TLS version that you specify and later versions. The TLSv1 protocol is more secure, so we recommend that you specify SSLv3 only if your users are using browsers or devices that don't support TLSv1 . Note the following: If you specify CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate, the minimum SSL protocol version is TLSv1 and can't be changed. If you're using a custom certificate (if you specify a value for ACMCertificateArn or for IAMCertificateId ) and if you're using SNI (if you specify sni-only for SSLSupportMethod ), you must specify TLSv1 for MinimumProtocolVersion . Certificate (string) --Include one of these values to specify the following: Whether you want viewers to use HTTP or HTTPS to request your objects. If you want viewers to use HTTPS, whether you're using an alternate domain name such as example.com or the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net . If you're using an alternate domain name, whether AWS Certificate Manager (ACM) provided the certificate, or you purchased a certificate from a third-party certificate authority and imported it into ACM or uploaded it to the IAM certificate store. You must specify one (and only one) of the three values. Do not specify false for CloudFrontDefaultCertificate . If you want viewers to use HTTP to request your objects : Specify the following value:CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate In addition, specify allow-all for ViewerProtocolPolicy for all of your cache behaviors. If you want viewers to use HTTPS to request your objects : Choose the type of certificate that you want to use based on whether you're using an alternate domain name for your objects or the CloudFront domain name: If you're using an alternate domain name, such as example.com : Specify one of the following values, depending on whether ACM provided your certificate or you purchased your certificate from third-party certificate authority: ACMCertificateArnARN for ACM SSL/TLS certificateACMCertificateArn where ARN for ACM SSL/TLS certificate is the ARN for the ACM SSL/TLS certificate that you want to use for this distribution. IAMCertificateIdIAM certificate IDIAMCertificateId where IAM certificate ID is the ID that IAM returned when you added the certificate to the IAM certificate store. If you specify ACMCertificateArn or IAMCertificateId , you must also specify a value for SSLSupportMethod . If you choose to use an ACM certificate or a certificate in the IAM certificate store, we recommend that you use only an alternate domain name in your object URLs (https://example.com/logo.jpg ). If you use the domain name that is associated with your CloudFront distribution (https://d111111abcdef8.cloudfront.net/logo.jpg ) and the viewer supports SNI , then CloudFront behaves normally. However, if the browser does not support SNI, the user's experience depends on the value that you choose for SSLSupportMethod : vip : The viewer displays a warning because there is a mismatch between the CloudFront domain name and the domain name in your SSL/TLS certificate. sni-only : CloudFront drops the connection with the browser without returning the object. **If you're using the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net ** : Specify the following value: `` CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate`` If you want viewers to use HTTPS, you must also specify one of the following values in your cache behaviors: ViewerProtocolPolicyhttps-onlyViewerProtocolPolicy ViewerProtocolPolicyredirect-to-httpsViewerProtocolPolicy You can also optionally require that CloudFront use HTTPS to communicate with your origin by specifying one of the following values for the applicable origins: OriginProtocolPolicyhttps-onlyOriginProtocolPolicy OriginProtocolPolicymatch-viewerOriginProtocolPolicy For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . CertificateSource (string) -- Note This field is deprecated. You can use one of the following: [ACMCertificateArn , IAMCertificateId , or CloudFrontDefaultCertificate] . Restrictions (dict) --A complex type that identifies ways in which you want to restrict distribution of your content. GeoRestriction (dict) -- [REQUIRED]A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using MaxMind GeoIP databases. RestrictionType (string) -- [REQUIRED]The method that you want to use to restrict distribution of your content by country: none : No geo restriction is enabled, meaning access to content is not restricted by client geo location. blacklist : The Location elements specify the countries in which you do not want CloudFront to distribute your content. whitelist : The Location elements specify the countries in which you want CloudFront to distribute your content. Quantity (integer) -- [REQUIRED]When geo restriction is enabled , this is the number of countries in your whitelist or blacklist . Otherwise, when it is not enabled, Quantity is 0 , and you can omit Items . Items (list) --A complex type that contains a Location element for each country in which you want CloudFront either to distribute your content (whitelist ) or not distribute your content (blacklist ). The Location element is a two-letter, uppercase country code for a country that you want to include in your blacklist or whitelist . Include one Location element for each country. CloudFront and MaxMind both use ISO 3166 country codes. For the current list of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on the International Organization for Standardization website. You can also refer to the country list in the CloudFront console, which includes both country names and codes. (string) -- WebACLId (string) --A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of query strings, CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide . HttpVersion (string) --(Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier HTTP version. For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name Identification (SNI). In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve performance by optimizing for HTTP/2. For more information, do an Internet search for 'http/2 optimization.' IsIPV6Enabled (boolean) --If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify true . If you specify false , CloudFront responds to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution. In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom policy that includes the IpAddress parameter to restrict the IP addresses that can access your content, do not enable IPv6. If you want to restrict access to some content by IP address and not restrict access to other content (or restrict access but not by IP address), you can create two distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide . If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the following are true: You enable IPv6 for the distribution You're using alternate domain names in the URLs for your objects For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53 Developer Guide . If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address format of the viewer request. :rtype: dict :return: { 'Distribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'InProgressInvalidationBatches': 123, 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } }, 'Location': 'string', 'ETag': 'string' } :returns: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. """ pass def create_distribution_with_tags(DistributionConfigWithTags=None): """ Create a new distribution with tags. See also: AWS API Documentation :example: response = client.create_distribution_with_tags( DistributionConfigWithTags={ 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, 'Tags': { 'Items': [ { 'Key': 'string', 'Value': 'string' }, ] } } ) :type DistributionConfigWithTags: dict :param DistributionConfigWithTags: [REQUIRED] The distribution's configuration information. DistributionConfig (dict) -- [REQUIRED]A distribution configuration. CallerReference (string) -- [REQUIRED]A unique value (for example, a date-time stamp) that ensures that the request can't be replayed. If the value of CallerReference is new (regardless of the content of the DistributionConfig object), CloudFront creates a new distribution. If CallerReference is a value you already sent in a previous request to create a distribution, and if the content of the DistributionConfig is identical to the original request (ignoring white space), CloudFront returns the same the response that it returned to the original request. If CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- DefaultRootObject (string) --The object that you want CloudFront to request from your origin (for example, index.html ) when a viewer requests the root URL for your distribution (http://www.example.com ) instead of an object in your distribution (http://www.example.com/product-description.html ). Specifying a default root object avoids exposing the contents of your distribution. Specify only the object name, for example, index.html . Do not add a / before the object name. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object. For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide . Origins (dict) -- [REQUIRED]A complex type that contains information about origins for this distribution. Quantity (integer) -- [REQUIRED]The number of origins for this distribution. Items (list) --A complex type that contains origins for this distribution. (dict) --A complex type that describes the Amazon S3 bucket or the HTTP server (for example, a web server) from which CloudFront gets your files. You must create at least one origin. For the current limit on the number of origins that you can create for a distribution, see Amazon CloudFront Limits in the AWS General Reference . Id (string) -- [REQUIRED]A unique identifier for the origin. The value of Id must be unique within the distribution. When you specify the value of TargetOriginId for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the Id element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide . DomainName (string) -- [REQUIRED] Amazon S3 origins : The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com . Constraints for Amazon S3 origins: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. Custom Origins : The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, www.example.com . Constraints for custom origins: DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters. The name cannot exceed 128 characters. OriginPath (string) --An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the OriginPath element, specify the directory name, beginning with a / . CloudFront appends the directory name to the value of DomainName , for example, example.com/production . Do not include a / at the end of the directory name. For example, suppose you've specified the following values for your distribution: DomainName : An Amazon S3 bucket named myawsbucket . OriginPath : /production CNAME : example.com When a user enters example.com/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/index.html . When a user enters example.com/acme/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/acme/index.html . CustomHeaders (dict) --A complex type that contains names and values for the custom headers that you want. Quantity (integer) -- [REQUIRED]The number of custom headers, if any, for this distribution. Items (list) -- Optional : A list that contains one OriginCustomHeader element for each custom header that you want CloudFront to forward to the origin. If Quantity is 0 , omit Items . (dict) --A complex type that contains HeaderName and HeaderValue elements, if any, for this distribution. HeaderName (string) -- [REQUIRED]The name of a header that you want CloudFront to forward to your origin. For more information, see Forwarding Custom Headers to Your Origin (Web Distributions Only) in the Amazon Amazon CloudFront Developer Guide . HeaderValue (string) -- [REQUIRED]The value for the header that you specified in the HeaderName field. S3OriginConfig (dict) --A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the CustomOriginConfig element instead. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is: origin-access-identity/CloudFront/ID-of-origin-access-identity where `` ID-of-origin-access-identity `` is the value that CloudFront returned in the ID element when you created the origin access identity. If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . CustomOriginConfig (dict) --A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the S3OriginConfig element instead. HTTPPort (integer) -- [REQUIRED]The HTTP port the custom origin listens on. HTTPSPort (integer) -- [REQUIRED]The HTTPS port the custom origin listens on. OriginProtocolPolicy (string) -- [REQUIRED]The origin protocol policy to apply to your origin. OriginSslProtocols (dict) --The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. Quantity (integer) -- [REQUIRED]The number of SSL/TLS protocols that you want to allow CloudFront to use when establishing an HTTPS connection with this origin. Items (list) -- [REQUIRED]A list that contains allowed SSL/TLS protocols for this distribution. (string) -- OriginReadTimeout (integer) --You can create a custom origin read timeout. All timeout units are in seconds. The default origin read timeout is 30 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 4 seconds; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . OriginKeepaliveTimeout (integer) --You can create a custom keep-alive timeout. All timeout units are in seconds. The default keep-alive timeout is 5 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 1 second; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . DefaultCacheBehavior (dict) -- [REQUIRED]A complex type that describes the default cache behavior if you do not specify a CacheBehavior element or if files don't match any of the values of PathPattern in CacheBehavior elements. You must create exactly one default cache behavior. TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) -- Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true ; if not, specify false . For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CacheBehaviors (dict) --A complex type that contains zero or more CacheBehavior elements. Quantity (integer) -- [REQUIRED]The number of cache behaviors for this distribution. Items (list) --Optional: A complex type that contains cache behaviors for this distribution. If Quantity is 0 , you can omit Items . (dict) --A complex type that describes how CloudFront processes requests. You must create at least as many cache behaviors (including the default cache behavior) as you have origins if you want CloudFront to distribute objects from all of the origins. Each cache behavior specifies the one origin from which you want CloudFront to get objects. If you have two origins and only the default cache behavior, the default cache behavior will cause CloudFront to get objects from one of the origins, but the other origin is never used. For the current limit on the number of cache behaviors that you can add to a distribution, see Amazon CloudFront Limits in the AWS General Reference . If you don't want to specify any cache behaviors, include only an empty CacheBehaviors element. Don't include an empty CacheBehavior element, or CloudFront returns a MalformedXML error. To delete all cache behaviors in an existing distribution, update the distribution configuration and include only an empty CacheBehaviors element. To add, change, or remove one or more cache behaviors, update the distribution configuration and specify all of the cache behaviors that you want to include in the updated distribution. For more information about cache behaviors, see Cache Behaviors in the Amazon CloudFront Developer Guide . PathPattern (string) -- [REQUIRED]The pattern (for example, images/*.jpg ) that specifies which requests to apply the behavior to. When CloudFront receives a viewer request, the requested path is compared with path patterns in the order in which cache behaviors are listed in the distribution. Note You can optionally include a slash (/ ) at the beginning of the path pattern. For example, /images/*.jpg . CloudFront behavior is the same with or without the leading / . The path pattern for the default cache behavior is * and cannot be changed. If the request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in the default cache behavior. For more information, see Path Pattern in the Amazon CloudFront Developer Guide . TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) --The maximum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CustomErrorResponses (dict) --A complex type that controls the following: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Quantity (integer) -- [REQUIRED]The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If Quantity is 0 , you can omit Items . Items (list) --A complex type that contains a CustomErrorResponse element for each HTTP status code for which you want to specify a custom error page and/or a caching duration. (dict) --A complex type that controls: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . ErrorCode (integer) -- [REQUIRED]The HTTP status code for which you want to specify a custom error page and/or a caching duration. ResponsePagePath (string) --The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by ErrorCode , for example, /4xx-errors/403-forbidden.html . If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true: The value of PathPattern matches the path to your custom error messages. For example, suppose you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors . Your distribution must include a cache behavior for which the path pattern routes requests for your custom error pages to that location, for example, /4xx-errors/* . The value of TargetOriginId specifies the value of the ID element for the origin that contains your custom error pages. If you specify a value for ResponsePagePath , you must also specify a value for ResponseCode . If you don't want to specify a value, include an empty element, ResponsePagePath , in the XML document. We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable. ResponseCode (string) --The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example: Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute 200 , the response typically won't be intercepted. If you don't care about distinguishing among different client errors or server errors, you can specify 400 or 500 as the ResponseCode for all 4xx or 5xx errors. You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down. If you specify a value for ResponseCode , you must also specify a value for ResponsePagePath . If you don't want to specify a value, include an empty element, ResponseCode , in the XML document. ErrorCachingMinTTL (integer) --The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode . When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available. If you don't want to specify a value, include an empty element, ErrorCachingMinTTL , in the XML document. For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Comment (string) -- [REQUIRED]Any comments you want to include about the distribution. If you don't want to specify a comment, include an empty Comment element. To delete an existing comment, update the distribution configuration and include an empty Comment element. To add or change a comment, update the distribution configuration and specify the new comment. Logging (dict) --A complex type that controls whether access logs are written for the distribution. For more information about logging, see Access Logs in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a distribution or if you want to disable logging for an existing distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket , prefix , and IncludeCookies , the values are automatically deleted. IncludeCookies (boolean) -- [REQUIRED]Specifies whether you want CloudFront to include cookies in access logs, specify true for IncludeCookies . If you choose to include cookies in logs, CloudFront logs all cookies regardless of how you configure the cache behaviors for this distribution. If you do not want to include cookies when you create a distribution or if you want to disable include cookies for an existing distribution, specify false for IncludeCookies . Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. PriceClass (string) --The price class that corresponds with the maximum price that you want to pay for CloudFront service. If you specify PriceClass_All , CloudFront responds to requests for your objects from all CloudFront edge locations. If you specify a price class other than PriceClass_All , CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower performance. For more information about price classes, see Choosing the Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide . For information about CloudFront pricing, including how price classes map to CloudFront regions, see Amazon CloudFront Pricing . Enabled (boolean) -- [REQUIRED]From this field, you can enable or disable the selected distribution. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. ViewerCertificate (dict) --A complex type that specifies the following: Which SSL/TLS certificate to use when viewers request objects using HTTPS Whether you want CloudFront to use dedicated IP addresses or SNI when you're using alternate domain names in your object names The minimum protocol version that you want CloudFront to use when communicating with viewers For more information, see Using an HTTPS Connection to Access Your Objects in the Amazon Amazon CloudFront Developer Guide . CloudFrontDefaultCertificate (boolean) -- IAMCertificateId (string) -- ACMCertificateArn (string) -- SSLSupportMethod (string) --If you specify a value for ACMCertificateArn or for IAMCertificateId , you must also specify how you want CloudFront to serve HTTPS requests: using a method that works for all clients or one that works for most clients: vip : CloudFront uses dedicated IP addresses for your content and can respond to HTTPS requests from any viewer. However, you will incur additional monthly charges. sni-only : CloudFront can respond to HTTPS requests from viewers that support Server Name Indication (SNI). All modern browsers support SNI, but some browsers still in use don't support SNI. If some of your users' browsers don't support SNI, we recommend that you do one of the following: Use the vip option (dedicated IP addresses) instead of sni-only . Use the CloudFront SSL/TLS certificate instead of a custom certificate. This requires that you use the CloudFront domain name of your distribution in the URLs for your objects, for example, https://d111111abcdef8.cloudfront.net/logo.png . If you can control which browser your users use, upgrade the browser to one that supports SNI. Use HTTP instead of HTTPS. Do not specify a value for SSLSupportMethod if you specified CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate . For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . MinimumProtocolVersion (string) --Specify the minimum version of the SSL/TLS protocol that you want CloudFront to use for HTTPS connections between viewers and CloudFront: SSLv3 or TLSv1 . CloudFront serves your objects only to viewers that support SSL/TLS version that you specify and later versions. The TLSv1 protocol is more secure, so we recommend that you specify SSLv3 only if your users are using browsers or devices that don't support TLSv1 . Note the following: If you specify CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate, the minimum SSL protocol version is TLSv1 and can't be changed. If you're using a custom certificate (if you specify a value for ACMCertificateArn or for IAMCertificateId ) and if you're using SNI (if you specify sni-only for SSLSupportMethod ), you must specify TLSv1 for MinimumProtocolVersion . Certificate (string) --Include one of these values to specify the following: Whether you want viewers to use HTTP or HTTPS to request your objects. If you want viewers to use HTTPS, whether you're using an alternate domain name such as example.com or the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net . If you're using an alternate domain name, whether AWS Certificate Manager (ACM) provided the certificate, or you purchased a certificate from a third-party certificate authority and imported it into ACM or uploaded it to the IAM certificate store. You must specify one (and only one) of the three values. Do not specify false for CloudFrontDefaultCertificate . If you want viewers to use HTTP to request your objects : Specify the following value:CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate In addition, specify allow-all for ViewerProtocolPolicy for all of your cache behaviors. If you want viewers to use HTTPS to request your objects : Choose the type of certificate that you want to use based on whether you're using an alternate domain name for your objects or the CloudFront domain name: If you're using an alternate domain name, such as example.com : Specify one of the following values, depending on whether ACM provided your certificate or you purchased your certificate from third-party certificate authority: ACMCertificateArnARN for ACM SSL/TLS certificateACMCertificateArn where ARN for ACM SSL/TLS certificate is the ARN for the ACM SSL/TLS certificate that you want to use for this distribution. IAMCertificateIdIAM certificate IDIAMCertificateId where IAM certificate ID is the ID that IAM returned when you added the certificate to the IAM certificate store. If you specify ACMCertificateArn or IAMCertificateId , you must also specify a value for SSLSupportMethod . If you choose to use an ACM certificate or a certificate in the IAM certificate store, we recommend that you use only an alternate domain name in your object URLs (https://example.com/logo.jpg ). If you use the domain name that is associated with your CloudFront distribution (https://d111111abcdef8.cloudfront.net/logo.jpg ) and the viewer supports SNI , then CloudFront behaves normally. However, if the browser does not support SNI, the user's experience depends on the value that you choose for SSLSupportMethod : vip : The viewer displays a warning because there is a mismatch between the CloudFront domain name and the domain name in your SSL/TLS certificate. sni-only : CloudFront drops the connection with the browser without returning the object. **If you're using the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net ** : Specify the following value: `` CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate`` If you want viewers to use HTTPS, you must also specify one of the following values in your cache behaviors: ViewerProtocolPolicyhttps-onlyViewerProtocolPolicy ViewerProtocolPolicyredirect-to-httpsViewerProtocolPolicy You can also optionally require that CloudFront use HTTPS to communicate with your origin by specifying one of the following values for the applicable origins: OriginProtocolPolicyhttps-onlyOriginProtocolPolicy OriginProtocolPolicymatch-viewerOriginProtocolPolicy For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . CertificateSource (string) -- Note This field is deprecated. You can use one of the following: [ACMCertificateArn , IAMCertificateId , or CloudFrontDefaultCertificate] . Restrictions (dict) --A complex type that identifies ways in which you want to restrict distribution of your content. GeoRestriction (dict) -- [REQUIRED]A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using MaxMind GeoIP databases. RestrictionType (string) -- [REQUIRED]The method that you want to use to restrict distribution of your content by country: none : No geo restriction is enabled, meaning access to content is not restricted by client geo location. blacklist : The Location elements specify the countries in which you do not want CloudFront to distribute your content. whitelist : The Location elements specify the countries in which you want CloudFront to distribute your content. Quantity (integer) -- [REQUIRED]When geo restriction is enabled , this is the number of countries in your whitelist or blacklist . Otherwise, when it is not enabled, Quantity is 0 , and you can omit Items . Items (list) --A complex type that contains a Location element for each country in which you want CloudFront either to distribute your content (whitelist ) or not distribute your content (blacklist ). The Location element is a two-letter, uppercase country code for a country that you want to include in your blacklist or whitelist . Include one Location element for each country. CloudFront and MaxMind both use ISO 3166 country codes. For the current list of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on the International Organization for Standardization website. You can also refer to the country list in the CloudFront console, which includes both country names and codes. (string) -- WebACLId (string) --A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of query strings, CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide . HttpVersion (string) --(Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier HTTP version. For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name Identification (SNI). In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve performance by optimizing for HTTP/2. For more information, do an Internet search for 'http/2 optimization.' IsIPV6Enabled (boolean) --If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify true . If you specify false , CloudFront responds to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution. In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom policy that includes the IpAddress parameter to restrict the IP addresses that can access your content, do not enable IPv6. If you want to restrict access to some content by IP address and not restrict access to other content (or restrict access but not by IP address), you can create two distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide . If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the following are true: You enable IPv6 for the distribution You're using alternate domain names in the URLs for your objects For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53 Developer Guide . If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address format of the viewer request. Tags (dict) -- [REQUIRED]A complex type that contains zero or more Tag elements. Items (list) --A complex type that contains Tag elements. (dict) --A complex type that contains Tag key and Tag value. Key (string) -- [REQUIRED]A string that contains Tag key. The string length should be between 1 and 128 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . Value (string) --A string that contains an optional Tag value. The string length should be between 0 and 256 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . :rtype: dict :return: { 'Distribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'InProgressInvalidationBatches': 123, 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } }, 'Location': 'string', 'ETag': 'string' } :returns: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. """ pass def create_invalidation(DistributionId=None, InvalidationBatch=None): """ Create a new invalidation. See also: AWS API Documentation :example: response = client.create_invalidation( DistributionId='string', InvalidationBatch={ 'Paths': { 'Quantity': 123, 'Items': [ 'string', ] }, 'CallerReference': 'string' } ) :type DistributionId: string :param DistributionId: [REQUIRED] The distribution's id. :type InvalidationBatch: dict :param InvalidationBatch: [REQUIRED] The batch information for the invalidation. Paths (dict) -- [REQUIRED]A complex type that contains information about the objects that you want to invalidate. For more information, see Specifying the Objects to Invalidate in the Amazon CloudFront Developer Guide . Quantity (integer) -- [REQUIRED]The number of objects that you want to invalidate. Items (list) --A complex type that contains a list of the paths that you want to invalidate. (string) -- CallerReference (string) -- [REQUIRED]A value that you specify to uniquely identify an invalidation request. CloudFront uses the value to prevent you from accidentally resubmitting an identical request. Whenever you create a new invalidation request, you must specify a new value for CallerReference and change other values in the request as applicable. One way to ensure that the value of CallerReference is unique is to use a timestamp , for example, 20120301090000 . If you make a second invalidation request with the same value for CallerReference , and if the rest of the request is the same, CloudFront doesn't create a new invalidation request. Instead, CloudFront returns information about the invalidation request that you previously created with the same CallerReference . If CallerReference is a value you already sent in a previous invalidation batch request but the content of any Path is different from the original request, CloudFront returns an InvalidationBatchAlreadyExists error. :rtype: dict :return: { 'Location': 'string', 'Invalidation': { 'Id': 'string', 'Status': 'string', 'CreateTime': datetime(2015, 1, 1), 'InvalidationBatch': { 'Paths': { 'Quantity': 123, 'Items': [ 'string', ] }, 'CallerReference': 'string' } } } :returns: (string) -- """ pass def create_streaming_distribution(StreamingDistributionConfig=None): """ Creates a new RMTP distribution. An RTMP distribution is similar to a web distribution, but an RTMP distribution streams media files using the Adobe Real-Time Messaging Protocol (RTMP) instead of serving files using HTTP. To create a new web distribution, submit a POST request to the CloudFront API version /distribution resource. The request body must include a document with a StreamingDistributionConfig element. The response echoes the StreamingDistributionConfig element and returns other information about the RTMP distribution. To get the status of your request, use the GET StreamingDistribution API action. When the value of Enabled is true and the value of Status is Deployed , your distribution is ready. A distribution usually deploys in less than 15 minutes. For more information about web distributions, see Working with RTMP Distributions in the Amazon CloudFront Developer Guide . See also: AWS API Documentation :example: response = client.create_streaming_distribution( StreamingDistributionConfig={ 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } ) :type StreamingDistributionConfig: dict :param StreamingDistributionConfig: [REQUIRED] The streaming distribution's configuration information. CallerReference (string) -- [REQUIRED]A unique number that ensures that the request can't be replayed. If the CallerReference is new (no matter the content of the StreamingDistributionConfig object), a new streaming distribution is created. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution, and the content of the StreamingDistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution but the content of the StreamingDistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. S3Origin (dict) -- [REQUIRED]A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution. DomainName (string) -- [REQUIRED]The DNS name of the Amazon S3 origin. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the RTMP distribution. Use an origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 bucket through CloudFront. If you want end users to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information, see Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content in the Amazon Amazon CloudFront Developer Guide . Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this streaming distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- Comment (string) -- [REQUIRED]Any comments you want to include about the streaming distribution. Logging (dict) --A complex type that controls whether access logs are written for the streaming distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a streaming distribution or if you want to disable logging for an existing streaming distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this streaming distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. TrustedSigners (dict) -- [REQUIRED]A complex type that specifies any AWS accounts that you want to permit to create signed URLs for private content. If you want the distribution to use signed URLs, include this element; if you want the distribution to use public URLs, remove this element. For more information, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- PriceClass (string) --A complex type that contains information about price class for this streaming distribution. Enabled (boolean) -- [REQUIRED]Whether the streaming distribution is enabled to accept user requests for content. :rtype: dict :return: { 'StreamingDistribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } }, 'Location': 'string', 'ETag': 'string' } :returns: (string) -- """ pass def create_streaming_distribution_with_tags(StreamingDistributionConfigWithTags=None): """ Create a new streaming distribution with tags. See also: AWS API Documentation :example: response = client.create_streaming_distribution_with_tags( StreamingDistributionConfigWithTags={ 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False }, 'Tags': { 'Items': [ { 'Key': 'string', 'Value': 'string' }, ] } } ) :type StreamingDistributionConfigWithTags: dict :param StreamingDistributionConfigWithTags: [REQUIRED] The streaming distribution's configuration information. StreamingDistributionConfig (dict) -- [REQUIRED]A streaming distribution Configuration. CallerReference (string) -- [REQUIRED]A unique number that ensures that the request can't be replayed. If the CallerReference is new (no matter the content of the StreamingDistributionConfig object), a new streaming distribution is created. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution, and the content of the StreamingDistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution but the content of the StreamingDistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. S3Origin (dict) -- [REQUIRED]A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution. DomainName (string) -- [REQUIRED]The DNS name of the Amazon S3 origin. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the RTMP distribution. Use an origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 bucket through CloudFront. If you want end users to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information, see Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content in the Amazon Amazon CloudFront Developer Guide . Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this streaming distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- Comment (string) -- [REQUIRED]Any comments you want to include about the streaming distribution. Logging (dict) --A complex type that controls whether access logs are written for the streaming distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a streaming distribution or if you want to disable logging for an existing streaming distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this streaming distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. TrustedSigners (dict) -- [REQUIRED]A complex type that specifies any AWS accounts that you want to permit to create signed URLs for private content. If you want the distribution to use signed URLs, include this element; if you want the distribution to use public URLs, remove this element. For more information, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- PriceClass (string) --A complex type that contains information about price class for this streaming distribution. Enabled (boolean) -- [REQUIRED]Whether the streaming distribution is enabled to accept user requests for content. Tags (dict) -- [REQUIRED]A complex type that contains zero or more Tag elements. Items (list) --A complex type that contains Tag elements. (dict) --A complex type that contains Tag key and Tag value. Key (string) -- [REQUIRED]A string that contains Tag key. The string length should be between 1 and 128 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . Value (string) --A string that contains an optional Tag value. The string length should be between 0 and 256 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . :rtype: dict :return: { 'StreamingDistribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } }, 'Location': 'string', 'ETag': 'string' } :returns: (string) -- """ pass def delete_cloud_front_origin_access_identity(Id=None, IfMatch=None): """ Delete an origin access identity. See also: AWS API Documentation :example: response = client.delete_cloud_front_origin_access_identity( Id='string', IfMatch='string' ) :type Id: string :param Id: [REQUIRED] The origin access identity's ID. :type IfMatch: string :param IfMatch: The value of the ETag header you received from a previous GET or PUT request. For example: E2QWRUHAPOMQZL . """ pass def delete_distribution(Id=None, IfMatch=None): """ Delete a distribution. See also: AWS API Documentation :example: response = client.delete_distribution( Id='string', IfMatch='string' ) :type Id: string :param Id: [REQUIRED] The distribution ID. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when you disabled the distribution. For example: E2QWRUHAPOMQZL . """ pass def delete_streaming_distribution(Id=None, IfMatch=None): """ Delete a streaming distribution. To delete an RTMP distribution using the CloudFront API, perform the following steps. For information about deleting a distribution using the CloudFront console, see Deleting a Distribution in the Amazon CloudFront Developer Guide . See also: AWS API Documentation :example: response = client.delete_streaming_distribution( Id='string', IfMatch='string' ) :type Id: string :param Id: [REQUIRED] The distribution ID. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when you disabled the streaming distribution. For example: E2QWRUHAPOMQZL . :returns: Id (string) -- [REQUIRED] The distribution ID. IfMatch (string) -- The value of the ETag header that you received when you disabled the streaming distribution. For example: E2QWRUHAPOMQZL . """ pass def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None): """ Generate a presigned url given a client, its method, and arguments :type ClientMethod: string :param ClientMethod: The client method to presign for :type Params: dict :param Params: The parameters normally passed to ClientMethod. :type ExpiresIn: int :param ExpiresIn: The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds) :type HttpMethod: string :param HttpMethod: The http method to use on the generated url. By default, the http method is whatever is used in the method's model. """ pass def get_cloud_front_origin_access_identity(Id=None): """ Get the information about an origin access identity. See also: AWS API Documentation :example: response = client.get_cloud_front_origin_access_identity( Id='string' ) :type Id: string :param Id: [REQUIRED] The identity's ID. :rtype: dict :return: { 'CloudFrontOriginAccessIdentity': { 'Id': 'string', 'S3CanonicalUserId': 'string', 'CloudFrontOriginAccessIdentityConfig': { 'CallerReference': 'string', 'Comment': 'string' } }, 'ETag': 'string' } """ pass def get_cloud_front_origin_access_identity_config(Id=None): """ Get the configuration information about an origin access identity. See also: AWS API Documentation :example: response = client.get_cloud_front_origin_access_identity_config( Id='string' ) :type Id: string :param Id: [REQUIRED] The identity's ID. :rtype: dict :return: { 'CloudFrontOriginAccessIdentityConfig': { 'CallerReference': 'string', 'Comment': 'string' }, 'ETag': 'string' } """ pass def get_distribution(Id=None): """ Get the information about a distribution. See also: AWS API Documentation :example: response = client.get_distribution( Id='string' ) :type Id: string :param Id: [REQUIRED] The distribution's ID. :rtype: dict :return: { 'Distribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'InProgressInvalidationBatches': 123, 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } }, 'ETag': 'string' } :returns: (string) -- """ pass def get_distribution_config(Id=None): """ Get the configuration information about a distribution. See also: AWS API Documentation :example: response = client.get_distribution_config( Id='string' ) :type Id: string :param Id: [REQUIRED] The distribution's ID. :rtype: dict :return: { 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, 'ETag': 'string' } :returns: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. """ pass def get_invalidation(DistributionId=None, Id=None): """ Get the information about an invalidation. See also: AWS API Documentation :example: response = client.get_invalidation( DistributionId='string', Id='string' ) :type DistributionId: string :param DistributionId: [REQUIRED] The distribution's ID. :type Id: string :param Id: [REQUIRED] The identifier for the invalidation request, for example, IDFDVBD632BHDS5 . :rtype: dict :return: { 'Invalidation': { 'Id': 'string', 'Status': 'string', 'CreateTime': datetime(2015, 1, 1), 'InvalidationBatch': { 'Paths': { 'Quantity': 123, 'Items': [ 'string', ] }, 'CallerReference': 'string' } } } :returns: (string) -- """ pass def get_paginator(operation_name=None): """ Create a paginator for an operation. :type operation_name: string :param operation_name: The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator('create_foo'). :rtype: L{botocore.paginate.Paginator} """ pass def get_streaming_distribution(Id=None): """ Gets information about a specified RTMP distribution, including the distribution configuration. See also: AWS API Documentation :example: response = client.get_streaming_distribution( Id='string' ) :type Id: string :param Id: [REQUIRED] The streaming distribution's ID. :rtype: dict :return: { 'StreamingDistribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } }, 'ETag': 'string' } :returns: (string) -- """ pass def get_streaming_distribution_config(Id=None): """ Get the configuration information about a streaming distribution. See also: AWS API Documentation :example: response = client.get_streaming_distribution_config( Id='string' ) :type Id: string :param Id: [REQUIRED] The streaming distribution's ID. :rtype: dict :return: { 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False }, 'ETag': 'string' } :returns: (string) -- """ pass def get_waiter(): """ """ pass def list_cloud_front_origin_access_identities(Marker=None, MaxItems=None): """ Lists origin access identities. See also: AWS API Documentation :example: response = client.list_cloud_front_origin_access_identities( Marker='string', MaxItems='string' ) :type Marker: string :param Marker: Use this when paginating results to indicate where to begin in your list of origin access identities. The results include identities in the list that occur after the marker. To get the next page of results, set the Marker to the value of the NextMarker from the current page's response (which is also the ID of the last identity on that page). :type MaxItems: string :param MaxItems: The maximum number of origin access identities you want in the response body. :rtype: dict :return: { 'CloudFrontOriginAccessIdentityList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'S3CanonicalUserId': 'string', 'Comment': 'string' }, ] } } """ pass def list_distributions(Marker=None, MaxItems=None): """ List distributions. See also: AWS API Documentation :example: response = client.list_distributions( Marker='string', MaxItems='string' ) :type Marker: string :param Marker: Use this when paginating results to indicate where to begin in your list of distributions. The results include distributions in the list that occur after the marker. To get the next page of results, set the Marker to the value of the NextMarker from the current page's response (which is also the ID of the last distribution on that page). :type MaxItems: string :param MaxItems: The maximum number of distributions you want in the response body. :rtype: dict :return: { 'DistributionList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, ] } } :returns: (string) -- """ pass def list_distributions_by_web_acl_id(Marker=None, MaxItems=None, WebACLId=None): """ List the distributions that are associated with a specified AWS WAF web ACL. See also: AWS API Documentation :example: response = client.list_distributions_by_web_acl_id( Marker='string', MaxItems='string', WebACLId='string' ) :type Marker: string :param Marker: Use Marker and MaxItems to control pagination of results. If you have more than MaxItems distributions that satisfy the request, the response includes a NextMarker element. To get the next page of results, submit another request. For the value of Marker , specify the value of NextMarker from the last response. (For the first request, omit Marker .) :type MaxItems: string :param MaxItems: The maximum number of distributions that you want CloudFront to return in the response body. The maximum and default values are both 100. :type WebACLId: string :param WebACLId: [REQUIRED] The ID of the AWS WAF web ACL that you want to list the associated distributions. If you specify 'null' for the ID, the request returns a list of the distributions that aren't associated with a web ACL. :rtype: dict :return: { 'DistributionList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, ] } } :returns: (string) -- """ pass def list_invalidations(DistributionId=None, Marker=None, MaxItems=None): """ Lists invalidation batches. See also: AWS API Documentation :example: response = client.list_invalidations( DistributionId='string', Marker='string', MaxItems='string' ) :type DistributionId: string :param DistributionId: [REQUIRED] The distribution's ID. :type Marker: string :param Marker: Use this parameter when paginating results to indicate where to begin in your list of invalidation batches. Because the results are returned in decreasing order from most recent to oldest, the most recent results are on the first page, the second page will contain earlier results, and so on. To get the next page of results, set Marker to the value of the NextMarker from the current page's response. This value is the same as the ID of the last invalidation batch on that page. :type MaxItems: string :param MaxItems: The maximum number of invalidation batches that you want in the response body. :rtype: dict :return: { 'InvalidationList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'CreateTime': datetime(2015, 1, 1), 'Status': 'string' }, ] } } """ pass def list_streaming_distributions(Marker=None, MaxItems=None): """ List streaming distributions. See also: AWS API Documentation :example: response = client.list_streaming_distributions( Marker='string', MaxItems='string' ) :type Marker: string :param Marker: The value that you provided for the Marker request parameter. :type MaxItems: string :param MaxItems: The value that you provided for the MaxItems request parameter. :rtype: dict :return: { 'StreamingDistributionList': { 'Marker': 'string', 'NextMarker': 'string', 'MaxItems': 123, 'IsTruncated': True|False, 'Quantity': 123, 'Items': [ { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False }, ] } } :returns: (string) -- """ pass def list_tags_for_resource(Resource=None): """ List tags for a CloudFront resource. See also: AWS API Documentation :example: response = client.list_tags_for_resource( Resource='string' ) :type Resource: string :param Resource: [REQUIRED] An ARN of a CloudFront resource. :rtype: dict :return: { 'Tags': { 'Items': [ { 'Key': 'string', 'Value': 'string' }, ] } } """ pass def tag_resource(Resource=None, Tags=None): """ Add tags to a CloudFront resource. See also: AWS API Documentation :example: response = client.tag_resource( Resource='string', Tags={ 'Items': [ { 'Key': 'string', 'Value': 'string' }, ] } ) :type Resource: string :param Resource: [REQUIRED] An ARN of a CloudFront resource. :type Tags: dict :param Tags: [REQUIRED] A complex type that contains zero or more Tag elements. Items (list) --A complex type that contains Tag elements. (dict) --A complex type that contains Tag key and Tag value. Key (string) -- [REQUIRED]A string that contains Tag key. The string length should be between 1 and 128 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . Value (string) --A string that contains an optional Tag value. The string length should be between 0 and 256 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . """ pass def untag_resource(Resource=None, TagKeys=None): """ Remove tags from a CloudFront resource. See also: AWS API Documentation :example: response = client.untag_resource( Resource='string', TagKeys={ 'Items': [ 'string', ] } ) :type Resource: string :param Resource: [REQUIRED] An ARN of a CloudFront resource. :type TagKeys: dict :param TagKeys: [REQUIRED] A complex type that contains zero or more Tag key elements. Items (list) --A complex type that contains Tag key elements. (string) --A string that contains Tag key. The string length should be between 1 and 128 characters. Valid characters include a-z , A-Z , 0-9 , space, and the special characters _ - . : / = + @ . """ pass def update_cloud_front_origin_access_identity(CloudFrontOriginAccessIdentityConfig=None, Id=None, IfMatch=None): """ Update an origin access identity. See also: AWS API Documentation :example: response = client.update_cloud_front_origin_access_identity( CloudFrontOriginAccessIdentityConfig={ 'CallerReference': 'string', 'Comment': 'string' }, Id='string', IfMatch='string' ) :type CloudFrontOriginAccessIdentityConfig: dict :param CloudFrontOriginAccessIdentityConfig: [REQUIRED] The identity's configuration information. CallerReference (string) -- [REQUIRED]A unique number that ensures the request can't be replayed. If the CallerReference is new (no matter the content of the CloudFrontOriginAccessIdentityConfig object), a new origin access identity is created. If the CallerReference is a value already sent in a previous identity request, and the content of the CloudFrontOriginAccessIdentityConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value you already sent in a previous request to create an identity, but the content of the CloudFrontOriginAccessIdentityConfig is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists error. Comment (string) -- [REQUIRED]Any comments you want to include about the origin access identity. :type Id: string :param Id: [REQUIRED] The identity's id. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when retrieving the identity's configuration. For example: E2QWRUHAPOMQZL . :rtype: dict :return: { 'CloudFrontOriginAccessIdentity': { 'Id': 'string', 'S3CanonicalUserId': 'string', 'CloudFrontOriginAccessIdentityConfig': { 'CallerReference': 'string', 'Comment': 'string' } }, 'ETag': 'string' } """ pass def update_distribution(DistributionConfig=None, Id=None, IfMatch=None): """ Update a distribution. See also: AWS API Documentation :example: response = client.update_distribution( DistributionConfig={ 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False }, Id='string', IfMatch='string' ) :type DistributionConfig: dict :param DistributionConfig: [REQUIRED] The distribution's configuration information. CallerReference (string) -- [REQUIRED]A unique value (for example, a date-time stamp) that ensures that the request can't be replayed. If the value of CallerReference is new (regardless of the content of the DistributionConfig object), CloudFront creates a new distribution. If CallerReference is a value you already sent in a previous request to create a distribution, and if the content of the DistributionConfig is identical to the original request (ignoring white space), CloudFront returns the same the response that it returned to the original request. If CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- DefaultRootObject (string) --The object that you want CloudFront to request from your origin (for example, index.html ) when a viewer requests the root URL for your distribution (http://www.example.com ) instead of an object in your distribution (http://www.example.com/product-description.html ). Specifying a default root object avoids exposing the contents of your distribution. Specify only the object name, for example, index.html . Do not add a / before the object name. If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element. To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element. To replace the default root object, update the distribution configuration and specify the new object. For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide . Origins (dict) -- [REQUIRED]A complex type that contains information about origins for this distribution. Quantity (integer) -- [REQUIRED]The number of origins for this distribution. Items (list) --A complex type that contains origins for this distribution. (dict) --A complex type that describes the Amazon S3 bucket or the HTTP server (for example, a web server) from which CloudFront gets your files. You must create at least one origin. For the current limit on the number of origins that you can create for a distribution, see Amazon CloudFront Limits in the AWS General Reference . Id (string) -- [REQUIRED]A unique identifier for the origin. The value of Id must be unique within the distribution. When you specify the value of TargetOriginId for the default cache behavior or for another cache behavior, you indicate the origin to which you want the cache behavior to route requests by specifying the value of the Id element for that origin. When a request matches the path pattern for that cache behavior, CloudFront routes the request to the specified origin. For more information, see Cache Behavior Settings in the Amazon CloudFront Developer Guide . DomainName (string) -- [REQUIRED] Amazon S3 origins : The DNS name of the Amazon S3 bucket from which you want CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com . Constraints for Amazon S3 origins: If you configured Amazon S3 Transfer Acceleration for your bucket, do not specify the s3-accelerate endpoint for DomainName . The bucket name must be between 3 and 63 characters long (inclusive). The bucket name must contain only lowercase characters, numbers, periods, underscores, and dashes. The bucket name must not contain adjacent periods. Custom Origins : The DNS domain name for the HTTP server from which you want CloudFront to get objects for this origin, for example, www.example.com . Constraints for custom origins: DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, dot (.), hyphen (-), or underscore (_) characters. The name cannot exceed 128 characters. OriginPath (string) --An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. When you include the OriginPath element, specify the directory name, beginning with a / . CloudFront appends the directory name to the value of DomainName , for example, example.com/production . Do not include a / at the end of the directory name. For example, suppose you've specified the following values for your distribution: DomainName : An Amazon S3 bucket named myawsbucket . OriginPath : /production CNAME : example.com When a user enters example.com/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/index.html . When a user enters example.com/acme/index.html in a browser, CloudFront sends a request to Amazon S3 for myawsbucket/production/acme/index.html . CustomHeaders (dict) --A complex type that contains names and values for the custom headers that you want. Quantity (integer) -- [REQUIRED]The number of custom headers, if any, for this distribution. Items (list) -- Optional : A list that contains one OriginCustomHeader element for each custom header that you want CloudFront to forward to the origin. If Quantity is 0 , omit Items . (dict) --A complex type that contains HeaderName and HeaderValue elements, if any, for this distribution. HeaderName (string) -- [REQUIRED]The name of a header that you want CloudFront to forward to your origin. For more information, see Forwarding Custom Headers to Your Origin (Web Distributions Only) in the Amazon Amazon CloudFront Developer Guide . HeaderValue (string) -- [REQUIRED]The value for the header that you specified in the HeaderName field. S3OriginConfig (dict) --A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the CustomOriginConfig element instead. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is: origin-access-identity/CloudFront/ID-of-origin-access-identity where `` ID-of-origin-access-identity `` is the value that CloudFront returned in the ID element when you created the origin access identity. If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . CustomOriginConfig (dict) --A complex type that contains information about a custom origin. If the origin is an Amazon S3 bucket, use the S3OriginConfig element instead. HTTPPort (integer) -- [REQUIRED]The HTTP port the custom origin listens on. HTTPSPort (integer) -- [REQUIRED]The HTTPS port the custom origin listens on. OriginProtocolPolicy (string) -- [REQUIRED]The origin protocol policy to apply to your origin. OriginSslProtocols (dict) --The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. Quantity (integer) -- [REQUIRED]The number of SSL/TLS protocols that you want to allow CloudFront to use when establishing an HTTPS connection with this origin. Items (list) -- [REQUIRED]A list that contains allowed SSL/TLS protocols for this distribution. (string) -- OriginReadTimeout (integer) --You can create a custom origin read timeout. All timeout units are in seconds. The default origin read timeout is 30 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 4 seconds; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . OriginKeepaliveTimeout (integer) --You can create a custom keep-alive timeout. All timeout units are in seconds. The default keep-alive timeout is 5 seconds, but you can configure custom timeout lengths using the CloudFront API. The minimum timeout length is 1 second; the maximum is 60 seconds. If you need to increase the maximum time limit, contact the AWS Support Center . DefaultCacheBehavior (dict) -- [REQUIRED]A complex type that describes the default cache behavior if you do not specify a CacheBehavior element or if files don't match any of the values of PathPattern in CacheBehavior elements. You must create exactly one default cache behavior. TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) -- Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true ; if not, specify false . For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CacheBehaviors (dict) --A complex type that contains zero or more CacheBehavior elements. Quantity (integer) -- [REQUIRED]The number of cache behaviors for this distribution. Items (list) --Optional: A complex type that contains cache behaviors for this distribution. If Quantity is 0 , you can omit Items . (dict) --A complex type that describes how CloudFront processes requests. You must create at least as many cache behaviors (including the default cache behavior) as you have origins if you want CloudFront to distribute objects from all of the origins. Each cache behavior specifies the one origin from which you want CloudFront to get objects. If you have two origins and only the default cache behavior, the default cache behavior will cause CloudFront to get objects from one of the origins, but the other origin is never used. For the current limit on the number of cache behaviors that you can add to a distribution, see Amazon CloudFront Limits in the AWS General Reference . If you don't want to specify any cache behaviors, include only an empty CacheBehaviors element. Don't include an empty CacheBehavior element, or CloudFront returns a MalformedXML error. To delete all cache behaviors in an existing distribution, update the distribution configuration and include only an empty CacheBehaviors element. To add, change, or remove one or more cache behaviors, update the distribution configuration and specify all of the cache behaviors that you want to include in the updated distribution. For more information about cache behaviors, see Cache Behaviors in the Amazon CloudFront Developer Guide . PathPattern (string) -- [REQUIRED]The pattern (for example, images/*.jpg ) that specifies which requests to apply the behavior to. When CloudFront receives a viewer request, the requested path is compared with path patterns in the order in which cache behaviors are listed in the distribution. Note You can optionally include a slash (/ ) at the beginning of the path pattern. For example, /images/*.jpg . CloudFront behavior is the same with or without the leading / . The path pattern for the default cache behavior is * and cannot be changed. If the request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in the default cache behavior. For more information, see Path Pattern in the Amazon CloudFront Developer Guide . TargetOriginId (string) -- [REQUIRED]The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior. ForwardedValues (dict) -- [REQUIRED]A complex type that specifies how CloudFront handles query strings and cookies. QueryString (boolean) -- [REQUIRED]Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of QueryString and on the values that you specify for QueryStringCacheKeys , if any: If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If you specify true for QueryString and you specify one or more values for QueryStringCacheKeys , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify. If you specify false for QueryString , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters. For more information, see Configuring CloudFront to Cache Based on Query String Parameters in the Amazon CloudFront Developer Guide . Cookies (dict) -- [REQUIRED]A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies in the Amazon CloudFront Developer Guide . Forward (string) -- [REQUIRED]Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the WhitelistedNames complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the Forward element. WhitelistedNames (dict) --Required if you specify whitelist for the value of Forward: . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies. If you specify all or none for the value of Forward , omit WhitelistedNames . If you change the value of Forward from whitelist to all or none and you don't delete the WhitelistedNames element and its child elements, CloudFront deletes them automatically. For the current limit on the number of cookie names that you can whitelist for each cache behavior, see Amazon CloudFront Limits in the AWS General Reference . Quantity (integer) -- [REQUIRED]The number of different cookies that you want CloudFront to forward to the origin for this cache behavior. Items (list) --A complex type that contains one Name element for each cookie that you want CloudFront to forward to the origin for this cache behavior. (string) -- Headers (dict) --A complex type that specifies the Headers , if any, that you want CloudFront to vary upon for this cache behavior. Quantity (integer) -- [REQUIRED]The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following: Forward all headers to your origin : Specify 1 for Quantity and * for Name . Warning If you configure CloudFront to forward all headers to your origin, CloudFront doesn't cache the objects associated with this cache behavior. Instead, it sends every request to the origin. Forward a whitelist of headers you specify : Specify the number of headers that you want to forward, and specify the header names in Name elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify. Forward only the default headers : Specify 0 for Quantity and omit Items . In this configuration, CloudFront doesn't cache based on the values in the request headers. Items (list) --A complex type that contains one Name element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If Quantity is 0 , omit Items . (string) -- QueryStringCacheKeys (dict) --A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior. Quantity (integer) -- [REQUIRED]The number of whitelisted query string parameters for this cache behavior. Items (list) --(Optional) A list that contains the query string parameters that you want CloudFront to use as a basis for caching for this cache behavior. If Quantity is 0, you can omit Items . (string) -- TrustedSigners (dict) -- [REQUIRED]A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled , and specify the applicable values for Quantity and Items . For more information, see Serving Private Content through CloudFront in the Amazon Amazon CloudFront Developer Guide . If you don't want to require signed URLs in requests for objects that match PathPattern , specify false for Enabled and 0 for Quantity . Omit Items . To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false ), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- ViewerProtocolPolicy (string) -- [REQUIRED]The protocol that viewers can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern . You can specify the following options: allow-all : Viewers can use HTTP or HTTPS. redirect-to-https : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. https-only : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see Using an HTTPS Connection to Access Your Objects in the Amazon CloudFront Developer Guide . Note The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MinTTL (integer) -- [REQUIRED]The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon Amazon CloudFront Developer Guide . You must specify 0 for MinTTL if you configure CloudFront to forward all headers to your origin (under Headers , if you specify 1 for Quantity and * for Name ). AllowedMethods (dict) --A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. There are three choices: CloudFront forwards only GET and HEAD requests. CloudFront forwards only GET , HEAD , and OPTIONS requests. CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests. If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin. Quantity (integer) -- [REQUIRED]The number of HTTP methods that you want CloudFront to forward to your origin. Valid values are 2 (for GET and HEAD requests), 3 (for GET , HEAD , and OPTIONS requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST , and DELETE requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to process and forward to your origin. (string) -- CachedMethods (dict) --A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. There are two choices: CloudFront caches responses to GET and HEAD requests. CloudFront caches responses to GET , HEAD , and OPTIONS requests. If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. Quantity (integer) -- [REQUIRED]The number of HTTP methods for which you want CloudFront to cache responses. Valid values are 2 (for caching responses to GET and HEAD requests) and 3 (for caching responses to GET , HEAD , and OPTIONS requests). Items (list) -- [REQUIRED]A complex type that contains the HTTP methods that you want CloudFront to cache responses to. (string) -- SmoothStreaming (boolean) --Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior. If so, specify true ; if not, specify false . If you specify true for SmoothStreaming , you can still distribute other content using this cache behavior if the content matches the value of PathPattern . DefaultTTL (integer) --The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . MaxTTL (integer) --The maximum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects. For more information, see Specifying How Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . Compress (boolean) --Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true; if not, specify false. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide . LambdaFunctionAssociations (dict) --A complex type that contains zero or more Lambda function associations for a cache behavior. Quantity (integer) -- [REQUIRED]The number of Lambda function associations for this cache behavior. Items (list) -- Optional : A complex type that contains LambdaFunctionAssociation items for this cache behavior. If Quantity is 0 , you can omit Items . (dict) --A complex type that contains a Lambda function association. LambdaFunctionARN (string) --The ARN of the Lambda function. EventType (string) --Specifies the event type that triggers a Lambda function invocation. Valid values are: viewer-request origin-request viewer-response origin-response CustomErrorResponses (dict) --A complex type that controls the following: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Quantity (integer) -- [REQUIRED]The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If Quantity is 0 , you can omit Items . Items (list) --A complex type that contains a CustomErrorResponse element for each HTTP status code for which you want to specify a custom error page and/or a caching duration. (dict) --A complex type that controls: Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide . ErrorCode (integer) -- [REQUIRED]The HTTP status code for which you want to specify a custom error page and/or a caching duration. ResponsePagePath (string) --The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by ErrorCode , for example, /4xx-errors/403-forbidden.html . If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true: The value of PathPattern matches the path to your custom error messages. For example, suppose you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors . Your distribution must include a cache behavior for which the path pattern routes requests for your custom error pages to that location, for example, /4xx-errors/* . The value of TargetOriginId specifies the value of the ID element for the origin that contains your custom error pages. If you specify a value for ResponsePagePath , you must also specify a value for ResponseCode . If you don't want to specify a value, include an empty element, ResponsePagePath , in the XML document. We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable. ResponseCode (string) --The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example: Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute 200 , the response typically won't be intercepted. If you don't care about distinguishing among different client errors or server errors, you can specify 400 or 500 as the ResponseCode for all 4xx or 5xx errors. You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down. If you specify a value for ResponseCode , you must also specify a value for ResponsePagePath . If you don't want to specify a value, include an empty element, ResponseCode , in the XML document. ErrorCachingMinTTL (integer) --The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode . When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available. If you don't want to specify a value, include an empty element, ErrorCachingMinTTL , in the XML document. For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide . Comment (string) -- [REQUIRED]Any comments you want to include about the distribution. If you don't want to specify a comment, include an empty Comment element. To delete an existing comment, update the distribution configuration and include an empty Comment element. To add or change a comment, update the distribution configuration and specify the new comment. Logging (dict) --A complex type that controls whether access logs are written for the distribution. For more information about logging, see Access Logs in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a distribution or if you want to disable logging for an existing distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket , prefix , and IncludeCookies , the values are automatically deleted. IncludeCookies (boolean) -- [REQUIRED]Specifies whether you want CloudFront to include cookies in access logs, specify true for IncludeCookies . If you choose to include cookies in logs, CloudFront logs all cookies regardless of how you configure the cache behaviors for this distribution. If you do not want to include cookies when you create a distribution or if you want to disable include cookies for an existing distribution, specify false for IncludeCookies . Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. PriceClass (string) --The price class that corresponds with the maximum price that you want to pay for CloudFront service. If you specify PriceClass_All , CloudFront responds to requests for your objects from all CloudFront edge locations. If you specify a price class other than PriceClass_All , CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower performance. For more information about price classes, see Choosing the Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide . For information about CloudFront pricing, including how price classes map to CloudFront regions, see Amazon CloudFront Pricing . Enabled (boolean) -- [REQUIRED]From this field, you can enable or disable the selected distribution. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. ViewerCertificate (dict) --A complex type that specifies the following: Which SSL/TLS certificate to use when viewers request objects using HTTPS Whether you want CloudFront to use dedicated IP addresses or SNI when you're using alternate domain names in your object names The minimum protocol version that you want CloudFront to use when communicating with viewers For more information, see Using an HTTPS Connection to Access Your Objects in the Amazon Amazon CloudFront Developer Guide . CloudFrontDefaultCertificate (boolean) -- IAMCertificateId (string) -- ACMCertificateArn (string) -- SSLSupportMethod (string) --If you specify a value for ACMCertificateArn or for IAMCertificateId , you must also specify how you want CloudFront to serve HTTPS requests: using a method that works for all clients or one that works for most clients: vip : CloudFront uses dedicated IP addresses for your content and can respond to HTTPS requests from any viewer. However, you will incur additional monthly charges. sni-only : CloudFront can respond to HTTPS requests from viewers that support Server Name Indication (SNI). All modern browsers support SNI, but some browsers still in use don't support SNI. If some of your users' browsers don't support SNI, we recommend that you do one of the following: Use the vip option (dedicated IP addresses) instead of sni-only . Use the CloudFront SSL/TLS certificate instead of a custom certificate. This requires that you use the CloudFront domain name of your distribution in the URLs for your objects, for example, https://d111111abcdef8.cloudfront.net/logo.png . If you can control which browser your users use, upgrade the browser to one that supports SNI. Use HTTP instead of HTTPS. Do not specify a value for SSLSupportMethod if you specified CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate . For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . MinimumProtocolVersion (string) --Specify the minimum version of the SSL/TLS protocol that you want CloudFront to use for HTTPS connections between viewers and CloudFront: SSLv3 or TLSv1 . CloudFront serves your objects only to viewers that support SSL/TLS version that you specify and later versions. The TLSv1 protocol is more secure, so we recommend that you specify SSLv3 only if your users are using browsers or devices that don't support TLSv1 . Note the following: If you specify CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate, the minimum SSL protocol version is TLSv1 and can't be changed. If you're using a custom certificate (if you specify a value for ACMCertificateArn or for IAMCertificateId ) and if you're using SNI (if you specify sni-only for SSLSupportMethod ), you must specify TLSv1 for MinimumProtocolVersion . Certificate (string) --Include one of these values to specify the following: Whether you want viewers to use HTTP or HTTPS to request your objects. If you want viewers to use HTTPS, whether you're using an alternate domain name such as example.com or the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net . If you're using an alternate domain name, whether AWS Certificate Manager (ACM) provided the certificate, or you purchased a certificate from a third-party certificate authority and imported it into ACM or uploaded it to the IAM certificate store. You must specify one (and only one) of the three values. Do not specify false for CloudFrontDefaultCertificate . If you want viewers to use HTTP to request your objects : Specify the following value:CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate In addition, specify allow-all for ViewerProtocolPolicy for all of your cache behaviors. If you want viewers to use HTTPS to request your objects : Choose the type of certificate that you want to use based on whether you're using an alternate domain name for your objects or the CloudFront domain name: If you're using an alternate domain name, such as example.com : Specify one of the following values, depending on whether ACM provided your certificate or you purchased your certificate from third-party certificate authority: ACMCertificateArnARN for ACM SSL/TLS certificateACMCertificateArn where ARN for ACM SSL/TLS certificate is the ARN for the ACM SSL/TLS certificate that you want to use for this distribution. IAMCertificateIdIAM certificate IDIAMCertificateId where IAM certificate ID is the ID that IAM returned when you added the certificate to the IAM certificate store. If you specify ACMCertificateArn or IAMCertificateId , you must also specify a value for SSLSupportMethod . If you choose to use an ACM certificate or a certificate in the IAM certificate store, we recommend that you use only an alternate domain name in your object URLs (https://example.com/logo.jpg ). If you use the domain name that is associated with your CloudFront distribution (https://d111111abcdef8.cloudfront.net/logo.jpg ) and the viewer supports SNI , then CloudFront behaves normally. However, if the browser does not support SNI, the user's experience depends on the value that you choose for SSLSupportMethod : vip : The viewer displays a warning because there is a mismatch between the CloudFront domain name and the domain name in your SSL/TLS certificate. sni-only : CloudFront drops the connection with the browser without returning the object. **If you're using the CloudFront domain name for your distribution, such as d111111abcdef8.cloudfront.net ** : Specify the following value: `` CloudFrontDefaultCertificatetrueCloudFrontDefaultCertificate`` If you want viewers to use HTTPS, you must also specify one of the following values in your cache behaviors: ViewerProtocolPolicyhttps-onlyViewerProtocolPolicy ViewerProtocolPolicyredirect-to-httpsViewerProtocolPolicy You can also optionally require that CloudFront use HTTPS to communicate with your origin by specifying one of the following values for the applicable origins: OriginProtocolPolicyhttps-onlyOriginProtocolPolicy OriginProtocolPolicymatch-viewerOriginProtocolPolicy For more information, see Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide . CertificateSource (string) -- Note This field is deprecated. You can use one of the following: [ACMCertificateArn , IAMCertificateId , or CloudFrontDefaultCertificate] . Restrictions (dict) --A complex type that identifies ways in which you want to restrict distribution of your content. GeoRestriction (dict) -- [REQUIRED]A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using MaxMind GeoIP databases. RestrictionType (string) -- [REQUIRED]The method that you want to use to restrict distribution of your content by country: none : No geo restriction is enabled, meaning access to content is not restricted by client geo location. blacklist : The Location elements specify the countries in which you do not want CloudFront to distribute your content. whitelist : The Location elements specify the countries in which you want CloudFront to distribute your content. Quantity (integer) -- [REQUIRED]When geo restriction is enabled , this is the number of countries in your whitelist or blacklist . Otherwise, when it is not enabled, Quantity is 0 , and you can omit Items . Items (list) --A complex type that contains a Location element for each country in which you want CloudFront either to distribute your content (whitelist ) or not distribute your content (blacklist ). The Location element is a two-letter, uppercase country code for a country that you want to include in your blacklist or whitelist . Include one Location element for each country. CloudFront and MaxMind both use ISO 3166 country codes. For the current list of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on the International Organization for Standardization website. You can also refer to the country list in the CloudFront console, which includes both country names and codes. (string) -- WebACLId (string) --A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution. AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of query strings, CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide . HttpVersion (string) --(Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier HTTP version. For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name Identification (SNI). In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve performance by optimizing for HTTP/2. For more information, do an Internet search for 'http/2 optimization.' IsIPV6Enabled (boolean) --If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify true . If you specify false , CloudFront responds to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution. In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom policy that includes the IpAddress parameter to restrict the IP addresses that can access your content, do not enable IPv6. If you want to restrict access to some content by IP address and not restrict access to other content (or restrict access but not by IP address), you can create two distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide . If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the following are true: You enable IPv6 for the distribution You're using alternate domain names in the URLs for your objects For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53 Developer Guide . If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address format of the viewer request. :type Id: string :param Id: [REQUIRED] The distribution's id. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when retrieving the distribution's configuration. For example: E2QWRUHAPOMQZL . :rtype: dict :return: { 'Distribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'InProgressInvalidationBatches': 123, 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'DistributionConfig': { 'CallerReference': 'string', 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'DefaultRootObject': 'string', 'Origins': { 'Quantity': 123, 'Items': [ { 'Id': 'string', 'DomainName': 'string', 'OriginPath': 'string', 'CustomHeaders': { 'Quantity': 123, 'Items': [ { 'HeaderName': 'string', 'HeaderValue': 'string' }, ] }, 'S3OriginConfig': { 'OriginAccessIdentity': 'string' }, 'CustomOriginConfig': { 'HTTPPort': 123, 'HTTPSPort': 123, 'OriginProtocolPolicy': 'http-only'|'match-viewer'|'https-only', 'OriginSslProtocols': { 'Quantity': 123, 'Items': [ 'SSLv3'|'TLSv1'|'TLSv1.1'|'TLSv1.2', ] }, 'OriginReadTimeout': 123, 'OriginKeepaliveTimeout': 123 } }, ] }, 'DefaultCacheBehavior': { 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, 'CacheBehaviors': { 'Quantity': 123, 'Items': [ { 'PathPattern': 'string', 'TargetOriginId': 'string', 'ForwardedValues': { 'QueryString': True|False, 'Cookies': { 'Forward': 'none'|'whitelist'|'all', 'WhitelistedNames': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'Headers': { 'Quantity': 123, 'Items': [ 'string', ] }, 'QueryStringCacheKeys': { 'Quantity': 123, 'Items': [ 'string', ] } }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'ViewerProtocolPolicy': 'allow-all'|'https-only'|'redirect-to-https', 'MinTTL': 123, 'AllowedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ], 'CachedMethods': { 'Quantity': 123, 'Items': [ 'GET'|'HEAD'|'POST'|'PUT'|'PATCH'|'OPTIONS'|'DELETE', ] } }, 'SmoothStreaming': True|False, 'DefaultTTL': 123, 'MaxTTL': 123, 'Compress': True|False, 'LambdaFunctionAssociations': { 'Quantity': 123, 'Items': [ { 'LambdaFunctionARN': 'string', 'EventType': 'viewer-request'|'viewer-response'|'origin-request'|'origin-response' }, ] } }, ] }, 'CustomErrorResponses': { 'Quantity': 123, 'Items': [ { 'ErrorCode': 123, 'ResponsePagePath': 'string', 'ResponseCode': 'string', 'ErrorCachingMinTTL': 123 }, ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'IncludeCookies': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False, 'ViewerCertificate': { 'CloudFrontDefaultCertificate': True|False, 'IAMCertificateId': 'string', 'ACMCertificateArn': 'string', 'SSLSupportMethod': 'sni-only'|'vip', 'MinimumProtocolVersion': 'SSLv3'|'TLSv1', 'Certificate': 'string', 'CertificateSource': 'cloudfront'|'iam'|'acm' }, 'Restrictions': { 'GeoRestriction': { 'RestrictionType': 'blacklist'|'whitelist'|'none', 'Quantity': 123, 'Items': [ 'string', ] } }, 'WebACLId': 'string', 'HttpVersion': 'http1.1'|'http2', 'IsIPV6Enabled': True|False } }, 'ETag': 'string' } :returns: self , which is the AWS account used to create the distribution. An AWS account number. """ pass def update_streaming_distribution(StreamingDistributionConfig=None, Id=None, IfMatch=None): """ Update a streaming distribution. See also: AWS API Documentation :example: response = client.update_streaming_distribution( StreamingDistributionConfig={ 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False }, Id='string', IfMatch='string' ) :type StreamingDistributionConfig: dict :param StreamingDistributionConfig: [REQUIRED] The streaming distribution's configuration information. CallerReference (string) -- [REQUIRED]A unique number that ensures that the request can't be replayed. If the CallerReference is new (no matter the content of the StreamingDistributionConfig object), a new streaming distribution is created. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution, and the content of the StreamingDistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution but the content of the StreamingDistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error. S3Origin (dict) -- [REQUIRED]A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution. DomainName (string) -- [REQUIRED]The DNS name of the Amazon S3 origin. OriginAccessIdentity (string) -- [REQUIRED]The CloudFront origin access identity to associate with the RTMP distribution. Use an origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 bucket through CloudFront. If you want end users to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element. To replace the origin access identity, update the distribution configuration and specify the new origin access identity. For more information, see Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content in the Amazon Amazon CloudFront Developer Guide . Aliases (dict) --A complex type that contains information about CNAMEs (alternate domain names), if any, for this streaming distribution. Quantity (integer) -- [REQUIRED]The number of CNAME aliases, if any, that you want to associate with this distribution. Items (list) --A complex type that contains the CNAME aliases, if any, that you want to associate with this distribution. (string) -- Comment (string) -- [REQUIRED]Any comments you want to include about the streaming distribution. Logging (dict) --A complex type that controls whether access logs are written for the streaming distribution. Enabled (boolean) -- [REQUIRED]Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket. If you do not want to enable logging when you create a streaming distribution or if you want to disable logging for an existing streaming distribution, specify false for Enabled , and specify empty Bucket and Prefix elements. If you specify false for Enabled but you specify values for Bucket and Prefix , the values are automatically deleted. Bucket (string) -- [REQUIRED]The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com . Prefix (string) -- [REQUIRED]An optional string that you want CloudFront to prefix to the access log filenames for this streaming distribution, for example, myprefix/ . If you want to enable logging, but you do not want to specify a prefix, you still must include an empty Prefix element in the Logging element. TrustedSigners (dict) -- [REQUIRED]A complex type that specifies any AWS accounts that you want to permit to create signed URLs for private content. If you want the distribution to use signed URLs, include this element; if you want the distribution to use public URLs, remove this element. For more information, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide . Enabled (boolean) -- [REQUIRED]Specifies whether you want to require viewers to use signed URLs to access the files specified by PathPattern and TargetOriginId . Quantity (integer) -- [REQUIRED]The number of trusted signers for this cache behavior. Items (list) -- Optional : A complex type that contains trusted signers for this cache behavior. If Quantity is 0 , you can omit Items . (string) -- PriceClass (string) --A complex type that contains information about price class for this streaming distribution. Enabled (boolean) -- [REQUIRED]Whether the streaming distribution is enabled to accept user requests for content. :type Id: string :param Id: [REQUIRED] The streaming distribution's id. :type IfMatch: string :param IfMatch: The value of the ETag header that you received when retrieving the streaming distribution's configuration. For example: E2QWRUHAPOMQZL . :rtype: dict :return: { 'StreamingDistribution': { 'Id': 'string', 'ARN': 'string', 'Status': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'DomainName': 'string', 'ActiveTrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ { 'AwsAccountNumber': 'string', 'KeyPairIds': { 'Quantity': 123, 'Items': [ 'string', ] } }, ] }, 'StreamingDistributionConfig': { 'CallerReference': 'string', 'S3Origin': { 'DomainName': 'string', 'OriginAccessIdentity': 'string' }, 'Aliases': { 'Quantity': 123, 'Items': [ 'string', ] }, 'Comment': 'string', 'Logging': { 'Enabled': True|False, 'Bucket': 'string', 'Prefix': 'string' }, 'TrustedSigners': { 'Enabled': True|False, 'Quantity': 123, 'Items': [ 'string', ] }, 'PriceClass': 'PriceClass_100'|'PriceClass_200'|'PriceClass_All', 'Enabled': True|False } }, 'ETag': 'string' } :returns: self , which is the AWS account used to create the distribution. An AWS account number. """ pass
# https://codeforces.com/problemset/problem/467/A n = int(input()) rooms = [list(map(int, input().split())) for _ in range(n)] ans = 0 for room in rooms: if room[1] - room[0] >= 2: ans += 1 print(ans)
n = int(input()) rooms = [list(map(int, input().split())) for _ in range(n)] ans = 0 for room in rooms: if room[1] - room[0] >= 2: ans += 1 print(ans)
# # PySNMP MIB module A3COM-HUAWEI-VRRP-EXT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-VRRP-EXT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 16:53:06 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # h3cCommon, = mibBuilder.importSymbols("A3COM-HUAWEI-OID-MIB", "h3cCommon") ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") NotificationType, ModuleIdentity, Counter32, TimeTicks, Unsigned32, ObjectIdentity, Bits, IpAddress, Counter64, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Gauge32, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "ModuleIdentity", "Counter32", "TimeTicks", "Unsigned32", "ObjectIdentity", "Bits", "IpAddress", "Counter64", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Gauge32", "Integer32") DisplayString, RowStatus, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "RowStatus", "TextualConvention") vrrpOperVrId, = mibBuilder.importSymbols("VRRP-MIB", "vrrpOperVrId") h3cVrrpExt = ModuleIdentity((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24)) if mibBuilder.loadTexts: h3cVrrpExt.setLastUpdated('200412090000Z') if mibBuilder.loadTexts: h3cVrrpExt.setOrganization('Huawei-3Com Technologies Co.,Ltd.') h3cVrrpExtMibObject = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1)) h3cVrrpExtTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1), ) if mibBuilder.loadTexts: h3cVrrpExtTable.setStatus('current') h3cVrrpExtEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "VRRP-MIB", "vrrpOperVrId"), (0, "A3COM-HUAWEI-VRRP-EXT-MIB", "h3cVrrpExtTrackInterface")) if mibBuilder.loadTexts: h3cVrrpExtEntry.setStatus('current') h3cVrrpExtTrackInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))) if mibBuilder.loadTexts: h3cVrrpExtTrackInterface.setStatus('current') h3cVrrpExtPriorityReduce = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(10)).setMaxAccess("readcreate") if mibBuilder.loadTexts: h3cVrrpExtPriorityReduce.setStatus('current') h3cVrrpExtRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: h3cVrrpExtRowStatus.setStatus('current') mibBuilder.exportSymbols("A3COM-HUAWEI-VRRP-EXT-MIB", h3cVrrpExtMibObject=h3cVrrpExtMibObject, h3cVrrpExtPriorityReduce=h3cVrrpExtPriorityReduce, PYSNMP_MODULE_ID=h3cVrrpExt, h3cVrrpExtTrackInterface=h3cVrrpExtTrackInterface, h3cVrrpExtRowStatus=h3cVrrpExtRowStatus, h3cVrrpExtEntry=h3cVrrpExtEntry, h3cVrrpExtTable=h3cVrrpExtTable, h3cVrrpExt=h3cVrrpExt)
(h3c_common,) = mibBuilder.importSymbols('A3COM-HUAWEI-OID-MIB', 'h3cCommon') (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, value_range_constraint, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion') (if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (notification_type, module_identity, counter32, time_ticks, unsigned32, object_identity, bits, ip_address, counter64, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, gauge32, integer32) = mibBuilder.importSymbols('SNMPv2-SMI', 'NotificationType', 'ModuleIdentity', 'Counter32', 'TimeTicks', 'Unsigned32', 'ObjectIdentity', 'Bits', 'IpAddress', 'Counter64', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'Gauge32', 'Integer32') (display_string, row_status, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'RowStatus', 'TextualConvention') (vrrp_oper_vr_id,) = mibBuilder.importSymbols('VRRP-MIB', 'vrrpOperVrId') h3c_vrrp_ext = module_identity((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24)) if mibBuilder.loadTexts: h3cVrrpExt.setLastUpdated('200412090000Z') if mibBuilder.loadTexts: h3cVrrpExt.setOrganization('Huawei-3Com Technologies Co.,Ltd.') h3c_vrrp_ext_mib_object = mib_identifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1)) h3c_vrrp_ext_table = mib_table((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1)) if mibBuilder.loadTexts: h3cVrrpExtTable.setStatus('current') h3c_vrrp_ext_entry = mib_table_row((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'VRRP-MIB', 'vrrpOperVrId'), (0, 'A3COM-HUAWEI-VRRP-EXT-MIB', 'h3cVrrpExtTrackInterface')) if mibBuilder.loadTexts: h3cVrrpExtEntry.setStatus('current') h3c_vrrp_ext_track_interface = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))) if mibBuilder.loadTexts: h3cVrrpExtTrackInterface.setStatus('current') h3c_vrrp_ext_priority_reduce = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 255)).clone(10)).setMaxAccess('readcreate') if mibBuilder.loadTexts: h3cVrrpExtPriorityReduce.setStatus('current') h3c_vrrp_ext_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 24, 1, 1, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: h3cVrrpExtRowStatus.setStatus('current') mibBuilder.exportSymbols('A3COM-HUAWEI-VRRP-EXT-MIB', h3cVrrpExtMibObject=h3cVrrpExtMibObject, h3cVrrpExtPriorityReduce=h3cVrrpExtPriorityReduce, PYSNMP_MODULE_ID=h3cVrrpExt, h3cVrrpExtTrackInterface=h3cVrrpExtTrackInterface, h3cVrrpExtRowStatus=h3cVrrpExtRowStatus, h3cVrrpExtEntry=h3cVrrpExtEntry, h3cVrrpExtTable=h3cVrrpExtTable, h3cVrrpExt=h3cVrrpExt)
age = float(input()) gender = input() if gender == 'm': if 0 < age < 16: print('Master') elif age >= 16: print ('Mr.') elif gender == 'f': if 0 < age < 16: print('Miss') elif age >= 16: print ('Ms.')
age = float(input()) gender = input() if gender == 'm': if 0 < age < 16: print('Master') elif age >= 16: print('Mr.') elif gender == 'f': if 0 < age < 16: print('Miss') elif age >= 16: print('Ms.')
# encoding: utf-8 """ error.py We declare here a class hierarchy for all exceptions produced by IPython, in cases where we don't just raise one from the standard library. """ __docformat__ = "restructuredtext en" #------------------------------------------------------------------------------- # Copyright (C) 2008 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # Imports #------------------------------------------------------------------------------- class IPythonError(Exception): """Base exception that all of our exceptions inherit from. This can be raised by code that doesn't have any more specific information.""" pass # Exceptions associated with the controller objects class ControllerError(IPythonError): pass class ControllerCreationError(ControllerError): pass # Exceptions associated with the Engines class EngineError(IPythonError): pass class EngineCreationError(EngineError): pass
""" error.py We declare here a class hierarchy for all exceptions produced by IPython, in cases where we don't just raise one from the standard library. """ __docformat__ = 'restructuredtext en' class Ipythonerror(Exception): """Base exception that all of our exceptions inherit from. This can be raised by code that doesn't have any more specific information.""" pass class Controllererror(IPythonError): pass class Controllercreationerror(ControllerError): pass class Engineerror(IPythonError): pass class Enginecreationerror(EngineError): pass
""" 107. Word Break https://www.lintcode.com/problem/word-break/description?_from=ladder&&fromId=160 DFS on dictionary """ class Solution: """ @param s: A string @param wordSet: A dictionary of words dict @return: A boolean """ def wordBreak(self, s, wordSet): # write your code here return self.dfs(0, s, wordSet) def dfs(self, index, s, wordSet): if (index == len(s)): return True for word in wordSet: if not s[index:].startswith(word): continue if self.dfs(index + len(word), s, wordSet): return True return False
""" 107. Word Break https://www.lintcode.com/problem/word-break/description?_from=ladder&&fromId=160 DFS on dictionary """ class Solution: """ @param s: A string @param wordSet: A dictionary of words dict @return: A boolean """ def word_break(self, s, wordSet): return self.dfs(0, s, wordSet) def dfs(self, index, s, wordSet): if index == len(s): return True for word in wordSet: if not s[index:].startswith(word): continue if self.dfs(index + len(word), s, wordSet): return True return False
# Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. # Input: [-2,1,-3,4,-1,2,1,-5,4], # Output: 6 # Explanation: [4,-1,2,1] has the largest sum = 6. #https://www.geeksforgeeks.org/print-the-maximum-subarray-sum/ def naive(a): b = [] index = [] for i in range(len(a)): for j in range(i,len(a)): b.append(sum(a[i:j+1])) index.append([i,j]) return b, index def main(a): curr_sum = max_sum = a[0] end_index = 0 for i in range(1,len(a)): curr_sum=max(a[i], curr_sum+a[i]) if max_sum < curr_sum: end_index = i max_sum = max(max_sum, curr_sum) _max_sum = max_sum start_index = end_index while start_index >= 0: _max_sum -=a[start_index] if _max_sum ==0: break start_index -= 1 # print(start_index, end_index) for i in range(start_index, end_index+1): print(a[i], end=" ") return max_sum if __name__ == "__main__": a=[-2,1,-3,4,-1,5,1,-5,4] # b, index=naive(a) # print(max(b),index[b.index(max(b))]) # print(b) # print(index[27], b[27]) print(main(a))
def naive(a): b = [] index = [] for i in range(len(a)): for j in range(i, len(a)): b.append(sum(a[i:j + 1])) index.append([i, j]) return (b, index) def main(a): curr_sum = max_sum = a[0] end_index = 0 for i in range(1, len(a)): curr_sum = max(a[i], curr_sum + a[i]) if max_sum < curr_sum: end_index = i max_sum = max(max_sum, curr_sum) _max_sum = max_sum start_index = end_index while start_index >= 0: _max_sum -= a[start_index] if _max_sum == 0: break start_index -= 1 for i in range(start_index, end_index + 1): print(a[i], end=' ') return max_sum if __name__ == '__main__': a = [-2, 1, -3, 4, -1, 5, 1, -5, 4] print(main(a))
# cook your dish here #input n=int(input("")) resp=[] for i in range(0,n): resp.append(input("")) #print(n,resp) def validlang(req): newreq=[] for i in req: if i!=" ": newreq.append(i) needed=[newreq[0],newreq[1]] lang1=[newreq[2],newreq[3]] lang2=[newreq[4],newreq[5]] final=[] for i in needed: if i in lang1: final.append("A") else: final.append("B") if final[0]!=final[1]: return 0 elif final[0]==final[1] and final[0]=="A": return 1 elif final[0]==final[1] and final[0]=="B": return 2 for i in resp: print(validlang(i))
n = int(input('')) resp = [] for i in range(0, n): resp.append(input('')) def validlang(req): newreq = [] for i in req: if i != ' ': newreq.append(i) needed = [newreq[0], newreq[1]] lang1 = [newreq[2], newreq[3]] lang2 = [newreq[4], newreq[5]] final = [] for i in needed: if i in lang1: final.append('A') else: final.append('B') if final[0] != final[1]: return 0 elif final[0] == final[1] and final[0] == 'A': return 1 elif final[0] == final[1] and final[0] == 'B': return 2 for i in resp: print(validlang(i))
# Time: O(nlogn) # Space: O(1) # sort class Solution(object): def maxConsecutive(self, bottom, top, special): """ :type bottom: int :type top: int :type special: List[int] :rtype: int """ special.sort() result = max(special[0]-bottom, top-special[-1]) for i in xrange(1, len(special)): result = max(result, special[i]-special[i-1]-1) return result
class Solution(object): def max_consecutive(self, bottom, top, special): """ :type bottom: int :type top: int :type special: List[int] :rtype: int """ special.sort() result = max(special[0] - bottom, top - special[-1]) for i in xrange(1, len(special)): result = max(result, special[i] - special[i - 1] - 1) return result
""" from __future__ import annotations import threading import time from typing import TYPE_CHECKING from bot import app_vars if TYPE_CHECKING: from bot import Bot class TaskScheduler(threading.Thread): def __init__(self, bot: Bot): super().__init__(daemon=True) self.name = "SchedulerThread" self.tasks = {} # self.user = User(0, "", "", 0, 0, "", is_admin=True, is_banned=False) def run(self): while True: for t in self.tasks: if self.get_time() >= t: task = self.tasks[t] task[0](task[1], self.user) time.sleep(app_vars.loop_timeout) def get_time(self): return int(round(time.time())) """
""" from __future__ import annotations import threading import time from typing import TYPE_CHECKING from bot import app_vars if TYPE_CHECKING: from bot import Bot class TaskScheduler(threading.Thread): def __init__(self, bot: Bot): super().__init__(daemon=True) self.name = "SchedulerThread" self.tasks = {} # self.user = User(0, "", "", 0, 0, "", is_admin=True, is_banned=False) def run(self): while True: for t in self.tasks: if self.get_time() >= t: task = self.tasks[t] task[0](task[1], self.user) time.sleep(app_vars.loop_timeout) def get_time(self): return int(round(time.time())) """
nombre = "Fulanito Fulanovsky" usa_lentes = True tiene_mascota = False edad = 25 pasatiempos = ["Correr", "Cocinar", "Leer", "Bailar"] celulares = { "xiaomi redmi": { "RAM": 3, "ROM": 32, "Procesador": 2.1 }, "iphone xs": { "RAM": 4, "ROM": 64, "Procesador": 2.6 }, } print("Nombre: {}".format(nombre)) print("Usa lentes?: {}".format(usa_lentes)) print("Tiene mascotas?: {}".format(usa_lentes)) print("Edad: {}".format(edad)) print("Pasatiempos: {}".format(pasatiempos)) print("Celulares: {}".format(celulares)) #and = "Palabrita" #print(and)
nombre = 'Fulanito Fulanovsky' usa_lentes = True tiene_mascota = False edad = 25 pasatiempos = ['Correr', 'Cocinar', 'Leer', 'Bailar'] celulares = {'xiaomi redmi': {'RAM': 3, 'ROM': 32, 'Procesador': 2.1}, 'iphone xs': {'RAM': 4, 'ROM': 64, 'Procesador': 2.6}} print('Nombre: {}'.format(nombre)) print('Usa lentes?: {}'.format(usa_lentes)) print('Tiene mascotas?: {}'.format(usa_lentes)) print('Edad: {}'.format(edad)) print('Pasatiempos: {}'.format(pasatiempos)) print('Celulares: {}'.format(celulares))
alerts = [ { "uuid": "d916cb34-6ee3-48c0-bca5-3f3cc08db5d3", "type": "v1/insights/droplet/cpu", "description": "CPU is running high", "compare": "GreaterThan", "value": 70, "window": "5m", "entities": [], "tags": [], "alerts": {"slack": [], "email": ["alerts@example.com"]}, "enabled": True, } ]
alerts = [{'uuid': 'd916cb34-6ee3-48c0-bca5-3f3cc08db5d3', 'type': 'v1/insights/droplet/cpu', 'description': 'CPU is running high', 'compare': 'GreaterThan', 'value': 70, 'window': '5m', 'entities': [], 'tags': [], 'alerts': {'slack': [], 'email': ['alerts@example.com']}, 'enabled': True}]
# Uses Python3 n = int(input('Enter the number for which you want fibonnaci: ')) def fibonnaci_last_digit(num): second_last = 0 last = 1 if num < 0: return 'Incorrect input' elif num == 0: return second_last elif num == 1: return last for i in range(1, num): next = ((last % 10) + (second_last % 10)) % 10 second_last = last last = next return last print(fibonnaci_last_digit(n))
n = int(input('Enter the number for which you want fibonnaci: ')) def fibonnaci_last_digit(num): second_last = 0 last = 1 if num < 0: return 'Incorrect input' elif num == 0: return second_last elif num == 1: return last for i in range(1, num): next = (last % 10 + second_last % 10) % 10 second_last = last last = next return last print(fibonnaci_last_digit(n))
class User: def __init__(self, name): self.name = name class SubscribedUser(User): def __init__(self, name): super(SubscribedUser, self).__init__(name) self.subscribed = True class Account: def __init__(self, user, email_broadcaster): self.user = user self.email_broadcaster = email_broadcaster def on_account_created(self, event): return self.email_broadcaster.broadcast(event, self.user) class Rectangle: def __init__(self, width, height): self._height = height self._width = width @property def area(self): return self._width * self._height def __str__(self): return f"Width: {self.width}, height: {self.height}" @property def width(self): return self._width @width.setter def width(self, value): self._width = value @property def height(self): return self._height @height.setter def height(self, value): self._height = value
class User: def __init__(self, name): self.name = name class Subscribeduser(User): def __init__(self, name): super(SubscribedUser, self).__init__(name) self.subscribed = True class Account: def __init__(self, user, email_broadcaster): self.user = user self.email_broadcaster = email_broadcaster def on_account_created(self, event): return self.email_broadcaster.broadcast(event, self.user) class Rectangle: def __init__(self, width, height): self._height = height self._width = width @property def area(self): return self._width * self._height def __str__(self): return f'Width: {self.width}, height: {self.height}' @property def width(self): return self._width @width.setter def width(self, value): self._width = value @property def height(self): return self._height @height.setter def height(self, value): self._height = value
def count_elem(array, query): def first_occurance(array, query): lo, hi = 0, len(array) -1 while lo <= hi: mid = lo + (hi - lo) // 2 if (array[mid] == query and mid == 0) or \ (array[mid] == query and array[mid-1] < query): return mid elif (array[mid] <= query): lo = mid + 1 else: hi = mid - 1 def last_occurance(array, query): lo, hi = 0, len(array) -1 while lo <= hi: mid = lo + (hi - lo) // 2 if (array[mid] == query and mid == len(array) - 1) or \ (array[mid] == query and array[mid+1] > query): return mid elif (array[mid] <= query): lo = mid + 1 else: hi = mid - 1 first = first_occurance(array, query) last = last_occurance(array, query) if first is None or last is None: return None return last - first + 1 array = [1,2,3,3,3,3,4,4,4,4,5,6,6,6] print(array) print("-----COUNT-----") query = 3 print("count: ", query, " :" , count_elem(array, query)) print("-----COUNT-----") query = 5 print("count: ", query, " :" , count_elem(array, query)) print("-----COUNT-----") query = 7 print("count: ", query, " :" , count_elem(array, query)) print("-----COUNT-----") query = 1 print("count: ", query, " :" , count_elem(array, query)) print("-----COUNT-----") query = -1 print("count: ", query, " :" , count_elem(array, query)) print("-----COUNT-----") query = 9 print("count: ", query, " :" , count_elem(array, query))
def count_elem(array, query): def first_occurance(array, query): (lo, hi) = (0, len(array) - 1) while lo <= hi: mid = lo + (hi - lo) // 2 if array[mid] == query and mid == 0 or (array[mid] == query and array[mid - 1] < query): return mid elif array[mid] <= query: lo = mid + 1 else: hi = mid - 1 def last_occurance(array, query): (lo, hi) = (0, len(array) - 1) while lo <= hi: mid = lo + (hi - lo) // 2 if array[mid] == query and mid == len(array) - 1 or (array[mid] == query and array[mid + 1] > query): return mid elif array[mid] <= query: lo = mid + 1 else: hi = mid - 1 first = first_occurance(array, query) last = last_occurance(array, query) if first is None or last is None: return None return last - first + 1 array = [1, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 6, 6, 6] print(array) print('-----COUNT-----') query = 3 print('count: ', query, ' :', count_elem(array, query)) print('-----COUNT-----') query = 5 print('count: ', query, ' :', count_elem(array, query)) print('-----COUNT-----') query = 7 print('count: ', query, ' :', count_elem(array, query)) print('-----COUNT-----') query = 1 print('count: ', query, ' :', count_elem(array, query)) print('-----COUNT-----') query = -1 print('count: ', query, ' :', count_elem(array, query)) print('-----COUNT-----') query = 9 print('count: ', query, ' :', count_elem(array, query))
#!/usr/bin/env python main = units.configure.cli.prompt if __name__ == '__main__': main()
main = units.configure.cli.prompt if __name__ == '__main__': main()
class DatabaseFormat (object): def __init__(self, logger): self.logger = logger # Table name self.type = None # Primary key self.id = None # 1:N Relationship with records in other tables self.parent = None self.parent_type = None self.children = {} # N:N Relationship with records in other tables self.associated_objects = {} def create_child(self, child): """ Create 1:N relation between object :param child: :return: """ self.children[child.type][child.id] = child child.parent = self child.parent_type = self.type self.logger.info("Added record: parent_id=%s; parent_type=%s; child_id=%s; child_type=%s;" % (self.id, self.type, child.id, child.type)) def clear_children(self): # delete all children for children_type in self.children.values(): for child in list(children_type.values()): child.delete() self.logger.info("cleared children of object id=%s; type=%s; parent_id=%s" % (self.id, self.type, self.parent.id)) def clear_friends(self): # delete N:N relationship for nn_object_type in self.associated_objects.values(): for nn_object in nn_object_type.values(): del nn_object.associated_objects[self.type][self.id] self.logger.info("cleared nn_association with object id=%s; type=%s; parent_id=%s" % (self.id, self.type, self.parent.id)) def clear(self): self.clear_children() self.clear_friends() def delete(self): self.clear() # delete 1:N relationship with the parent del self.parent.children[self.type][self.id] self.logger.info("Deleted record: id=%s; type=%s" % (self.id, self.type)) def assign(self, friend): """ Create N:N relation between object :param friend: :return: """ if friend.id not in self.associated_objects[friend.type] and self.id not in friend.associated_objects[self.type]: self.associated_objects[friend.type][friend.id] = friend friend.associated_objects[self.type][self.id] = self self.logger.info("New assignment: id=%s; type=%s with id=%s; type=%s" % (self.id, self.type, friend.id, friend.type)) else: self.logger.error("Duplicate assignment requested: id=%s; type=%s with id=%s; type=%s" % (self.id, self.type, friend.id, friend.type)) def detach(self, friend): if friend.id in self.associated_objects[friend.type]: del self.associated_objects[friend.type][friend.id] del friend.associated_objects[self.type][self.id] self.logger.info("Delete assignment: id=%s; type=%s with id=%s; type=%s" % (self.id, self.type, friend.id, friend.type)) else: self.logger.error("Unknown unassignment requested: id=%s; type=%s with id=%s; type=%s" % (self.id, self.type, friend.id, friend.type)) def get_db(self): return self.parent.get_db() def _get_record_generic_part(self): data = {} # Primary key data['id'] = self.id # Parent if self.parent is None: data['parent'] = "orphan" else: data['parent'] = self.parent.id # Children data['children'] = {} for child_type, children in self.children.items(): data['children'][child_type] = [] for id, child in children.items(): data['children'][child_type].append(id) # n:n relation self._get_record_nn_relationship(data) return data def _get_recursive_record_generic_part(self): data = {} # Primary key data['id'] = self.id # Children data['children'] = {} for child_type, children in self.children.items(): data['children'][child_type] = {} for id, child in children.items(): data['children'][child_type][id] = child.dump_json_format() # n:n relation self._get_record_nn_relationship(data) return data def _get_record_nn_relationship(self, data): # n:n relation data['associated_objects'] = {} for object_type, nn_objects in self.associated_objects.items(): data['associated_objects'][object_type] = [] for id, nn_object in nn_objects.items(): data['associated_objects'][object_type].append(id) return data def _get_record_specific_part(self, data): # to be override pass return data def get_json_format(self): data = self._get_record_generic_part() data = self._get_record_specific_part(data) return data def dump_json_format(self): data = self._get_recursive_record_generic_part() data = self._get_record_specific_part(data) return data
class Databaseformat(object): def __init__(self, logger): self.logger = logger self.type = None self.id = None self.parent = None self.parent_type = None self.children = {} self.associated_objects = {} def create_child(self, child): """ Create 1:N relation between object :param child: :return: """ self.children[child.type][child.id] = child child.parent = self child.parent_type = self.type self.logger.info('Added record: parent_id=%s; parent_type=%s; child_id=%s; child_type=%s;' % (self.id, self.type, child.id, child.type)) def clear_children(self): for children_type in self.children.values(): for child in list(children_type.values()): child.delete() self.logger.info('cleared children of object id=%s; type=%s; parent_id=%s' % (self.id, self.type, self.parent.id)) def clear_friends(self): for nn_object_type in self.associated_objects.values(): for nn_object in nn_object_type.values(): del nn_object.associated_objects[self.type][self.id] self.logger.info('cleared nn_association with object id=%s; type=%s; parent_id=%s' % (self.id, self.type, self.parent.id)) def clear(self): self.clear_children() self.clear_friends() def delete(self): self.clear() del self.parent.children[self.type][self.id] self.logger.info('Deleted record: id=%s; type=%s' % (self.id, self.type)) def assign(self, friend): """ Create N:N relation between object :param friend: :return: """ if friend.id not in self.associated_objects[friend.type] and self.id not in friend.associated_objects[self.type]: self.associated_objects[friend.type][friend.id] = friend friend.associated_objects[self.type][self.id] = self self.logger.info('New assignment: id=%s; type=%s with id=%s; type=%s' % (self.id, self.type, friend.id, friend.type)) else: self.logger.error('Duplicate assignment requested: id=%s; type=%s with id=%s; type=%s' % (self.id, self.type, friend.id, friend.type)) def detach(self, friend): if friend.id in self.associated_objects[friend.type]: del self.associated_objects[friend.type][friend.id] del friend.associated_objects[self.type][self.id] self.logger.info('Delete assignment: id=%s; type=%s with id=%s; type=%s' % (self.id, self.type, friend.id, friend.type)) else: self.logger.error('Unknown unassignment requested: id=%s; type=%s with id=%s; type=%s' % (self.id, self.type, friend.id, friend.type)) def get_db(self): return self.parent.get_db() def _get_record_generic_part(self): data = {} data['id'] = self.id if self.parent is None: data['parent'] = 'orphan' else: data['parent'] = self.parent.id data['children'] = {} for (child_type, children) in self.children.items(): data['children'][child_type] = [] for (id, child) in children.items(): data['children'][child_type].append(id) self._get_record_nn_relationship(data) return data def _get_recursive_record_generic_part(self): data = {} data['id'] = self.id data['children'] = {} for (child_type, children) in self.children.items(): data['children'][child_type] = {} for (id, child) in children.items(): data['children'][child_type][id] = child.dump_json_format() self._get_record_nn_relationship(data) return data def _get_record_nn_relationship(self, data): data['associated_objects'] = {} for (object_type, nn_objects) in self.associated_objects.items(): data['associated_objects'][object_type] = [] for (id, nn_object) in nn_objects.items(): data['associated_objects'][object_type].append(id) return data def _get_record_specific_part(self, data): pass return data def get_json_format(self): data = self._get_record_generic_part() data = self._get_record_specific_part(data) return data def dump_json_format(self): data = self._get_recursive_record_generic_part() data = self._get_record_specific_part(data) return data
class Command: ADVANCE = 1 REVERSE = 2 ADVANCE_LEFT = 3 ADVANCE_RIGHT = 4 REVERSE_LEFT = 5 REVERSE_RIGHT = 6 OBSTACLE_FRONT = 7 OBSTACLE_BOTTOM = 8 NONE_OBSTACLE_FRONT = 9 NONE_OBSTACLE_BOTTOM = 10 BRAKE = 11 DISABLE_MOTER = 12
class Command: advance = 1 reverse = 2 advance_left = 3 advance_right = 4 reverse_left = 5 reverse_right = 6 obstacle_front = 7 obstacle_bottom = 8 none_obstacle_front = 9 none_obstacle_bottom = 10 brake = 11 disable_moter = 12
print('this is test3') print('add=====') print('add=====2')
print('this is test3') print('add=====') print('add=====2')
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: b.lin@mfm.tu-darmstadt.de """ def CreateInputFileUpper(InputFileName,MeshFile): data = open(InputFileName,'w+') data.write("\n[Mesh]\ \n type = FileMesh\ \n file = %s \ \n construct_side_list_from_node_list = true\ \n[]\ \n[MeshModifiers]\ \n [./interface]\ \n type = BreakMeshByBlock\ \n [../]\ \n[]\ \n\ \n[MeshModifiers]\ \n [./surface1]\ \n type = BoundingBoxNodeSet\ \n new_boundary = 's'\ \n bottom_left = '0 0 0' # xmin ymin zmin\ \n top_right = '0.4 0 0.052' #xmax ymin+a zmax\ \n # depends_on = 'block1'\ \n [../]\ \n [./surface2]\ \n type = BoundingBoxNodeSet\ \n new_boundary = 'w'\ \n bottom_left = '0 0 0' # xmin ymin zmin\ \n top_right = '0 0.4 0.052' # xmin+a ymax zmax\ \n # depends_on = 'block1'\ \n [../]\ \n [./surface3]\ \n type = BoundingBoxNodeSet\ \n new_boundary = 'n'\ \n bottom_left = '0.0 0.397 0.0' #xmin ymax-a zmin\ \n top_right = '0.4 0.4 0.052' #xmax ymax zmax\ \n # depends_on = 'block1'\ \n [../]\ \n [./surface4]\ \n type = BoundingBoxNodeSet\ \n new_boundary = 'o'\ \n bottom_left = '0.396 0.0 0.0' #xmax-a ymin+a zmin\ \n top_right = '0.4 0.4 0.052' #xmax ymax zmax\ \n # depends_on = 'block1'\ \n [../]\ \n []\ \n\ \n[GlobalParams]\ \n PhiN = 3.61667e-07 #A.Kulachenko T.uesaka MoM (2012)\ \n PhiT = 5.044e-06 #A.Kulachenko T.uesaka MoM (2012) 3.6275\ \n MaxAllowableTraction ='0.00206667 0.00646667 0.00646667' # #A.Kulachenko T.uesaka MoM (2012)\ \n DeltaN = 0.00035 # #A.Kulachenko T.uesaka MoM (2012)\ \n DeltaT = 0.00156 # #A.Kulachenko T.uesaka MoM (2012)\ \n C_ijkl = '100 0.33 0.33 10.72 4.2 10.72 4.35 4.35 35.97'\ \n[]\ \n\ \n[Variables]\ \n [./disp_x]\ \n initial_condition = 1e-15\ \n [../]\ \n [./disp_y]\ \n initial_condition = 1e-15\ \n [../]\ \n [./disp_z]\ \n initial_condition = 1e-15\ \n [../]\ \n[]\ \n\ \n[AuxVariables]\ \n [./vonMises]\ \n family = MONOMIAL\ \n order = FIRST\ \n [../]\ \n [./Rx]\ \n family = LAGRANGE\ \n order = FIRST\ \n [../]\ \n [./Ry]\ \n family = LAGRANGE\ \n order = FIRST\ \n [../]\ \n [./Rz]\ \n family = LAGRANGE\ \n order = FIRST\ \n [../]\ \n [./E]\ \n family = MONOMIAL\ \n order = CONSTANT\ \n [../]\ \n []\ \n\ \n[Kernels]\ \n [./TensorMechanics]\ \n displacements = 'disp_x disp_y disp_z'\ \n save_in = 'Rx Ry Rz'\ \n [../]\ \n[]\ \n\ \n[InterfaceKernels]\ \n [./interface_X]\ \n type = CZMInterfaceKernel\ \n disp_index = 0\ \n variable = disp_x\ \n neighbor_var = disp_x\ \n disp_1 = disp_y\ \n disp_1_neighbor = disp_y\ \n disp_2 = disp_z\ \n disp_2_neighbor = disp_z\ \n boundary = interface\ \n [../]\ \n [./interface_Y]\ \n type = CZMInterfaceKernel\ \n disp_index = 1\ \n variable = disp_y\ \n neighbor_var = disp_y\ \n disp_1 = disp_x\ \n disp_1_neighbor = disp_x\ \n disp_2 = disp_z\ \n disp_2_neighbor = disp_z\ \n boundary = interface\ \n [../]\ \n [./interface_Z]\ \n type = CZMInterfaceKernel\ \n disp_index = 2\ \n variable = disp_z\ \n neighbor_var = disp_z\ \n disp_1 = disp_x\ \n disp_1_neighbor = disp_x\ \n disp_2 = disp_y\ \n disp_2_neighbor = disp_y\ \n boundary = interface\ \n [../]\ \n[]\ \n[AuxKernels]\ \n [./vonMises]\ \n type = RankTwoScalarAux\ \n rank_two_tensor = stress\ \n variable = vonMises\ \n scalar_type = VonMisesStress\ \n [../]\ \n [./elastic_energy]\ \n type = ElasticEnergyAux\ \n variable = E\ \n [../]\ \n[]\ \n\ \n[UserObjects]\ \n [./CZMObject]\ \n type = Exp3DUserObject\ \n disp_x = disp_x\ \n disp_x_neighbor = disp_x\ \n disp_y = disp_y\ \n disp_y_neighbor = disp_y\ \n disp_z = disp_z\ \n disp_z_neighbor = disp_z\ \n execute_on = 'LINEAR'\ \n [../]\ \n[]\ \n\ \n[Materials] " %(MeshFile)) data.close() def CreateInputFileLower(InputFileName): data = open(InputFileName,'w+') data.write("\n [../]\ \n [./strain]\ \n #type = ComputeFiniteStrain\ \n type = ComputeSmallStrain\ \n displacements = 'disp_x disp_y disp_z'\ \n [../]\ \n [./stress]\ \n #type = ComputeFiniteStrainElasticStress\ \n type = ComputeLinearElasticStress\ \n [../]\ \n [./CZMMaterial]\ \n type = Exp3DMaterial\ \n uo_CohesiveInterface = CZMObject\ \n IsDebug = 0\ \n #outputs = exodus\ \n # output_properties = 'Damage DamageN DamageT TractionLocal DispJumpLocal'\ \n #output_properties = 'Damage Damage Area AreaElemID AreaNodeID AreaNormal'\ \n boundary = interface\ \n [../]\ \n[]\ \n\ \n[BCs]\ \n [./suy]\ \n type = PresetBC\ \n variable = disp_y\ \n value = 0.0\ \n boundary = 's'\ \n [../]\ \n [./nuy]\ \n type = PresetBC\ \n variable = disp_y\ \n value = 0.0\ \n boundary = 'n'\ \n [../]\ \n [./wux]\ \n type = PresetBC\ \n variable = disp_x\ \n value = 0.0\ \n boundary = 'w'\ \n [../]\ \n [./oux]\ \n type = FunctionPresetBC\ \n variable = disp_x\ \n function = t\ \n boundary = 'o'\ \n [../]\ \n[]\ \n\ \n[Preconditioning]\ \n [./smp]\ \n type = SMP\ \n full = true\ \n [../]\ \n[]\ \n[Executioner]\ \n type = Transient\ \n #solve_type = PJFNK\ \n solve_type = NEWTON\ \n automatic_scaling = true\ \n petsc_options_iname = '-pc_type -ksp_gmres_restart -pc_factor_mat_solver_type'\ \n petsc_options_value = ' lu 2000 superlu_dist'\ \n compute_scaling_once= true\ \n nl_rel_tol = 1e-10\ \n nl_abs_tol = 1e-09\ \n nl_max_its = 30\ \n # [./TimeStepper]\ \n # type = IterationAdaptiveDT\ \n dt= 1.0e-5\ \n # optimal_iterations = 10\ \n # growth_factor = 1.3\ \n # cutback_factor = 0.5\ \n # [../]\ \n num_steps = 10000000\ \n[]\ \n[Outputs]\ \n print_linear_residuals = true\ \n console = true\ \n csv = true\ \n interval = 3\ \n perf_graph = true\ \n [./oute]\ \n type = Exodus\ \n elemental_as_nodal = true\ \n output_material_properties = true\ \n # show_material_properties = 'Damage TractionLocal DispJumpLocal'\ \n show_material_properties = 'Damage'\ \n [../]\ \n[]\ \n# [Debug]\ \n# show_var_residual = 'disp_x disp_y disp_z'\ \n# []\ \n[Postprocessors]\ \n # [./vonMises]\ \n # type = ElementAverageValue\ \n # variable = vonMises\ \n # []\ \n [ReactionForce_front]\ \n type = NodalSum\ \n variable = 'Rx'\ \n boundary = 'o'\ \n [../]\ \n [./D0]\ \n type = SideValueIntegralPostProcessor\ \n input_value = 1.0\ \n boundary = interface\ \n [../]\ \n [./D]\ \n type = SideDamgeFractionPostProcess\ \n MateName = 'Damage'\ \n pps_name = D0\ \n boundary = interface\ \n [../]\ \n # [Elastic_Energy_sum]\ \n # type = ElementAverageValue\ \n # variable = 'E'\ \n # [../]\ \n[] ") data.close()
""" @author: b.lin@mfm.tu-darmstadt.de """ def create_input_file_upper(InputFileName, MeshFile): data = open(InputFileName, 'w+') data.write("\n[Mesh] \n type = FileMesh \n file = %s \n construct_side_list_from_node_list = true \n[] \n[MeshModifiers] \n [./interface] \n type = BreakMeshByBlock \n [../] \n[] \n \n[MeshModifiers] \n [./surface1] \n type = BoundingBoxNodeSet \n new_boundary = 's' \n bottom_left = '0 0 0' # xmin ymin zmin \n top_right = '0.4 0 0.052' #xmax ymin+a zmax \n # depends_on = 'block1' \n [../] \n [./surface2] \n type = BoundingBoxNodeSet \n new_boundary = 'w' \n bottom_left = '0 0 0' # xmin ymin zmin \n top_right = '0 0.4 0.052' # xmin+a ymax zmax \n # depends_on = 'block1' \n [../] \n [./surface3] \n type = BoundingBoxNodeSet \n new_boundary = 'n' \n bottom_left = '0.0 0.397 0.0' #xmin ymax-a zmin \n top_right = '0.4 0.4 0.052' #xmax ymax zmax \n # depends_on = 'block1' \n [../] \n [./surface4] \n type = BoundingBoxNodeSet \n new_boundary = 'o' \n bottom_left = '0.396 0.0 0.0' #xmax-a ymin+a zmin \n top_right = '0.4 0.4 0.052' #xmax ymax zmax \n # depends_on = 'block1' \n [../] \n [] \n \n[GlobalParams] \n PhiN = 3.61667e-07 #A.Kulachenko T.uesaka MoM (2012) \n PhiT = 5.044e-06 #A.Kulachenko T.uesaka MoM (2012) 3.6275 \n MaxAllowableTraction ='0.00206667 0.00646667 0.00646667' # #A.Kulachenko T.uesaka MoM (2012) \n DeltaN = 0.00035 # #A.Kulachenko T.uesaka MoM (2012) \n DeltaT = 0.00156 # #A.Kulachenko T.uesaka MoM (2012) \n C_ijkl = '100 0.33 0.33 10.72 4.2 10.72 4.35 4.35 35.97' \n[] \n \n[Variables] \n [./disp_x] \n initial_condition = 1e-15 \n [../] \n [./disp_y] \n initial_condition = 1e-15 \n [../] \n [./disp_z] \n initial_condition = 1e-15 \n [../] \n[] \n \n[AuxVariables] \n [./vonMises] \n family = MONOMIAL \n order = FIRST \n [../] \n [./Rx] \n family = LAGRANGE \n order = FIRST \n [../] \n [./Ry] \n family = LAGRANGE \n order = FIRST \n [../] \n [./Rz] \n family = LAGRANGE \n order = FIRST \n [../] \n [./E] \n family = MONOMIAL \n order = CONSTANT \n [../] \n [] \n \n[Kernels] \n [./TensorMechanics] \n displacements = 'disp_x disp_y disp_z' \n save_in = 'Rx Ry Rz' \n [../] \n[] \n \n[InterfaceKernels] \n [./interface_X] \n type = CZMInterfaceKernel \n disp_index = 0 \n variable = disp_x \n neighbor_var = disp_x \n disp_1 = disp_y \n disp_1_neighbor = disp_y \n disp_2 = disp_z \n disp_2_neighbor = disp_z \n boundary = interface \n [../] \n [./interface_Y] \n type = CZMInterfaceKernel \n disp_index = 1 \n variable = disp_y \n neighbor_var = disp_y \n disp_1 = disp_x \n disp_1_neighbor = disp_x \n disp_2 = disp_z \n disp_2_neighbor = disp_z \n boundary = interface \n [../] \n [./interface_Z] \n type = CZMInterfaceKernel \n disp_index = 2 \n variable = disp_z \n neighbor_var = disp_z \n disp_1 = disp_x \n disp_1_neighbor = disp_x \n disp_2 = disp_y \n disp_2_neighbor = disp_y \n boundary = interface \n [../] \n[] \n[AuxKernels] \n [./vonMises] \n type = RankTwoScalarAux \n rank_two_tensor = stress \n variable = vonMises \n scalar_type = VonMisesStress \n [../] \n [./elastic_energy] \n type = ElasticEnergyAux \n variable = E \n [../] \n[] \n \n[UserObjects] \n [./CZMObject] \n type = Exp3DUserObject \n disp_x = disp_x \n disp_x_neighbor = disp_x \n disp_y = disp_y \n disp_y_neighbor = disp_y \n disp_z = disp_z \n disp_z_neighbor = disp_z \n execute_on = 'LINEAR' \n [../] \n[] \n \n[Materials] " % MeshFile) data.close() def create_input_file_lower(InputFileName): data = open(InputFileName, 'w+') data.write("\n [../] \n [./strain] \n #type = ComputeFiniteStrain \n type = ComputeSmallStrain \n displacements = 'disp_x disp_y disp_z' \n [../] \n [./stress] \n #type = ComputeFiniteStrainElasticStress \n type = ComputeLinearElasticStress \n [../] \n [./CZMMaterial] \n type = Exp3DMaterial \n uo_CohesiveInterface = CZMObject \n IsDebug = 0 \n #outputs = exodus \n # output_properties = 'Damage DamageN DamageT TractionLocal DispJumpLocal' \n #output_properties = 'Damage Damage Area AreaElemID AreaNodeID AreaNormal' \n boundary = interface \n [../] \n[] \n \n[BCs] \n [./suy] \n type = PresetBC \n variable = disp_y \n value = 0.0 \n boundary = 's' \n [../] \n [./nuy] \n type = PresetBC \n variable = disp_y \n value = 0.0 \n boundary = 'n' \n [../] \n [./wux] \n type = PresetBC \n variable = disp_x \n value = 0.0 \n boundary = 'w' \n [../] \n [./oux] \n type = FunctionPresetBC \n variable = disp_x \n function = t \n boundary = 'o' \n [../] \n[] \n \n[Preconditioning] \n [./smp] \n type = SMP \n full = true \n [../] \n[] \n[Executioner] \n type = Transient \n #solve_type = PJFNK \n solve_type = NEWTON \n automatic_scaling = true \n petsc_options_iname = '-pc_type -ksp_gmres_restart -pc_factor_mat_solver_type' \n petsc_options_value = ' lu 2000 superlu_dist' \n compute_scaling_once= true \n nl_rel_tol = 1e-10 \n nl_abs_tol = 1e-09 \n nl_max_its = 30 \n # [./TimeStepper] \n # type = IterationAdaptiveDT \n dt= 1.0e-5 \n # optimal_iterations = 10 \n # growth_factor = 1.3 \n # cutback_factor = 0.5 \n # [../] \n num_steps = 10000000 \n[] \n[Outputs] \n print_linear_residuals = true \n console = true \n csv = true \n interval = 3 \n perf_graph = true \n [./oute] \n type = Exodus \n elemental_as_nodal = true \n output_material_properties = true \n # show_material_properties = 'Damage TractionLocal DispJumpLocal' \n show_material_properties = 'Damage' \n [../] \n[] \n# [Debug] \n# show_var_residual = 'disp_x disp_y disp_z' \n# [] \n[Postprocessors] \n # [./vonMises] \n # type = ElementAverageValue \n # variable = vonMises \n # [] \n [ReactionForce_front] \n type = NodalSum \n variable = 'Rx' \n boundary = 'o' \n [../] \n [./D0] \n type = SideValueIntegralPostProcessor \n input_value = 1.0 \n boundary = interface \n [../] \n [./D] \n type = SideDamgeFractionPostProcess \n MateName = 'Damage' \n pps_name = D0 \n boundary = interface \n [../] \n # [Elastic_Energy_sum] \n # type = ElementAverageValue \n # variable = 'E' \n # [../] \n[] ") data.close()
def setup(): size(500,500) smooth() background(255) noStroke() colorMode(HSB) flug = True def draw(): global flug if(flug): for i in range(0,10): for j in range(0,5): fill (10, random (0, 255) , random (10, 250)) rect(j*40+50 , i*40+50 , 35, 35) rect ((10 -j)*40+10 , i*40+50 , 35, 35) def mouseClicked(): global flug flug=not flug
def setup(): size(500, 500) smooth() background(255) no_stroke() color_mode(HSB) flug = True def draw(): global flug if flug: for i in range(0, 10): for j in range(0, 5): fill(10, random(0, 255), random(10, 250)) rect(j * 40 + 50, i * 40 + 50, 35, 35) rect((10 - j) * 40 + 10, i * 40 + 50, 35, 35) def mouse_clicked(): global flug flug = not flug
class Vertex: def __init__(self): self.stime = None self.etime = None self.colour = "U" self.pred = None self.next = None class Node: def __init__(self, k): self.val = k self.next = None class edge: def __init__(self, v1, v2): self.e1 = v1 self.e2 = v2 L = [] TE = [] BE = [] FE = [] CE = [] E = [] def main(): n = int(input("Enter number of vertices:")) for i in range(n): L.append(Vertex()) # M=[[0 for i in range(0,n)]for j in range(0,n)] e = int(input("Enter number of edges:")) print("Enter the edges:") for i in range(0, e): v1, v2 = input().split() v1, v2 = int(v1), int(v2) N1 = Node(v1) E.append(edge(v1, v2)) tmp = L[v1].next tmp2 = L[v1] while tmp != None: if (not tmp.next) or tmp.next.val > N1.val: N1.next = tmp2.next tmp2.next = N1 break tmp2 = tmp2.next tmp = tmp.next for i in range(len(L)): tmp = L[i].next while tmp != None: print(tmp.val) tmp = tmp.next # N2=Node(v2) """if L[v1].next==None: L[v1].next=N2 else: tmp=L[v1].next N2.next=tmp L[v1].next=N2""" """if L[v2].next==None: L[v2].next=N1 else: tmp=L[v2].next N1.next=tmp L[v2].next=N1""" s = int(input("Enter the source vertex:")) DFS(s) for i in range(n): print("Vertex:", i, "Time:[", L[i].stime, ",", L[i].etime, "]") print("Tree edges:") for i in range(len(TE)): print(TE[i].e1, " ", TE[i].e2) time = 0 def DFS(u): global time time = time + 1 # print(time) L[u].stime = time L[u].colour = "V" tmp = L[u].next while tmp != None: if L[tmp.val].colour == "U": TE.append(edge(u, tmp.val)) DFS(tmp.val) L[tmp.val].pred = u elif L[tmp.val].colour == "E": CE.append(edge(u, tmp.value)) tmp = tmp.next L[u].colour = "E" time = time + 1 # print(time) L[u].etime = time if __name__ == '__main__': main()
class Vertex: def __init__(self): self.stime = None self.etime = None self.colour = 'U' self.pred = None self.next = None class Node: def __init__(self, k): self.val = k self.next = None class Edge: def __init__(self, v1, v2): self.e1 = v1 self.e2 = v2 l = [] te = [] be = [] fe = [] ce = [] e = [] def main(): n = int(input('Enter number of vertices:')) for i in range(n): L.append(vertex()) e = int(input('Enter number of edges:')) print('Enter the edges:') for i in range(0, e): (v1, v2) = input().split() (v1, v2) = (int(v1), int(v2)) n1 = node(v1) E.append(edge(v1, v2)) tmp = L[v1].next tmp2 = L[v1] while tmp != None: if not tmp.next or tmp.next.val > N1.val: N1.next = tmp2.next tmp2.next = N1 break tmp2 = tmp2.next tmp = tmp.next for i in range(len(L)): tmp = L[i].next while tmp != None: print(tmp.val) tmp = tmp.next 'if L[v1].next==None:\n L[v1].next=N2\n else:\n tmp=L[v1].next\n N2.next=tmp\n L[v1].next=N2' 'if L[v2].next==None:\n L[v2].next=N1\n else:\n tmp=L[v2].next\n N1.next=tmp\n L[v2].next=N1' s = int(input('Enter the source vertex:')) dfs(s) for i in range(n): print('Vertex:', i, 'Time:[', L[i].stime, ',', L[i].etime, ']') print('Tree edges:') for i in range(len(TE)): print(TE[i].e1, ' ', TE[i].e2) time = 0 def dfs(u): global time time = time + 1 L[u].stime = time L[u].colour = 'V' tmp = L[u].next while tmp != None: if L[tmp.val].colour == 'U': TE.append(edge(u, tmp.val)) dfs(tmp.val) L[tmp.val].pred = u elif L[tmp.val].colour == 'E': CE.append(edge(u, tmp.value)) tmp = tmp.next L[u].colour = 'E' time = time + 1 L[u].etime = time if __name__ == '__main__': main()
# # Copyright 2019-2020 VMware, Inc. # # SPDX-License-Identifier: BSD-2-Clause # # Flask configurations DEBUG = True # Application configurations OBJECT_STORE_HTTPS_ENABLED = False
debug = True object_store_https_enabled = False
class FlockAIController: def __init__(self): pass def run(self): pass
class Flockaicontroller: def __init__(self): pass def run(self): pass
class BaseError(Exception): """Base Error Management All custom error exception should inherit from this class. This base exception only handle error message. """ def __init__(self): self._message = None @property def message(self): return self._message class ContainerError(BaseError): """Error Container Custom exception to trigger an error when some application not implement Core.Container abstract class. """ def __init__(self, app_name): BaseError.__init__(self) self._message = "ContainerError: Cannot use {} as container application".format(app_name) self._app_name = app_name Exception.__init__(self, self._message) @property def app_name(self): return self._app_name class ComponentError(BaseError): """Error Component Should be triggered when cannot initialize component object, or given component object is not instance from Component abstract class. """ def __init__(self, com_name): BaseError.__init__(self) self._message = "ComponentError: Cannot use {} as component object".format(com_name) class DotenvNotAvailableError(BaseError): """Error Dotenv Custom exception should be triggered when dotenv file not found. """ def __init__(self): BaseError.__init__(self) self._message = 'Unable to load environment file.' class UnknownEnvError(BaseError): """Error Unknown Environment Name Custom exception that should be triggered when system try to load all environment variables from unspecified environment name. """ def __init__(self, name=None): BaseError.__init__(self) self._message = 'Unknown environment name: {}.'.format(name)
class Baseerror(Exception): """Base Error Management All custom error exception should inherit from this class. This base exception only handle error message. """ def __init__(self): self._message = None @property def message(self): return self._message class Containererror(BaseError): """Error Container Custom exception to trigger an error when some application not implement Core.Container abstract class. """ def __init__(self, app_name): BaseError.__init__(self) self._message = 'ContainerError: Cannot use {} as container application'.format(app_name) self._app_name = app_name Exception.__init__(self, self._message) @property def app_name(self): return self._app_name class Componenterror(BaseError): """Error Component Should be triggered when cannot initialize component object, or given component object is not instance from Component abstract class. """ def __init__(self, com_name): BaseError.__init__(self) self._message = 'ComponentError: Cannot use {} as component object'.format(com_name) class Dotenvnotavailableerror(BaseError): """Error Dotenv Custom exception should be triggered when dotenv file not found. """ def __init__(self): BaseError.__init__(self) self._message = 'Unable to load environment file.' class Unknownenverror(BaseError): """Error Unknown Environment Name Custom exception that should be triggered when system try to load all environment variables from unspecified environment name. """ def __init__(self, name=None): BaseError.__init__(self) self._message = 'Unknown environment name: {}.'.format(name)
#!/usr/bin/python3 # --- 001 > U5W2P1_Task11_w1 def solution( a, b ): input = [a, b] larger = -float('inf') for x in input: if(larger < x): larger = x return larger if __name__ == "__main__": print('----------start------------') a = 1510 b = 7043 print(solution( a, b)) print('------------end------------')
def solution(a, b): input = [a, b] larger = -float('inf') for x in input: if larger < x: larger = x return larger if __name__ == '__main__': print('----------start------------') a = 1510 b = 7043 print(solution(a, b)) print('------------end------------')
def get_converter_type_any(*args, **kwargs): """ Handle converter type "any" :param args: :param kwargs: :return: return schema dict """ schema = { 'type': 'array', 'items': { 'type': 'string', 'enum': args, } } return schema def get_converter_type_int(*args, **kwargs): """ Handle converter type "int" :param args: :param kwargs: :return: return schema dict """ schema = { 'type': 'integer', 'format': 'int32', } if 'max' in kwargs: schema['maximum'] = kwargs['max'] if 'min' in kwargs: schema['minimum'] = kwargs['min'] return schema def get_converter_type_float(*args, **kwargs): """ Handle converter type "float" :param args: :param kwargs: :return: return schema dict """ schema = { 'type': 'number', 'format': 'float', } return schema def get_converter_type_uuid(*args, **kwargs): """ Handle converter type "uuid" :param args: :param kwargs: :return: return schema dict """ schema = { 'type': 'string', 'format': 'uuid', } return schema def get_converter_type_path(*args, **kwargs): """ Handle converter type "path" :param args: :param kwargs: :return: return schema dict """ schema = { 'type': 'string', 'format': 'path', } return schema def get_converter_type_string(*args, **kwargs): """ Handle converter type "string" :param args: :param kwargs: :return: return schema dict """ schema = { 'type': 'string', } for prop in ['length', 'maxLength', 'minLength']: if prop in kwargs: schema[prop] = kwargs[prop] return schema def get_converter_type_default(*args, **kwargs): """ Handle converter type "default" :param args: :param kwargs: :return: return schema dict """ schema = {'type': 'string'} return schema
def get_converter_type_any(*args, **kwargs): """ Handle converter type "any" :param args: :param kwargs: :return: return schema dict """ schema = {'type': 'array', 'items': {'type': 'string', 'enum': args}} return schema def get_converter_type_int(*args, **kwargs): """ Handle converter type "int" :param args: :param kwargs: :return: return schema dict """ schema = {'type': 'integer', 'format': 'int32'} if 'max' in kwargs: schema['maximum'] = kwargs['max'] if 'min' in kwargs: schema['minimum'] = kwargs['min'] return schema def get_converter_type_float(*args, **kwargs): """ Handle converter type "float" :param args: :param kwargs: :return: return schema dict """ schema = {'type': 'number', 'format': 'float'} return schema def get_converter_type_uuid(*args, **kwargs): """ Handle converter type "uuid" :param args: :param kwargs: :return: return schema dict """ schema = {'type': 'string', 'format': 'uuid'} return schema def get_converter_type_path(*args, **kwargs): """ Handle converter type "path" :param args: :param kwargs: :return: return schema dict """ schema = {'type': 'string', 'format': 'path'} return schema def get_converter_type_string(*args, **kwargs): """ Handle converter type "string" :param args: :param kwargs: :return: return schema dict """ schema = {'type': 'string'} for prop in ['length', 'maxLength', 'minLength']: if prop in kwargs: schema[prop] = kwargs[prop] return schema def get_converter_type_default(*args, **kwargs): """ Handle converter type "default" :param args: :param kwargs: :return: return schema dict """ schema = {'type': 'string'} return schema
# on test start def enbale(instance): return False def action(instance): pass
def enbale(instance): return False def action(instance): pass
TUNSETIFF = 0x400454ca IFF_TUN = 0x0001 IFACE_IP = "10.1.2.1/24" MTU = 65000 ServerIP = "199.230.109.242" debug = True updateSeqno = 105 Runloc = "/home/icmp/"
tunsetiff = 1074025674 iff_tun = 1 iface_ip = '10.1.2.1/24' mtu = 65000 server_ip = '199.230.109.242' debug = True update_seqno = 105 runloc = '/home/icmp/'
class Slides_Menu(): def Slides_Menu_Active(self,paths,subdir): cgipaths=self.Slides_CGI_Paths() rpaths=list(paths) rpaths.append(subdir) res=False if ( len(cgipaths)>len(paths) ): res=True for i in range( len(rpaths) ): if ( rpaths[i]!=cgipaths[i]): res=False return res def Slides_Menu_Path(self,paths): return "/".join([self.DocRoot]+paths) def Slides_Menu_Pre(self,paths): paths=self.Slides_CGI_Paths() paths.pop() html=[] rpaths=[] for path in paths: html=html+[ self.Slide_Menu_Entry_Title_A(rpaths), ] rpaths.append(path) return self.HTML_List(html)+[self.BR()] def Slides_Menu(self,paths): url="/".join(paths) cssclass="leftmenu" htmllist=[] path="/".join([self.DocRoot]+paths) subdirs=self.Path_Dirs( self.Slides_Menu_Path(paths), "Name.html" ) for subdir in subdirs: htmlitem=[] if (self.Slides_Menu_Active(paths,subdir)): rpaths=list(paths) rpaths.append(subdir) htmlitem=self.Slides_Menu(rpaths) else: htmlitem=self.Slide_SubMenu_Entry(subdir,paths,cssclass) htmllist.append(htmlitem) html=[] html=html+[ self.Slide_Menu_Entry(paths,cssclass) ] html=html+[ self.HTML_List( htmllist, "UL", { "style": 'list-style-type:square', } ) ] return html def Slide_Menu_Entry(self,paths,cssclass): cpath=self.CGI_POST("Path") path="/".join(paths) name=self.Slide_Name_Get(paths) if (path==cpath): return self.B( name+"*", { "title": self.Slide_Title_Get(paths), } ) return [ #Moved to Slide_Menu_Pre self.Slide_Menu_Entry_Title_A(paths,name,cssclass) ] def Slide_Menu_Entry_Title_A(self,paths,name=None,cssclass=None): if (name==None): name=self.Slide_Name_Get(paths) if (cssclass==None): cssclass="leftmenu" return self.A( "?Path="+"/".join(paths), name, { "class": cssclass, "title": self.Slide_Title_Get(paths), } )
class Slides_Menu: def slides__menu__active(self, paths, subdir): cgipaths = self.Slides_CGI_Paths() rpaths = list(paths) rpaths.append(subdir) res = False if len(cgipaths) > len(paths): res = True for i in range(len(rpaths)): if rpaths[i] != cgipaths[i]: res = False return res def slides__menu__path(self, paths): return '/'.join([self.DocRoot] + paths) def slides__menu__pre(self, paths): paths = self.Slides_CGI_Paths() paths.pop() html = [] rpaths = [] for path in paths: html = html + [self.Slide_Menu_Entry_Title_A(rpaths)] rpaths.append(path) return self.HTML_List(html) + [self.BR()] def slides__menu(self, paths): url = '/'.join(paths) cssclass = 'leftmenu' htmllist = [] path = '/'.join([self.DocRoot] + paths) subdirs = self.Path_Dirs(self.Slides_Menu_Path(paths), 'Name.html') for subdir in subdirs: htmlitem = [] if self.Slides_Menu_Active(paths, subdir): rpaths = list(paths) rpaths.append(subdir) htmlitem = self.Slides_Menu(rpaths) else: htmlitem = self.Slide_SubMenu_Entry(subdir, paths, cssclass) htmllist.append(htmlitem) html = [] html = html + [self.Slide_Menu_Entry(paths, cssclass)] html = html + [self.HTML_List(htmllist, 'UL', {'style': 'list-style-type:square'})] return html def slide__menu__entry(self, paths, cssclass): cpath = self.CGI_POST('Path') path = '/'.join(paths) name = self.Slide_Name_Get(paths) if path == cpath: return self.B(name + '*', {'title': self.Slide_Title_Get(paths)}) return [self.Slide_Menu_Entry_Title_A(paths, name, cssclass)] def slide__menu__entry__title_a(self, paths, name=None, cssclass=None): if name == None: name = self.Slide_Name_Get(paths) if cssclass == None: cssclass = 'leftmenu' return self.A('?Path=' + '/'.join(paths), name, {'class': cssclass, 'title': self.Slide_Title_Get(paths)})
class Solution: def reorderSpaces(self, text: str) -> str: spaces = text.count(" ") words = [w for w in text.split(" ") if w] l = len(words) if l == 1: return words[0] + " " * spaces each, remaining = divmod(spaces, l - 1) return (" " * each).join(words) + (" " * remaining)
class Solution: def reorder_spaces(self, text: str) -> str: spaces = text.count(' ') words = [w for w in text.split(' ') if w] l = len(words) if l == 1: return words[0] + ' ' * spaces (each, remaining) = divmod(spaces, l - 1) return (' ' * each).join(words) + ' ' * remaining
{ 'targets': [ { 'target_name': 'freetype2', 'dependencies': [ 'gyp/libfreetype.gyp:libfreetype' ], 'sources': [ 'src/freetype2.cc', 'src/fontface.cc' ], "include_dirs" : [ "<!(node -e \"require('nan')\")" ], } ] }
{'targets': [{'target_name': 'freetype2', 'dependencies': ['gyp/libfreetype.gyp:libfreetype'], 'sources': ['src/freetype2.cc', 'src/fontface.cc'], 'include_dirs': ['<!(node -e "require(\'nan\')")']}]}
class Solution: def findRestaurant(self, list1: List[str], list2: List[str]) -> List[str]: d = {} matches = {} for i, name in enumerate(list1): d[name] = i for i, name in enumerate(list2): if name in d: matches[name] = i + d[name] l = sorted(matches.items(), key = lambda x:x[1]) ans = [] for (res, sm) in l: if sm == l[0][1]: ans.append(res) return ans
class Solution: def find_restaurant(self, list1: List[str], list2: List[str]) -> List[str]: d = {} matches = {} for (i, name) in enumerate(list1): d[name] = i for (i, name) in enumerate(list2): if name in d: matches[name] = i + d[name] l = sorted(matches.items(), key=lambda x: x[1]) ans = [] for (res, sm) in l: if sm == l[0][1]: ans.append(res) return ans
bakeQty = int(input()) bakeCapacity = int(input()) CurniEatOnHour = int(input()) GanioEatOnHour = int(input()) hours = int(input()) productivityOnHour = bakeCapacity-CurniEatOnHour-GanioEatOnHour if productivityOnHour*hours>=bakeQty: print('YES') else: print('NO-',"{:.0f}".format(bakeQty-productivityOnHour*hours))
bake_qty = int(input()) bake_capacity = int(input()) curni_eat_on_hour = int(input()) ganio_eat_on_hour = int(input()) hours = int(input()) productivity_on_hour = bakeCapacity - CurniEatOnHour - GanioEatOnHour if productivityOnHour * hours >= bakeQty: print('YES') else: print('NO-', '{:.0f}'.format(bakeQty - productivityOnHour * hours))
# -*- coding: utf-8 -*- """ Created on Fri Jul 12 19:36:35 2019 @author: Rob """ # Find how many times throughout the show each Friend is saying name # of some other Friend # Include nicknames: Pheebs, Rach, Mon, Joseph, # Create nested dictionary with a Friend and for each friend # place how many times they are saying name of other Friends # Each key -- Friend name, should have subdictionary with # other Friend names keys and for each of them value will # be a list of the counts how many times per episode # they were called by key Friend. def friend_mentions(): """ Returns: Nested dictionary. """ name_mentiones = { 'Monica' : (), 'Rachel' : (), 'Ross' : (), 'Joey' : (), 'Phoebe' : (), 'Chandler': () } return name_mentiones # Who was the most featured in the beginning in each episode # Find counts of Friends names before the Openning Credits # (Openning title); in a file def episode_intro(): intro_count = [] opening_credits = '**Opening Credits**' for i, each_ep in enumerate(all_episodes_in_a_season_txt): # There are plenty formatings for "Opening Credits", fine all of them and replace them with the most used ones replace_each_ep = each_ep.replace('### Opening Credits', opening_credits).replace('Opening Credits**', opening_credits).replace('**OPENING TITLES**', opening_credits).replace('OPENING TITLES', opening_credits).replace('## Credits', opening_credits).replace('OPENING CREDITS', opening_credits).replace('Opening Credits', opening_credits).replace('**Opening credits.**', opening_credits).replace('Opening credits', opening_credits).replace('OPENING SEQUENCE',opening_credits) # Check if the phrase "**Opening Credits**" is in the text if '**Opening Credits**' not in replace_each_ep: print(i) get_intro = replace_each_ep.split('**Opening Credits**')[0] # Remove text within [] and () brackets. These lines are scene description. one_intro_tmp = re.sub( "\[[^\]]*\]", "", get_intro) # Removes [] intro_clear = re.sub('\([^)]*\)', "",one_intro_tmp) # Removes () intro_count.append(intro_clear) print(intro_count[225][0:2600]) print(len(intro_count)) return intro_count # Find how many times the scenes are in the Central Perk # How many times the scene before openning credits in in Central Perk # Scenes are not always placed in text - locate ep. without that def scene_central_perk(): counts_central_perk = [] counts_central_perk_openning = [] return counts_central_perk, counts_central_perk_openning # Divide every episode into scenes and find which of Friends are # the most frequent featured in scenes together def frequently_together(): return # Find lines, apearance of Janice throughout the series # Make her cloudword # Count how many times she says "Oh My God" def janice(): return ################################################## ########### Handle the functions ################# ################################################## if __name__ == "__main__": intro = episode_intro()
""" Created on Fri Jul 12 19:36:35 2019 @author: Rob """ def friend_mentions(): """ Returns: Nested dictionary. """ name_mentiones = {'Monica': (), 'Rachel': (), 'Ross': (), 'Joey': (), 'Phoebe': (), 'Chandler': ()} return name_mentiones def episode_intro(): intro_count = [] opening_credits = '**Opening Credits**' for (i, each_ep) in enumerate(all_episodes_in_a_season_txt): replace_each_ep = each_ep.replace('### Opening Credits', opening_credits).replace('Opening Credits**', opening_credits).replace('**OPENING TITLES**', opening_credits).replace('OPENING TITLES', opening_credits).replace('## Credits', opening_credits).replace('OPENING CREDITS', opening_credits).replace('Opening Credits', opening_credits).replace('**Opening credits.**', opening_credits).replace('Opening credits', opening_credits).replace('OPENING SEQUENCE', opening_credits) if '**Opening Credits**' not in replace_each_ep: print(i) get_intro = replace_each_ep.split('**Opening Credits**')[0] one_intro_tmp = re.sub('\\[[^\\]]*\\]', '', get_intro) intro_clear = re.sub('\\([^)]*\\)', '', one_intro_tmp) intro_count.append(intro_clear) print(intro_count[225][0:2600]) print(len(intro_count)) return intro_count def scene_central_perk(): counts_central_perk = [] counts_central_perk_openning = [] return (counts_central_perk, counts_central_perk_openning) def frequently_together(): return def janice(): return if __name__ == '__main__': intro = episode_intro()
weight_list=[] price_list=[] def knapsack(capacity,weight_list,price_list): x=list(range(len(price_list))) ratio=[v/w for v,w in zip(price_list,weight_list)] x.sort(key=lambda i:ratio[i],reverse=True) Maximum_profit=0 for i in x: if(weight_list[i]<=capacity): Maximum_profit+=price_list[i] capacity-=weight_list[i] else: Maximum_profit+=(price_list[i]*capacity)/weight_list[i] break return Maximum_profit n=int(input("Enter how many number of object available in market:")) print("Enter weight of object:") for i in range(0,n): item1=int(input()) weight_list.append(item1) print("Enter price:") for i in range(0,n): item2=int(input()) price_list.append(item2) print("Entered profit:",weight_list) print("Entered price list of objects:",price_list) capacity=int(input("Enter capacity of the bag:")) Maximum_profit=knapsack(capacity,weight_list,price_list) print("Maximum profit obtaind:",Maximum_profit)
weight_list = [] price_list = [] def knapsack(capacity, weight_list, price_list): x = list(range(len(price_list))) ratio = [v / w for (v, w) in zip(price_list, weight_list)] x.sort(key=lambda i: ratio[i], reverse=True) maximum_profit = 0 for i in x: if weight_list[i] <= capacity: maximum_profit += price_list[i] capacity -= weight_list[i] else: maximum_profit += price_list[i] * capacity / weight_list[i] break return Maximum_profit n = int(input('Enter how many number of object available in market:')) print('Enter weight of object:') for i in range(0, n): item1 = int(input()) weight_list.append(item1) print('Enter price:') for i in range(0, n): item2 = int(input()) price_list.append(item2) print('Entered profit:', weight_list) print('Entered price list of objects:', price_list) capacity = int(input('Enter capacity of the bag:')) maximum_profit = knapsack(capacity, weight_list, price_list) print('Maximum profit obtaind:', Maximum_profit)
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Aug 27 22:37:42 2018 @author: owen """
""" Created on Mon Aug 27 22:37:42 2018 @author: owen """
############################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ############################################################################### def get_permutation_config(n_dims): input_perm_axes = [0, n_dims + 1] + list(range(1, n_dims + 1)) output_perm_axes = [0] + list(range(2, n_dims + 2)) + [1] return input_perm_axes, output_perm_axes
def get_permutation_config(n_dims): input_perm_axes = [0, n_dims + 1] + list(range(1, n_dims + 1)) output_perm_axes = [0] + list(range(2, n_dims + 2)) + [1] return (input_perm_axes, output_perm_axes)
testcases = int(input()) for t in range(testcases): rounds = int(input()) chef_points = 0 morty_points = 0 for round in range(rounds): chef, morty = list(map(int, input().split())) chef_sum = 0 morty_sum = 0 while(chef != 0): r = int(chef % 10) chef = int(chef / 10) chef_sum += r while(morty != 0): r = int(morty % 10) morty = int(morty / 10) morty_sum += r if(chef_sum > morty_sum): chef_points += 1 #print(str(0) + " " + str(chef_sum)) elif(chef_sum < morty_sum): morty_points += 1 #print(str(1) + " " + str(morty_sum)) else: chef_points += 1 morty_points += 1 #print(str(2) + " " + str(morty_sum)) print('0 ' + str(chef_points) if chef_points > morty_points else '1 ' + str(morty_points) if chef_points < morty_points else '2 ' + str(morty_points))
testcases = int(input()) for t in range(testcases): rounds = int(input()) chef_points = 0 morty_points = 0 for round in range(rounds): (chef, morty) = list(map(int, input().split())) chef_sum = 0 morty_sum = 0 while chef != 0: r = int(chef % 10) chef = int(chef / 10) chef_sum += r while morty != 0: r = int(morty % 10) morty = int(morty / 10) morty_sum += r if chef_sum > morty_sum: chef_points += 1 elif chef_sum < morty_sum: morty_points += 1 else: chef_points += 1 morty_points += 1 print('0 ' + str(chef_points) if chef_points > morty_points else '1 ' + str(morty_points) if chef_points < morty_points else '2 ' + str(morty_points))
class Solution: def fizzBuzz(self, n: int) -> List[str]: d = {3: 'Fizz', 5: 'Buzz'} return [''.join([d[k] for k in d if i % k == 0]) or str(i) for i in range(1, n + 1)]
class Solution: def fizz_buzz(self, n: int) -> List[str]: d = {3: 'Fizz', 5: 'Buzz'} return [''.join([d[k] for k in d if i % k == 0]) or str(i) for i in range(1, n + 1)]
print(0) # 0 print(-0) # 0 print(0 == -0) # True print(0 is -0) # True print(0.0) # 0.0 print(-0.0) # -0.0 print(0.0 == -0.0) # True print(0.0 is -0.0) # False
print(0) print(-0) print(0 == -0) print(0 is -0) print(0.0) print(-0.0) print(0.0 == -0.0) print(0.0 is -0.0)
""" Write a function that takes a string as input and reverse only the vowels of a string. Example: Input: "hello" Output: "holle" Example: Input: "leetcode" Output: "leotcede" Note: - The vowels does not include the letter "y". """ #Difficulty: Easy #481 / 481 test cases passed. #Runtime: 48 ms #Memory Usage: 14.8 MB #Runtime: 48 ms, faster than 92.51% of Python3 online submissions for Reverse Vowels of a String. #Memory Usage: 14.8 MB, less than 61.15% of Python3 online submissions for Reverse Vowels of a String class Solution: def reverseVowels(self, s: str) -> str: s = list(s) i = 0 l = len(s) - 1 #vowels = 'aAeEiIoOuU' vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'} while i < l: if s[i] in vowels: while s[l] not in vowels: l -= 1 if i < l: s[i], s[l] = s[l], s[i] i += 1 l -= 1 continue i += 1 return ''.join(s)
""" Write a function that takes a string as input and reverse only the vowels of a string. Example: Input: "hello" Output: "holle" Example: Input: "leetcode" Output: "leotcede" Note: - The vowels does not include the letter "y". """ class Solution: def reverse_vowels(self, s: str) -> str: s = list(s) i = 0 l = len(s) - 1 vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'} while i < l: if s[i] in vowels: while s[l] not in vowels: l -= 1 if i < l: (s[i], s[l]) = (s[l], s[i]) i += 1 l -= 1 continue i += 1 return ''.join(s)
def update_param(name, param): if name == 'distribution': param['values'].remove('custom') return param return None # param untouched def class_extensions(): @property def Lambda(self): """DEPRECATED. Use ``self.lambda_`` instead""" return self._parms["lambda"] if "lambda" in self._parms else None @Lambda.setter def Lambda(self, value): self._parms["lambda"] = value extensions = dict( __imports__="""import h2o""", __class__=class_extensions, __init__validation=""" if "Lambda" in kwargs: kwargs["lambda_"] = kwargs.pop("Lambda") """ ) overrides = dict( alpha=dict( setter=""" # For `alpha` and `lambda` the server reports type float[], while in practice simple floats are also ok assert_is_type({pname}, None, numeric, [numeric]) self._parms["{sname}"] = {pname} """ ), lambda_=dict( setter=""" assert_is_type({pname}, None, numeric, [numeric]) self._parms["{sname}"] = {pname} """ ), ) doc = dict( __class__=""" Fits a generalized additive model, specified by a response variable, a set of predictors, and a description of the error distribution. A subclass of :class:`ModelBase` is returned. The specific subclass depends on the machine learning task at hand (if it's binomial classification, then an H2OBinomialModel is returned, if it's regression then a H2ORegressionModel is returned). The default print-out of the models is shown, but further GAM-specific information can be queried out of the object. Upon completion of the GAM, the resulting object has coefficients, normalized coefficients, residual/null deviance, aic, and a host of model metrics including MSE, AUC (for logistic regression), degrees of freedom, and confusion matrices. """ )
def update_param(name, param): if name == 'distribution': param['values'].remove('custom') return param return None def class_extensions(): @property def lambda(self): """DEPRECATED. Use ``self.lambda_`` instead""" return self._parms['lambda'] if 'lambda' in self._parms else None @Lambda.setter def lambda(self, value): self._parms['lambda'] = value extensions = dict(__imports__='import h2o', __class__=class_extensions, __init__validation='\nif "Lambda" in kwargs: kwargs["lambda_"] = kwargs.pop("Lambda")\n') overrides = dict(alpha=dict(setter='\n# For `alpha` and `lambda` the server reports type float[], while in practice simple floats are also ok\nassert_is_type({pname}, None, numeric, [numeric])\nself._parms["{sname}"] = {pname}\n'), lambda_=dict(setter='\nassert_is_type({pname}, None, numeric, [numeric])\nself._parms["{sname}"] = {pname}\n')) doc = dict(__class__="\nFits a generalized additive model, specified by a response variable, a set of predictors, and a\ndescription of the error distribution.\n\nA subclass of :class:`ModelBase` is returned. The specific subclass depends on the machine learning task\nat hand (if it's binomial classification, then an H2OBinomialModel is returned, if it's regression then a\nH2ORegressionModel is returned). The default print-out of the models is shown, but further GAM-specific\ninformation can be queried out of the object. Upon completion of the GAM, the resulting object has\ncoefficients, normalized coefficients, residual/null deviance, aic, and a host of model metrics including\nMSE, AUC (for logistic regression), degrees of freedom, and confusion matrices.\n")
""" Day 01 - Solution 01 Puzzle input as file to read. """ def main() -> None: """ Call the functions and display. """ expense_list = import_list() print(f"Part 1: {find_sum_two(expense_list)}") print(f"Part 2: {find_sum_three(expense_list)}") def import_list() -> list: """ Read file and return list. :return: List of integers :rtype: list """ file = open("../puzzle-input", "r") string_list = list(file.readlines()) int_list = [int(i) for i in map(str.strip, string_list)] file.close() return int_list def find_sum_two(expenses: list, total=2020) -> int: """ Iterate over the list and subtract from total value. :param expenses: List of integers :param total: Total value :return: Product of two values :rtype: int """ for first in expenses: second = total - first if second in expenses: return first * second raise ValueError("Not solvable") def find_sum_three(expenses: list) -> int: """ Attempt every calculation while iterating over list to find third entry. :param expenses: List of integers :return: Product of three values :rtype: int """ while expenses: selected = expenses.pop() remainder = 2020 - selected try: return selected * find_sum_two(expenses, total=remainder) except ValueError: continue if __name__ == "__main__": main()
""" Day 01 - Solution 01 Puzzle input as file to read. """ def main() -> None: """ Call the functions and display. """ expense_list = import_list() print(f'Part 1: {find_sum_two(expense_list)}') print(f'Part 2: {find_sum_three(expense_list)}') def import_list() -> list: """ Read file and return list. :return: List of integers :rtype: list """ file = open('../puzzle-input', 'r') string_list = list(file.readlines()) int_list = [int(i) for i in map(str.strip, string_list)] file.close() return int_list def find_sum_two(expenses: list, total=2020) -> int: """ Iterate over the list and subtract from total value. :param expenses: List of integers :param total: Total value :return: Product of two values :rtype: int """ for first in expenses: second = total - first if second in expenses: return first * second raise value_error('Not solvable') def find_sum_three(expenses: list) -> int: """ Attempt every calculation while iterating over list to find third entry. :param expenses: List of integers :return: Product of three values :rtype: int """ while expenses: selected = expenses.pop() remainder = 2020 - selected try: return selected * find_sum_two(expenses, total=remainder) except ValueError: continue if __name__ == '__main__': main()
#!/usr/bin/env python # encoding: utf-8 # @author: Zhipeng Ye # @contact: Zhipeng.ye19@xjtlu.edu.cn # @file: permutation.py # @time: 2020-03-18 22:46 # @desc: def permute(nums): paths = [] def record_path(path,nums_copy): if len(nums_copy) ==1: path.append(nums_copy[0]) paths.append(path) return for i in range(len(nums_copy)): path = path[:] path.append(nums_copy[i]) nums_copy_copy = nums_copy[:] del(nums_copy_copy[i]) record_path(path,nums_copy_copy) record_path([],nums) print(paths) permute([1,2,3])
def permute(nums): paths = [] def record_path(path, nums_copy): if len(nums_copy) == 1: path.append(nums_copy[0]) paths.append(path) return for i in range(len(nums_copy)): path = path[:] path.append(nums_copy[i]) nums_copy_copy = nums_copy[:] del nums_copy_copy[i] record_path(path, nums_copy_copy) record_path([], nums) print(paths) permute([1, 2, 3])
"""The code template to supply to the front end. This is what the user will be asked to complete and submit for grading. Do not include any imports. This is not a REPL environment so include explicit 'print' statements for any outputs you want to be displayed back to the user. Use triple single quotes to enclose the formatted code block. """ challenge_code = '''k_bits = 2 n_bits = 2 all_bits = k_bits + n_bits aux = range(k_bits) main = range(k_bits, all_bits) dev = qml.device("default.qubit", wires=all_bits) def PREPARE(alpha_list): """Create the PREPARE oracle as a matrix. Args: alpha_list (array[float]): A list of coefficients. Returns: array[complex]: The matrix representation of the PREPARE routine. """ zero_vec = np.array([1] + [0]*(2**k_bits - 1)) ################## # YOUR CODE HERE # ################## '''
"""The code template to supply to the front end. This is what the user will be asked to complete and submit for grading. Do not include any imports. This is not a REPL environment so include explicit 'print' statements for any outputs you want to be displayed back to the user. Use triple single quotes to enclose the formatted code block. """ challenge_code = 'k_bits = 2\nn_bits = 2\nall_bits = k_bits + n_bits\naux = range(k_bits)\nmain = range(k_bits, all_bits)\ndev = qml.device("default.qubit", wires=all_bits)\n\ndef PREPARE(alpha_list):\n """Create the PREPARE oracle as a matrix.\n \n Args:\n alpha_list (array[float]): A list of coefficients.\n\n Returns: \n array[complex]: The matrix representation of the PREPARE routine.\n """\n zero_vec = np.array([1] + [0]*(2**k_bits - 1))\n ##################\n # YOUR CODE HERE #\n ##################\n'
def spread_bunnies(lair, rows, columns): b_ees = [] for i in range(rows): for j in range(columns): if lair[i][j] == 'B': b_ees.append([i, j]) for b in b_ees: i = b[0] j = b[1] if i - 1 >= 0: lair[i - 1][j] = 'B' if i + 1 < rows: lair[i + 1][j] = 'B' if j - 1 >= 0: lair[i][j - 1] = 'B' if j + 1 < columns: lair[i][j + 1] = 'B' return lair rows, columns = map(int, input().split(' ')) lair = [] for _ in range(rows): lair.append([]) [lair[-1].append(x) for x in input()] directions = [x for x in input()] position = [] for i in range(rows): for j in range(columns): if lair[i][j] == 'P': position.append(i) position.append(j) break initial_row = position[0] initial_column = position[1] row = initial_row column = initial_column for move in directions: spread_bunnies(lair, rows, columns) if move == 'L': if column - 1 >= 0: if lair[row][column] != 'B': lair[row][column] = '.' row = row column = column - 1 if lair[row][column] == 'B': [print(''.join(row)) for row in lair] print(f"dead: {row} {column}") break else: lair[row][column] = 'P' else: if lair[row][column] != 'B': lair[row][column] = '.' [print(''.join(row)) for row in lair] print(f'won: {row} {column}') break if move == 'R': if column + 1 < columns: if lair[row][column] != 'B': lair[row][column] = '.' row = row column = column + 1 if lair[row][column] == 'B': [print(''.join(row)) for row in lair] print(f"dead: {row} {column}") break else: lair[row][column] = 'P' else: if lair[row][column] != 'B': lair[row][column] = '.' [print(''.join(row)) for row in lair] print(f'won: {row} {column}') break if move == 'U': if row - 1 >= 0: if lair[row][column] != 'B': lair[row][column] = '.' row = row - 1 column = column if lair[row][column] == 'B': [print(''.join(row)) for row in lair] print(f"dead: {row} {column}") break else: lair[row][column] = 'P' else: if lair[row][column] != 'B': lair[row][column] = '.' [print(''.join(row)) for row in lair] print(f'won: {row} {column}') break if move == 'D': if row + 1 < rows: if lair[row][column] != 'B': lair[row][column] = '.' row = row + 1 column = column if lair[row][column] == 'B': [print(''.join(row)) for row in lair] print(f"dead: {row} {column}") break else: lair[row][column] = 'P' else: if lair[row][column] != 'B': lair[row][column] = '.' [print(''.join(row)) for row in lair] print(f'won: {row} {column}') break
def spread_bunnies(lair, rows, columns): b_ees = [] for i in range(rows): for j in range(columns): if lair[i][j] == 'B': b_ees.append([i, j]) for b in b_ees: i = b[0] j = b[1] if i - 1 >= 0: lair[i - 1][j] = 'B' if i + 1 < rows: lair[i + 1][j] = 'B' if j - 1 >= 0: lair[i][j - 1] = 'B' if j + 1 < columns: lair[i][j + 1] = 'B' return lair (rows, columns) = map(int, input().split(' ')) lair = [] for _ in range(rows): lair.append([]) [lair[-1].append(x) for x in input()] directions = [x for x in input()] position = [] for i in range(rows): for j in range(columns): if lair[i][j] == 'P': position.append(i) position.append(j) break initial_row = position[0] initial_column = position[1] row = initial_row column = initial_column for move in directions: spread_bunnies(lair, rows, columns) if move == 'L': if column - 1 >= 0: if lair[row][column] != 'B': lair[row][column] = '.' row = row column = column - 1 if lair[row][column] == 'B': [print(''.join(row)) for row in lair] print(f'dead: {row} {column}') break else: lair[row][column] = 'P' else: if lair[row][column] != 'B': lair[row][column] = '.' [print(''.join(row)) for row in lair] print(f'won: {row} {column}') break if move == 'R': if column + 1 < columns: if lair[row][column] != 'B': lair[row][column] = '.' row = row column = column + 1 if lair[row][column] == 'B': [print(''.join(row)) for row in lair] print(f'dead: {row} {column}') break else: lair[row][column] = 'P' else: if lair[row][column] != 'B': lair[row][column] = '.' [print(''.join(row)) for row in lair] print(f'won: {row} {column}') break if move == 'U': if row - 1 >= 0: if lair[row][column] != 'B': lair[row][column] = '.' row = row - 1 column = column if lair[row][column] == 'B': [print(''.join(row)) for row in lair] print(f'dead: {row} {column}') break else: lair[row][column] = 'P' else: if lair[row][column] != 'B': lair[row][column] = '.' [print(''.join(row)) for row in lair] print(f'won: {row} {column}') break if move == 'D': if row + 1 < rows: if lair[row][column] != 'B': lair[row][column] = '.' row = row + 1 column = column if lair[row][column] == 'B': [print(''.join(row)) for row in lair] print(f'dead: {row} {column}') break else: lair[row][column] = 'P' else: if lair[row][column] != 'B': lair[row][column] = '.' [print(''.join(row)) for row in lair] print(f'won: {row} {column}') break
# ... client initialization left out data_client = client.data file_path = "experiments/data.xrdml" dataset_id = 1 ingester_list = data_client.list_ingesters() xrdml_ingester = ingester_list.find_by_id("citrine/ingest xrdml_xrd_converter") # Printing the ingester's arguments, we can see it requires an argument with the # name `sample_id`, and another with the name `chemical_formula`, both of which # should be strings. print(ingester.arguments) # [{ 'name': 'sample_id', # 'desc': 'An ID to uniquely identify the material referenced in the file.', # 'type': 'String', # 'required': True }, # { 'name': 'chemical_formula', # 'desc': 'The chemical formula of the material referenced in the file.', # 'type': 'String', # 'required': True }] ingester_arguments = [ { "name": "sample_id", "value": "1212" }, { "name": "chemical_formula", "value": "NaCl" }, ] # To ingest the file using the file_path as the destination path data_client.upload_with_ingester( dataset_id, file_path, xrdml_ingester, ingester_arguments ) # To ingest the file using a different destination path data_client.upload_with_ingester( dataset_id, file_path, xrdml_ingester, ingester_arguments, 'data.xrdml' )
data_client = client.data file_path = 'experiments/data.xrdml' dataset_id = 1 ingester_list = data_client.list_ingesters() xrdml_ingester = ingester_list.find_by_id('citrine/ingest xrdml_xrd_converter') print(ingester.arguments) ingester_arguments = [{'name': 'sample_id', 'value': '1212'}, {'name': 'chemical_formula', 'value': 'NaCl'}] data_client.upload_with_ingester(dataset_id, file_path, xrdml_ingester, ingester_arguments) data_client.upload_with_ingester(dataset_id, file_path, xrdml_ingester, ingester_arguments, 'data.xrdml')
class Action: def __init__(self, target, full, title, short): self.target = target self.full = full self.title = title self.short = short def __repr__(self): return '{"destructive":0, "full":"%s", "title":"%s", "short":"%s","identifier":"%s"}'%(self.title, self.full, self.short, self.target)
class Action: def __init__(self, target, full, title, short): self.target = target self.full = full self.title = title self.short = short def __repr__(self): return '{"destructive":0, "full":"%s", "title":"%s", "short":"%s","identifier":"%s"}' % (self.title, self.full, self.short, self.target)
### SELF-ORGANIZING MAPS (SOM) CLUSTERING ON TIME-HORIZON ### # INITIALIZE TRANSFORMED DATA & SELECTED SERIES/CHANNELS df = data.copy() list_channel = ['CBS', 'NBC', 'ABC', 'FOX', 'MSNBC', 'ESPN' ,'CNN', 'UNI', 'DISNEY CHANNEL', 'MTV'] list_target = ['18+', 'F18-34'] list_day_part = ['Morning', 'Daytime', 'Early Fringe', 'Prime Time', 'Late Fringe'] end_date = '2019-09-28' def split_dataframe(df, chunk_size=7): chunks = list() num_chunks = len(df) // chunk_size + 1 for i in range(num_chunks): chunks.append(df[i*chunk_size:(i+1)*chunk_size]) return chunks df_output_final = pd.DataFrame() for channel in tqdm(list_channel): for target in list_target: for day_part in list_day_part: random_seed = 1234 df_all = data.copy() df_all = df_all[(df_all['daypart'] == day_part) & (df_all['target'] == target)] df_all['Week'] = df_all['date'].apply(lambda x: x.strftime('%V')) df = data[(data['date'] < end_date) & (data['daypart'] == day_part) & (data['target'] == target)][['date', 'target', 'daypart', channel]].reset_index(drop=True) if channel == 'MTV': impute = df[df['MTV'] == 0] impute = df.loc[df['date'].isin(impute['date'] - dt.timedelta(days=364*2)), 'MTV'] df.loc[df['MTV'] == 0, 'MTV'] = impute.values df['Week'] = df['date'].apply(lambda x: x.strftime('%V')) df['Trend'] = sm.tsa.seasonal_decompose(df[channel], model='additive', freq=7, extrapolate_trend='freq').trend df['Seasonal_weekly'] = sm.tsa.seasonal_decompose(df[channel], model='additive', freq=7, extrapolate_trend='freq').seasonal df['Fourier'] = data[(data['date'] < end_date) & (data['daypart'] == day_part) & (data['target'] == target)]['fourier_' + channel].reset_index(drop=True) df = df[df['date'] != '2016-02-29'].reset_index(drop=True) for week in df['Week'].unique(): for df_split in split_dataframe(df.loc[df['Week'] == week, :], 7): if df_split.empty: continue # TREND & SEASONALITY Yt = df.loc[df_split.index, channel] - df.loc[df_split.index, 'Trend'] - df.loc[df_split.index, 'Seasonal_weekly'] Zt = df.loc[df_split.index, channel] - df.loc[df_split.index, 'Seasonal_weekly'] Xt = df.loc[df_split.index, channel] - df.loc[df_split.index, 'Trend'] df.loc[df_split.index, 'Trend_aggr'] = 1 - np.var(Yt) / np.var(Zt) df.loc[df_split.index, 'Seasonal_aggr'] = 1 - np.var(Yt) / np.var(Xt) # FOURIER TERMS AS PERIODICITY df.loc[df_split.index, 'Fourier_aggr'] = df.loc[df_split.index, 'Fourier'].mean() # KURTOSIS & SKEWNESS df.loc[df_split.index, 'Kurtosis'] = kurtosis(df_split[channel]) df.loc[df_split.index, 'Skewness'] = skew(df_split[channel]) # SERIAL CORRELATION --- USING LJONBOX TEST res = sm.tsa.SARIMAX(df.loc[df_split.index, channel], order=(1,0,1), random_seed=random_seed).fit(disp=-1) df.loc[df_split.index, 'Serial_correlation'] = sm.stats.acorr_ljungbox(res.resid, boxpierce=True, lags=1)[3][0] # NON-LINEARITY --- USING BDS TEST df.loc[df_split.index, 'NON_LINEARITY'] = sm.tsa.stattools.bds(df.loc[df_split.index, channel])[0] # SELF-SIMILARITY --- USING HURST EXPONENT df.loc[df_split.index, 'Self_similarity'] = nolds.hurst_rs(df.loc[df_split.index, channel]) # CHAOS --- USING LYAPUNOV EXPONENT df.loc[df_split.index, 'Chaos'] = nolds.lyap_r(df.loc[df_split.index, channel], emb_dim=1, min_neighbors=1, trajectory_len=2) df_cluster = df[-365:].reset_index(drop=True).merge(df.iloc[-365*2:-365, 8:].reset_index(drop=True), left_index=True, right_index=True, how='left', suffixes=('', '_YEAR2')) df_cluster = df_cluster.merge(df.iloc[-365*3:-365*2, 8:].reset_index(drop=True), left_index=True, right_index=True, how='left', suffixes=('', '_YEAR3')) df_cluster = df_cluster.drop(columns=['date', channel, 'Trend', 'Seasonal_weekly', 'Fourier']).groupby('Week').mean().reset_index() df_cluster.iloc[:, 1:] = MinMaxScaler().fit_transform(df_cluster.iloc[:, 1:]) def SOM_evaluate(som1, som2, sigma, learning_rate): som_shape = (int(som1), int(som2)) som = MiniSom(som_shape[0], som_shape[1], df_cluster.iloc[:, 1:].values.shape[1], sigma=sigma, learning_rate=learning_rate, neighborhood_function='gaussian', random_seed=random_seed) som.train_batch(df_cluster.iloc[:, 1:].values, 10000, verbose=False) return -som.quantization_error(df_cluster.iloc[:, 1:].values) SOM_BO = BayesianOptimization(SOM_evaluate, {'sigma': (1, 0.01), 'som1': (1, 10), 'som2': (5, 15), 'learning_rate': (0.1, 0.001)}, random_state=random_seed, verbose=0) SOM_BO.maximize(init_points=20, n_iter=20) som_shape = (int(SOM_BO.max['params']['som1']), int(SOM_BO.max['params']['som2'])) som = MiniSom(som_shape[0], som_shape[1], df_cluster.iloc[:, 1:].values.shape[1], sigma=SOM_BO.max['params']['sigma'], learning_rate=SOM_BO.max['params']['learning_rate'], neighborhood_function='gaussian', random_seed=random_seed) winner_coordinates = np.array([som.winner(x) for x in df_cluster.iloc[:, 1:].values]).T cluster_index = np.ravel_multi_index(winner_coordinates, som_shape) df_cluster['cluster'] = cluster_index df = df_all.merge(df_cluster[['Week', 'cluster']], on='Week', how='left') df_final = pd.concat([df[['date', 'daypart', 'target', channel]], pd.get_dummies(df['cluster'], prefix='Cluster', drop_first=True)], axis=1) df_final = df_final.rename(columns={channel: 'value'}) df_final.insert(0, column='channel', value=[channel]*len(df_final)) df_output_final = df_output_final.append(df_final, ignore_index=True) df_output_final
df = data.copy() list_channel = ['CBS', 'NBC', 'ABC', 'FOX', 'MSNBC', 'ESPN', 'CNN', 'UNI', 'DISNEY CHANNEL', 'MTV'] list_target = ['18+', 'F18-34'] list_day_part = ['Morning', 'Daytime', 'Early Fringe', 'Prime Time', 'Late Fringe'] end_date = '2019-09-28' def split_dataframe(df, chunk_size=7): chunks = list() num_chunks = len(df) // chunk_size + 1 for i in range(num_chunks): chunks.append(df[i * chunk_size:(i + 1) * chunk_size]) return chunks df_output_final = pd.DataFrame() for channel in tqdm(list_channel): for target in list_target: for day_part in list_day_part: random_seed = 1234 df_all = data.copy() df_all = df_all[(df_all['daypart'] == day_part) & (df_all['target'] == target)] df_all['Week'] = df_all['date'].apply(lambda x: x.strftime('%V')) df = data[(data['date'] < end_date) & (data['daypart'] == day_part) & (data['target'] == target)][['date', 'target', 'daypart', channel]].reset_index(drop=True) if channel == 'MTV': impute = df[df['MTV'] == 0] impute = df.loc[df['date'].isin(impute['date'] - dt.timedelta(days=364 * 2)), 'MTV'] df.loc[df['MTV'] == 0, 'MTV'] = impute.values df['Week'] = df['date'].apply(lambda x: x.strftime('%V')) df['Trend'] = sm.tsa.seasonal_decompose(df[channel], model='additive', freq=7, extrapolate_trend='freq').trend df['Seasonal_weekly'] = sm.tsa.seasonal_decompose(df[channel], model='additive', freq=7, extrapolate_trend='freq').seasonal df['Fourier'] = data[(data['date'] < end_date) & (data['daypart'] == day_part) & (data['target'] == target)]['fourier_' + channel].reset_index(drop=True) df = df[df['date'] != '2016-02-29'].reset_index(drop=True) for week in df['Week'].unique(): for df_split in split_dataframe(df.loc[df['Week'] == week, :], 7): if df_split.empty: continue yt = df.loc[df_split.index, channel] - df.loc[df_split.index, 'Trend'] - df.loc[df_split.index, 'Seasonal_weekly'] zt = df.loc[df_split.index, channel] - df.loc[df_split.index, 'Seasonal_weekly'] xt = df.loc[df_split.index, channel] - df.loc[df_split.index, 'Trend'] df.loc[df_split.index, 'Trend_aggr'] = 1 - np.var(Yt) / np.var(Zt) df.loc[df_split.index, 'Seasonal_aggr'] = 1 - np.var(Yt) / np.var(Xt) df.loc[df_split.index, 'Fourier_aggr'] = df.loc[df_split.index, 'Fourier'].mean() df.loc[df_split.index, 'Kurtosis'] = kurtosis(df_split[channel]) df.loc[df_split.index, 'Skewness'] = skew(df_split[channel]) res = sm.tsa.SARIMAX(df.loc[df_split.index, channel], order=(1, 0, 1), random_seed=random_seed).fit(disp=-1) df.loc[df_split.index, 'Serial_correlation'] = sm.stats.acorr_ljungbox(res.resid, boxpierce=True, lags=1)[3][0] df.loc[df_split.index, 'NON_LINEARITY'] = sm.tsa.stattools.bds(df.loc[df_split.index, channel])[0] df.loc[df_split.index, 'Self_similarity'] = nolds.hurst_rs(df.loc[df_split.index, channel]) df.loc[df_split.index, 'Chaos'] = nolds.lyap_r(df.loc[df_split.index, channel], emb_dim=1, min_neighbors=1, trajectory_len=2) df_cluster = df[-365:].reset_index(drop=True).merge(df.iloc[-365 * 2:-365, 8:].reset_index(drop=True), left_index=True, right_index=True, how='left', suffixes=('', '_YEAR2')) df_cluster = df_cluster.merge(df.iloc[-365 * 3:-365 * 2, 8:].reset_index(drop=True), left_index=True, right_index=True, how='left', suffixes=('', '_YEAR3')) df_cluster = df_cluster.drop(columns=['date', channel, 'Trend', 'Seasonal_weekly', 'Fourier']).groupby('Week').mean().reset_index() df_cluster.iloc[:, 1:] = min_max_scaler().fit_transform(df_cluster.iloc[:, 1:]) def som_evaluate(som1, som2, sigma, learning_rate): som_shape = (int(som1), int(som2)) som = mini_som(som_shape[0], som_shape[1], df_cluster.iloc[:, 1:].values.shape[1], sigma=sigma, learning_rate=learning_rate, neighborhood_function='gaussian', random_seed=random_seed) som.train_batch(df_cluster.iloc[:, 1:].values, 10000, verbose=False) return -som.quantization_error(df_cluster.iloc[:, 1:].values) som_bo = bayesian_optimization(SOM_evaluate, {'sigma': (1, 0.01), 'som1': (1, 10), 'som2': (5, 15), 'learning_rate': (0.1, 0.001)}, random_state=random_seed, verbose=0) SOM_BO.maximize(init_points=20, n_iter=20) som_shape = (int(SOM_BO.max['params']['som1']), int(SOM_BO.max['params']['som2'])) som = mini_som(som_shape[0], som_shape[1], df_cluster.iloc[:, 1:].values.shape[1], sigma=SOM_BO.max['params']['sigma'], learning_rate=SOM_BO.max['params']['learning_rate'], neighborhood_function='gaussian', random_seed=random_seed) winner_coordinates = np.array([som.winner(x) for x in df_cluster.iloc[:, 1:].values]).T cluster_index = np.ravel_multi_index(winner_coordinates, som_shape) df_cluster['cluster'] = cluster_index df = df_all.merge(df_cluster[['Week', 'cluster']], on='Week', how='left') df_final = pd.concat([df[['date', 'daypart', 'target', channel]], pd.get_dummies(df['cluster'], prefix='Cluster', drop_first=True)], axis=1) df_final = df_final.rename(columns={channel: 'value'}) df_final.insert(0, column='channel', value=[channel] * len(df_final)) df_output_final = df_output_final.append(df_final, ignore_index=True) df_output_final
# FUNCTION decimal range step value def drange(start, stop, step): r = start while r < stop: yield r r += step
def drange(start, stop, step): r = start while r < stop: yield r r += step
# -*- coding: utf-8 -*- """ Ian O'Rourke Created on Sun Feb 7 17:57:23 2021 Python 2 - DAT 129 - SP21 Homework Week 1 Icon Creator """ def wheeler(ten_set,this_list): '''Ensure the user inputs 10 characters.''' # Setting up while loop so the user can be prompted again if more # or less than 10 characters are provided for the input prompts in # main(). wheel = True while wheel != False: if len(ten_set) != 10: print('Try again.') ten_set = input('Enter ten.: ') else: this_list.append(ten_set) wheel = False return('Onto the next one!') def menu_displayer(ready_menu): '''Displays a list as a menu for the user for potential options.''' counter = 0 for entry in ready_menu: counter = counter + 1 print(counter,') ',entry,sep='') def icon_maker(dictionary): '''Makes an icon switches 0s to spaces and 1s to Xs.''' for key in dictionary: for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit,' ') else: item = item.replace(digit,'X') print(item) def icon_negative(dictionary): '''Swaps 0s for Xs and 1s for spaces.''' for key in dictionary: for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit,'X') else: item = item.replace(digit,' ') print(item) def inverter(dictionary): '''Makes the icon from the end of the given inputs.''' for key in dictionary: for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit,' ') else: item = item.replace(digit,'X') print(item[::-1]) def scale_twice(dictionary): '''Scales the icon by 2x.''' for key in dictionary: for vert in range(0,2): for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit,' ' * 2) else: item = item.replace(digit,'X' * 2) print(item) def scale_thrice(dictionary): '''Scales the icon by 3x.''' for key in dictionary: for vert in range(0,3): for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit,' ' * 3) else: item = item.replace(digit,'X' * 3) print(item) def main(): # Greeting and instructing the user. print('''Welcome! Using just a simply entry of 0s and 1s, this program will generate a 10 x 10 image that can serve as an icon for you. Simply type a sequence using 0 and 1 (if anything else is typed, it will count as a 1) for each row until all 10 are complete! Let's begin!''') # Establishing keys and values for primary dictionary. first_row = 'Row 1' second_row = 'Row 2' third_row = 'Row 3' fourth_row = 'Row 4' fifth_row = 'Row 5' sixth_row = 'Row 6' seventh_row = 'Row 7' eighth_row = 'Row 8' ninth_row = 'Row 9' tenth_row = 'Row 10' first_ten = [] second_ten = [] third_ten = [] fourth_ten = [] fifth_ten = [] sixth_ten = [] seventh_ten = [] eighth_ten = [] ninth_ten = [] tenth_ten = [] icon_dict = { first_row : first_ten, second_row : second_ten, third_row : third_ten, fourth_row: fourth_ten, fifth_row : fifth_ten, sixth_row : sixth_ten, seventh_row : seventh_ten, eighth_row : eighth_ten, ninth_row : ninth_ten, tenth_row : tenth_ten } # Collecting 100 0s and 1s from the user. Divided into 10 input # commands to help make it convenient for the user to enter all 100. first_input = input('Let\'s start with the first row of 10.: ') wheeler(first_input,first_ten) second_input = input('Now let\'s do the second.: ') wheeler(second_input,second_ten) third_input = input('And the now the third: ') wheeler(third_input,third_ten) fourth_input = input('And the fourth.: ') wheeler(fourth_input,fourth_ten) fifth_input = input('Now the fifth.: ') wheeler(fifth_input,fifth_ten) sixth_input = input('And the sixth.: ') wheeler(sixth_input,sixth_ten) seventh_input = input('The seventh: ') wheeler(seventh_input,seventh_ten) eighth_input = input('The eighth.: ') wheeler(eighth_input,eighth_ten) ninth_input = input('Now the ninth.: ') wheeler(ninth_input,ninth_ten) tenth_input = input('And now the final ten.: ') wheeler(tenth_input,tenth_ten) # Letting the user know that the input is complete. print('\nLet\'s see what we\'ve got!') print('') # Showing the results. icon_maker(icon_dict) # Setting up the menu for the user to make transformations. menu_list = ['See Original','Reverse','Invert','Scale x 2','Scale x 3','End Program'] print('\nAre they any transformations you would like to use?') print('') # Getting the menu to run. option_wheel = True while option_wheel != False: # Displaying the menu. menu_displayer(menu_list) option_input = input('\nPlease select an option. ') # Option for viewing the original creation. if option_input == '1': print('\nHere\'s the original icon.') icon_maker(icon_dict) print('\nAny other transformations you would like to see?') print('') # Option for viewing the icon reversed like a negative. elif option_input == '2': print('\nLet\'s how this looks reversed!') icon_negative(icon_dict) print('\nAny other transformations you would like to see?') print('') # Option for viewing the icon inverted. elif option_input == '3': print('\nLet\'s see how this looks inverted!') inverter(icon_dict) print('\nAny other transformations you would like to see?') print('') # Option for viewing the icon scaled x 2. elif option_input == '4': print('\nNow let\'s see how this looks scaled at 2x!') scale_twice(icon_dict) print('\nAny other transformations you would like to see?') print('') # Option for viewing the icon scaled x 3. elif option_input == '5': print('\nNow let\'s see how this looks scaled at 3x!') scale_thrice(icon_dict) print('\nAny other transformations you would like to see?') print('') # Ends the program. elif option_input == '6': print('\nAll right! Thanks for using this program!') option_wheel = False # For all other options that are not 1-6. else: print('\nNot a valid option. Try again.') print('') if __name__ == "__main__": main()
""" Ian O'Rourke Created on Sun Feb 7 17:57:23 2021 Python 2 - DAT 129 - SP21 Homework Week 1 Icon Creator """ def wheeler(ten_set, this_list): """Ensure the user inputs 10 characters.""" wheel = True while wheel != False: if len(ten_set) != 10: print('Try again.') ten_set = input('Enter ten.: ') else: this_list.append(ten_set) wheel = False return 'Onto the next one!' def menu_displayer(ready_menu): """Displays a list as a menu for the user for potential options.""" counter = 0 for entry in ready_menu: counter = counter + 1 print(counter, ') ', entry, sep='') def icon_maker(dictionary): """Makes an icon switches 0s to spaces and 1s to Xs.""" for key in dictionary: for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit, ' ') else: item = item.replace(digit, 'X') print(item) def icon_negative(dictionary): """Swaps 0s for Xs and 1s for spaces.""" for key in dictionary: for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit, 'X') else: item = item.replace(digit, ' ') print(item) def inverter(dictionary): """Makes the icon from the end of the given inputs.""" for key in dictionary: for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit, ' ') else: item = item.replace(digit, 'X') print(item[::-1]) def scale_twice(dictionary): """Scales the icon by 2x.""" for key in dictionary: for vert in range(0, 2): for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit, ' ' * 2) else: item = item.replace(digit, 'X' * 2) print(item) def scale_thrice(dictionary): """Scales the icon by 3x.""" for key in dictionary: for vert in range(0, 3): for item in dictionary[key]: for digit in item: if '0' in digit: item = item.replace(digit, ' ' * 3) else: item = item.replace(digit, 'X' * 3) print(item) def main(): print("Welcome! Using just a simply entry of 0s and 1s, this program\nwill generate a 10 x 10 image that can serve as an icon for you.\nSimply type a sequence using 0 and 1 (if anything else is typed, it will \ncount as a 1) for each row until all 10 are complete! Let's begin!") first_row = 'Row 1' second_row = 'Row 2' third_row = 'Row 3' fourth_row = 'Row 4' fifth_row = 'Row 5' sixth_row = 'Row 6' seventh_row = 'Row 7' eighth_row = 'Row 8' ninth_row = 'Row 9' tenth_row = 'Row 10' first_ten = [] second_ten = [] third_ten = [] fourth_ten = [] fifth_ten = [] sixth_ten = [] seventh_ten = [] eighth_ten = [] ninth_ten = [] tenth_ten = [] icon_dict = {first_row: first_ten, second_row: second_ten, third_row: third_ten, fourth_row: fourth_ten, fifth_row: fifth_ten, sixth_row: sixth_ten, seventh_row: seventh_ten, eighth_row: eighth_ten, ninth_row: ninth_ten, tenth_row: tenth_ten} first_input = input("Let's start with the first row of 10.: ") wheeler(first_input, first_ten) second_input = input("Now let's do the second.: ") wheeler(second_input, second_ten) third_input = input('And the now the third: ') wheeler(third_input, third_ten) fourth_input = input('And the fourth.: ') wheeler(fourth_input, fourth_ten) fifth_input = input('Now the fifth.: ') wheeler(fifth_input, fifth_ten) sixth_input = input('And the sixth.: ') wheeler(sixth_input, sixth_ten) seventh_input = input('The seventh: ') wheeler(seventh_input, seventh_ten) eighth_input = input('The eighth.: ') wheeler(eighth_input, eighth_ten) ninth_input = input('Now the ninth.: ') wheeler(ninth_input, ninth_ten) tenth_input = input('And now the final ten.: ') wheeler(tenth_input, tenth_ten) print("\nLet's see what we've got!") print('') icon_maker(icon_dict) menu_list = ['See Original', 'Reverse', 'Invert', 'Scale x 2', 'Scale x 3', 'End Program'] print('\nAre they any transformations you would like to use?') print('') option_wheel = True while option_wheel != False: menu_displayer(menu_list) option_input = input('\nPlease select an option. ') if option_input == '1': print("\nHere's the original icon.") icon_maker(icon_dict) print('\nAny other transformations you would like to see?') print('') elif option_input == '2': print("\nLet's how this looks reversed!") icon_negative(icon_dict) print('\nAny other transformations you would like to see?') print('') elif option_input == '3': print("\nLet's see how this looks inverted!") inverter(icon_dict) print('\nAny other transformations you would like to see?') print('') elif option_input == '4': print("\nNow let's see how this looks scaled at 2x!") scale_twice(icon_dict) print('\nAny other transformations you would like to see?') print('') elif option_input == '5': print("\nNow let's see how this looks scaled at 3x!") scale_thrice(icon_dict) print('\nAny other transformations you would like to see?') print('') elif option_input == '6': print('\nAll right! Thanks for using this program!') option_wheel = False else: print('\nNot a valid option. Try again.') print('') if __name__ == '__main__': main()
del_items(0x8012EA14) SetType(0x8012EA14, "void PreGameOnlyTestRoutine__Fv()") del_items(0x80130AEC) SetType(0x80130AEC, "void DRLG_PlaceDoor__Fii(int x, int y)") del_items(0x80130FC0) SetType(0x80130FC0, "void DRLG_L1Shadows__Fv()") del_items(0x801313D8) SetType(0x801313D8, "int DRLG_PlaceMiniSet__FPCUciiiiiii(unsigned char *miniset, int tmin, int tmax, int cx, int cy, int setview, int noquad, int ldir)") del_items(0x80131844) SetType(0x80131844, "void DRLG_L1Floor__Fv()") del_items(0x80131930) SetType(0x80131930, "void StoreBlock__FPiii(int *Bl, int xx, int yy)") del_items(0x801319DC) SetType(0x801319DC, "void DRLG_L1Pass3__Fv()") del_items(0x80131C08) SetType(0x80131C08, "void DRLG_LoadL1SP__Fv()") del_items(0x80131CE4) SetType(0x80131CE4, "void DRLG_FreeL1SP__Fv()") del_items(0x80131D14) SetType(0x80131D14, "void DRLG_Init_Globals__Fv()") del_items(0x80131DB8) SetType(0x80131DB8, "void set_restore_lighting__Fv()") del_items(0x80131E48) SetType(0x80131E48, "void DRLG_InitL1Vals__Fv()") del_items(0x80131E50) SetType(0x80131E50, "void LoadL1Dungeon__FPcii(char *sFileName, int vx, int vy)") del_items(0x8013201C) SetType(0x8013201C, "void LoadPreL1Dungeon__FPcii(char *sFileName, int vx, int vy)") del_items(0x801321D4) SetType(0x801321D4, "void InitL5Dungeon__Fv()") del_items(0x80132234) SetType(0x80132234, "void L5ClearFlags__Fv()") del_items(0x80132280) SetType(0x80132280, "void L5drawRoom__Fiiii(int x, int y, int w, int h)") del_items(0x801322EC) SetType(0x801322EC, "unsigned char L5checkRoom__Fiiii(int x, int y, int width, int height)") del_items(0x80132380) SetType(0x80132380, "void L5roomGen__Fiiiii(int x, int y, int w, int h, int dir)") del_items(0x8013267C) SetType(0x8013267C, "void L5firstRoom__Fv()") del_items(0x80132A38) SetType(0x80132A38, "long L5GetArea__Fv()") del_items(0x80132A98) SetType(0x80132A98, "void L5makeDungeon__Fv()") del_items(0x80132B24) SetType(0x80132B24, "void L5makeDmt__Fv()") del_items(0x80132C0C) SetType(0x80132C0C, "int L5HWallOk__Fii(int i, int j)") del_items(0x80132D48) SetType(0x80132D48, "int L5VWallOk__Fii(int i, int j)") del_items(0x80132E94) SetType(0x80132E94, "void L5HorizWall__Fiici(int i, int j, char p, int dx)") del_items(0x801330D4) SetType(0x801330D4, "void L5VertWall__Fiici(int i, int j, char p, int dy)") del_items(0x80133308) SetType(0x80133308, "void L5AddWall__Fv()") del_items(0x80133578) SetType(0x80133578, "void DRLG_L5GChamber__Fiiiiii(int sx, int sy, int topflag, int bottomflag, int leftflag, int rightflag)") del_items(0x80133838) SetType(0x80133838, "void DRLG_L5GHall__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x801338EC) SetType(0x801338EC, "void L5tileFix__Fv()") del_items(0x801341B0) SetType(0x801341B0, "void DRLG_L5Subs__Fv()") del_items(0x801343A8) SetType(0x801343A8, "void DRLG_L5SetRoom__Fii(int rx1, int ry1)") del_items(0x801344A8) SetType(0x801344A8, "void L5FillChambers__Fv()") del_items(0x80134B94) SetType(0x80134B94, "void DRLG_L5FTVR__Fiiiii(int i, int j, int x, int y, int d)") del_items(0x801350E4) SetType(0x801350E4, "void DRLG_L5FloodTVal__Fv()") del_items(0x801351E8) SetType(0x801351E8, "void DRLG_L5TransFix__Fv()") del_items(0x801353F8) SetType(0x801353F8, "void DRLG_L5DirtFix__Fv()") del_items(0x80135554) SetType(0x80135554, "void DRLG_L5CornerFix__Fv()") del_items(0x80135664) SetType(0x80135664, "void DRLG_L5__Fi(int entry)") del_items(0x80135B84) SetType(0x80135B84, "void CreateL5Dungeon__FUii(unsigned int rseed, int entry)") del_items(0x80138128) SetType(0x80138128, "unsigned char DRLG_L2PlaceMiniSet__FPUciiiiii(unsigned char *miniset, int tmin, int tmax, int cx, int cy, int setview, int ldir)") del_items(0x8013851C) SetType(0x8013851C, "void DRLG_L2PlaceRndSet__FPUci(unsigned char *miniset, int rndper)") del_items(0x8013881C) SetType(0x8013881C, "void DRLG_L2Subs__Fv()") del_items(0x80138A10) SetType(0x80138A10, "void DRLG_L2Shadows__Fv()") del_items(0x80138BD4) SetType(0x80138BD4, "void InitDungeon__Fv()") del_items(0x80138C34) SetType(0x80138C34, "void DRLG_LoadL2SP__Fv()") del_items(0x80138CD4) SetType(0x80138CD4, "void DRLG_FreeL2SP__Fv()") del_items(0x80138D04) SetType(0x80138D04, "void DRLG_L2SetRoom__Fii(int rx1, int ry1)") del_items(0x80138E04) SetType(0x80138E04, "void DefineRoom__Fiiiii(int nX1, int nY1, int nX2, int nY2, int ForceHW)") del_items(0x80139010) SetType(0x80139010, "void CreateDoorType__Fii(int nX, int nY)") del_items(0x801390F4) SetType(0x801390F4, "void PlaceHallExt__Fii(int nX, int nY)") del_items(0x8013912C) SetType(0x8013912C, "void AddHall__Fiiiii(int nX1, int nY1, int nX2, int nY2, int nHd)") del_items(0x80139204) SetType(0x80139204, "void CreateRoom__Fiiiiiiiii(int nX1, int nY1, int nX2, int nY2, int nRDest, int nHDir, int ForceHW, int nH, int nW)") del_items(0x8013988C) SetType(0x8013988C, "void GetHall__FPiN40(int *nX1, int *nY1, int *nX2, int *nY2, int *nHd)") del_items(0x80139924) SetType(0x80139924, "void ConnectHall__Fiiiii(int nX1, int nY1, int nX2, int nY2, int nHd)") del_items(0x80139F8C) SetType(0x80139F8C, "void DoPatternCheck__Fii(int i, int j)") del_items(0x8013A240) SetType(0x8013A240, "void L2TileFix__Fv()") del_items(0x8013A364) SetType(0x8013A364, "unsigned char DL2_Cont__FUcUcUcUc(unsigned char x1f, unsigned char y1f, unsigned char x2f, unsigned char y2f)") del_items(0x8013A3E4) SetType(0x8013A3E4, "int DL2_NumNoChar__Fv()") del_items(0x8013A440) SetType(0x8013A440, "void DL2_DrawRoom__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x8013A544) SetType(0x8013A544, "void DL2_KnockWalls__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x8013A714) SetType(0x8013A714, "unsigned char DL2_FillVoids__Fv()") del_items(0x8013B098) SetType(0x8013B098, "unsigned char CreateDungeon__Fv()") del_items(0x8013B3A4) SetType(0x8013B3A4, "void DRLG_L2Pass3__Fv()") del_items(0x8013B53C) SetType(0x8013B53C, "void DRLG_L2FTVR__Fiiiii(int i, int j, int x, int y, int d)") del_items(0x8013BA84) SetType(0x8013BA84, "void DRLG_L2FloodTVal__Fv()") del_items(0x8013BB88) SetType(0x8013BB88, "void DRLG_L2TransFix__Fv()") del_items(0x8013BD98) SetType(0x8013BD98, "void L2DirtFix__Fv()") del_items(0x8013BEF8) SetType(0x8013BEF8, "void L2LockoutFix__Fv()") del_items(0x8013C284) SetType(0x8013C284, "void L2DoorFix__Fv()") del_items(0x8013C334) SetType(0x8013C334, "void DRLG_L2__Fi(int entry)") del_items(0x8013CD80) SetType(0x8013CD80, "void DRLG_InitL2Vals__Fv()") del_items(0x8013CD88) SetType(0x8013CD88, "void LoadL2Dungeon__FPcii(char *sFileName, int vx, int vy)") del_items(0x8013CF78) SetType(0x8013CF78, "void LoadPreL2Dungeon__FPcii(char *sFileName, int vx, int vy)") del_items(0x8013D164) SetType(0x8013D164, "void CreateL2Dungeon__FUii(unsigned int rseed, int entry)") del_items(0x8013DB1C) SetType(0x8013DB1C, "void InitL3Dungeon__Fv()") del_items(0x8013DBA4) SetType(0x8013DBA4, "int DRLG_L3FillRoom__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x8013DE00) SetType(0x8013DE00, "void DRLG_L3CreateBlock__Fiiii(int x, int y, int obs, int dir)") del_items(0x8013E09C) SetType(0x8013E09C, "void DRLG_L3FloorArea__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x8013E104) SetType(0x8013E104, "void DRLG_L3FillDiags__Fv()") del_items(0x8013E234) SetType(0x8013E234, "void DRLG_L3FillSingles__Fv()") del_items(0x8013E300) SetType(0x8013E300, "void DRLG_L3FillStraights__Fv()") del_items(0x8013E6C4) SetType(0x8013E6C4, "void DRLG_L3Edges__Fv()") del_items(0x8013E704) SetType(0x8013E704, "int DRLG_L3GetFloorArea__Fv()") del_items(0x8013E754) SetType(0x8013E754, "void DRLG_L3MakeMegas__Fv()") del_items(0x8013E898) SetType(0x8013E898, "void DRLG_L3River__Fv()") del_items(0x8013F2D8) SetType(0x8013F2D8, "int DRLG_L3SpawnEdge__FiiPi(int x, int y, int *totarea)") del_items(0x8013F564) SetType(0x8013F564, "int DRLG_L3Spawn__FiiPi(int x, int y, int *totarea)") del_items(0x8013F778) SetType(0x8013F778, "void DRLG_L3Pool__Fv()") del_items(0x8013F9CC) SetType(0x8013F9CC, "void DRLG_L3PoolFix__Fv()") del_items(0x8013FB00) SetType(0x8013FB00, "int DRLG_L3PlaceMiniSet__FPCUciiiiii(unsigned char *miniset, int tmin, int tmax, int cx, int cy, int setview, int ldir)") del_items(0x8013FE80) SetType(0x8013FE80, "void DRLG_L3PlaceRndSet__FPCUci(unsigned char *miniset, int rndper)") del_items(0x801401C8) SetType(0x801401C8, "unsigned char WoodVertU__Fii(int i, int y)") del_items(0x80140274) SetType(0x80140274, "unsigned char WoodVertD__Fii(int i, int y)") del_items(0x80140310) SetType(0x80140310, "unsigned char WoodHorizL__Fii(int x, int j)") del_items(0x801403A4) SetType(0x801403A4, "unsigned char WoodHorizR__Fii(int x, int j)") del_items(0x80140428) SetType(0x80140428, "void AddFenceDoors__Fv()") del_items(0x8014050C) SetType(0x8014050C, "void FenceDoorFix__Fv()") del_items(0x80140700) SetType(0x80140700, "void DRLG_L3Wood__Fv()") del_items(0x80140EF0) SetType(0x80140EF0, "int DRLG_L3Anvil__Fv()") del_items(0x8014114C) SetType(0x8014114C, "void FixL3Warp__Fv()") del_items(0x80141234) SetType(0x80141234, "void FixL3HallofHeroes__Fv()") del_items(0x80141388) SetType(0x80141388, "void DRLG_L3LockRec__Fii(int x, int y)") del_items(0x80141424) SetType(0x80141424, "unsigned char DRLG_L3Lockout__Fv()") del_items(0x801414E4) SetType(0x801414E4, "void DRLG_L3__Fi(int entry)") del_items(0x80141C04) SetType(0x80141C04, "void DRLG_L3Pass3__Fv()") del_items(0x80141DA8) SetType(0x80141DA8, "void CreateL3Dungeon__FUii(unsigned int rseed, int entry)") del_items(0x80141EBC) SetType(0x80141EBC, "void LoadL3Dungeon__FPcii(char *sFileName, int vx, int vy)") del_items(0x801420E0) SetType(0x801420E0, "void LoadPreL3Dungeon__FPcii(char *sFileName, int vx, int vy)") del_items(0x80143F40) SetType(0x80143F40, "void DRLG_L4Shadows__Fv()") del_items(0x80144004) SetType(0x80144004, "void InitL4Dungeon__Fv()") del_items(0x801440A0) SetType(0x801440A0, "void DRLG_LoadL4SP__Fv()") del_items(0x80144168) SetType(0x80144168, "void DRLG_FreeL4SP__Fv()") del_items(0x80144190) SetType(0x80144190, "void DRLG_L4SetSPRoom__Fii(int rx1, int ry1)") del_items(0x80144290) SetType(0x80144290, "void L4makeDmt__Fv()") del_items(0x80144334) SetType(0x80144334, "int L4HWallOk__Fii(int i, int j)") del_items(0x80144484) SetType(0x80144484, "int L4VWallOk__Fii(int i, int j)") del_items(0x80144600) SetType(0x80144600, "void L4HorizWall__Fiii(int i, int j, int dx)") del_items(0x801447D0) SetType(0x801447D0, "void L4VertWall__Fiii(int i, int j, int dy)") del_items(0x80144998) SetType(0x80144998, "void L4AddWall__Fv()") del_items(0x80144E78) SetType(0x80144E78, "void L4tileFix__Fv()") del_items(0x80147060) SetType(0x80147060, "void DRLG_L4Subs__Fv()") del_items(0x80147238) SetType(0x80147238, "void L4makeDungeon__Fv()") del_items(0x80147470) SetType(0x80147470, "void uShape__Fv()") del_items(0x80147714) SetType(0x80147714, "long GetArea__Fv()") del_items(0x80147770) SetType(0x80147770, "void L4drawRoom__Fiiii(int x, int y, int width, int height)") del_items(0x801477D8) SetType(0x801477D8, "unsigned char L4checkRoom__Fiiii(int x, int y, int width, int height)") del_items(0x80147874) SetType(0x80147874, "void L4roomGen__Fiiiii(int x, int y, int w, int h, int dir)") del_items(0x80147B70) SetType(0x80147B70, "void L4firstRoom__Fv()") del_items(0x80147DBC) SetType(0x80147DBC, "void L4SaveQuads__Fv()") del_items(0x80147E5C) SetType(0x80147E5C, "void DRLG_L4SetRoom__FPUcii(unsigned char *pSetPiece, int rx1, int ry1)") del_items(0x80147F30) SetType(0x80147F30, "void DRLG_LoadDiabQuads__FUc(unsigned char preflag)") del_items(0x80148094) SetType(0x80148094, "unsigned char DRLG_L4PlaceMiniSet__FPCUciiiiii(unsigned char *miniset, int tmin, int tmax, int cx, int cy, int setview, int ldir)") del_items(0x801484AC) SetType(0x801484AC, "void DRLG_L4FTVR__Fiiiii(int i, int j, int x, int y, int d)") del_items(0x801489F4) SetType(0x801489F4, "void DRLG_L4FloodTVal__Fv()") del_items(0x80148AF8) SetType(0x80148AF8, "unsigned char IsDURWall__Fc(char d)") del_items(0x80148B28) SetType(0x80148B28, "unsigned char IsDLLWall__Fc(char dd)") del_items(0x80148B58) SetType(0x80148B58, "void DRLG_L4TransFix__Fv()") del_items(0x80148EB0) SetType(0x80148EB0, "void DRLG_L4Corners__Fv()") del_items(0x80148F44) SetType(0x80148F44, "void L4FixRim__Fv()") del_items(0x80148F80) SetType(0x80148F80, "void DRLG_L4GeneralFix__Fv()") del_items(0x80149024) SetType(0x80149024, "void DRLG_L4__Fi(int entry)") del_items(0x80149920) SetType(0x80149920, "void DRLG_L4Pass3__Fv()") del_items(0x80149AC4) SetType(0x80149AC4, "void CreateL4Dungeon__FUii(unsigned int rseed, int entry)") del_items(0x80149B54) SetType(0x80149B54, "int ObjIndex__Fii(int x, int y)") del_items(0x80149C08) SetType(0x80149C08, "void AddSKingObjs__Fv()") del_items(0x80149D38) SetType(0x80149D38, "void AddSChamObjs__Fv()") del_items(0x80149DB4) SetType(0x80149DB4, "void AddVileObjs__Fv()") del_items(0x80149E60) SetType(0x80149E60, "void DRLG_SetMapTrans__FPc(char *sFileName)") del_items(0x80149F24) SetType(0x80149F24, "void LoadSetMap__Fv()") del_items(0x8014A22C) SetType(0x8014A22C, "unsigned long CM_QuestToBitPattern__Fi(int QuestNum)") del_items(0x8014A2FC) SetType(0x8014A2FC, "void CM_ShowMonsterList__Fii(int Level, int List)") del_items(0x8014A374) SetType(0x8014A374, "int CM_ChooseMonsterList__FiUl(int Level, unsigned long QuestsNeededMask)") del_items(0x8014A414) SetType(0x8014A414, "int NoUiListChoose__FiUl(int Level, unsigned long QuestsNeededMask)") del_items(0x8014A41C) SetType(0x8014A41C, "void ChooseTask__FP4TASK(struct TASK *T)") del_items(0x8014A930) SetType(0x8014A930, "void ShowTask__FP4TASK(struct TASK *T)") del_items(0x8014AB4C) SetType(0x8014AB4C, "int GetListsAvailable__FiUlPUc(int Level, unsigned long QuestsNeededMask, unsigned char *ListofLists)") del_items(0x8014AC70) SetType(0x8014AC70, "unsigned short GetDown__C4CPad(struct CPad *this)") del_items(0x8014AC98) SetType(0x8014AC98, "void AddL1Door__Fiiii(int i, int x, int y, int ot)") del_items(0x8014AE28) SetType(0x8014AE28, "void AddSCambBook__Fi(int i)") del_items(0x8014AF00) SetType(0x8014AF00, "void AddChest__Fii(int i, int t)") del_items(0x8014B100) SetType(0x8014B100, "void AddL2Door__Fiiii(int i, int x, int y, int ot)") del_items(0x8014B270) SetType(0x8014B270, "void AddL3Door__Fiiii(int i, int x, int y, int ot)") del_items(0x8014B34C) SetType(0x8014B34C, "void AddSarc__Fi(int i)") del_items(0x8014B450) SetType(0x8014B450, "void AddFlameTrap__Fi(int i)") del_items(0x8014B4E4) SetType(0x8014B4E4, "void AddTrap__Fii(int i, int ot)") del_items(0x8014B600) SetType(0x8014B600, "void AddObjLight__Fii(int i, int r)") del_items(0x8014B6DC) SetType(0x8014B6DC, "void AddBarrel__Fii(int i, int ot)") del_items(0x8014B7AC) SetType(0x8014B7AC, "void AddShrine__Fi(int i)") del_items(0x8014B918) SetType(0x8014B918, "void AddBookcase__Fi(int i)") del_items(0x8014B990) SetType(0x8014B990, "void AddBookstand__Fi(int i)") del_items(0x8014B9F8) SetType(0x8014B9F8, "void AddBloodFtn__Fi(int i)") del_items(0x8014BA60) SetType(0x8014BA60, "void AddPurifyingFountain__Fi(int i)") del_items(0x8014BB64) SetType(0x8014BB64, "void AddArmorStand__Fi(int i)") del_items(0x8014BC0C) SetType(0x8014BC0C, "void AddGoatShrine__Fi(int i)") del_items(0x8014BC74) SetType(0x8014BC74, "void AddCauldron__Fi(int i)") del_items(0x8014BCDC) SetType(0x8014BCDC, "void AddMurkyFountain__Fi(int i)") del_items(0x8014BDE0) SetType(0x8014BDE0, "void AddTearFountain__Fi(int i)") del_items(0x8014BE48) SetType(0x8014BE48, "void AddDecap__Fi(int i)") del_items(0x8014BEE0) SetType(0x8014BEE0, "void AddVilebook__Fi(int i)") del_items(0x8014BF64) SetType(0x8014BF64, "void AddMagicCircle__Fi(int i)") del_items(0x8014BFF8) SetType(0x8014BFF8, "void AddBrnCross__Fi(int i)") del_items(0x8014C060) SetType(0x8014C060, "void AddPedistal__Fi(int i)") del_items(0x8014C10C) SetType(0x8014C10C, "void AddStoryBook__Fi(int i)") del_items(0x8014C2C8) SetType(0x8014C2C8, "void AddWeaponRack__Fi(int i)") del_items(0x8014C370) SetType(0x8014C370, "void AddTorturedBody__Fi(int i)") del_items(0x8014C408) SetType(0x8014C408, "void AddFlameLvr__Fi(int i)") del_items(0x8014C480) SetType(0x8014C480, "void GetRndObjLoc__FiRiT1(int randarea, int *xx, int *yy)") del_items(0x8014C58C) SetType(0x8014C58C, "void AddMushPatch__Fv()") del_items(0x8014C6B0) SetType(0x8014C6B0, "void AddSlainHero__Fv()") del_items(0x8014C6F0) SetType(0x8014C6F0, "unsigned char RndLocOk__Fii(int xp, int yp)") del_items(0x8014C7D4) SetType(0x8014C7D4, "unsigned char TrapLocOk__Fii(int xp, int yp)") del_items(0x8014C83C) SetType(0x8014C83C, "unsigned char RoomLocOk__Fii(int xp, int yp)") del_items(0x8014C8D4) SetType(0x8014C8D4, "void InitRndLocObj__Fiii(int min, int max, int objtype)") del_items(0x8014CA80) SetType(0x8014CA80, "void InitRndLocBigObj__Fiii(int min, int max, int objtype)") del_items(0x8014CC78) SetType(0x8014CC78, "void InitRndLocObj5x5__Fiii(int min, int max, int objtype)") del_items(0x8014CDA0) SetType(0x8014CDA0, "void SetMapObjects__FPUcii(unsigned char *pMap, int startx, int starty)") del_items(0x8014D064) SetType(0x8014D064, "void ClrAllObjects__Fv()") del_items(0x8014D154) SetType(0x8014D154, "void AddTortures__Fv()") del_items(0x8014D2E0) SetType(0x8014D2E0, "void AddCandles__Fv()") del_items(0x8014D368) SetType(0x8014D368, "void AddTrapLine__Fiiii(int min, int max, int tobjtype, int lobjtype)") del_items(0x8014D704) SetType(0x8014D704, "void AddLeverObj__Fiiiiiiii(int lx1, int ly1, int lx2, int ly2, int x1, int y1, int x2, int y2)") del_items(0x8014D70C) SetType(0x8014D70C, "void AddBookLever__Fiiiiiiiii(int lx1, int ly1, int lx2, int ly2, int x1, int y1, int x2, int y2, int msg)") del_items(0x8014D980) SetType(0x8014D980, "void InitRndBarrels__Fv()") del_items(0x8014DB1C) SetType(0x8014DB1C, "void AddL1Objs__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x8014DC54) SetType(0x8014DC54, "void AddL2Objs__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x8014DD68) SetType(0x8014DD68, "void AddL3Objs__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x8014DE68) SetType(0x8014DE68, "unsigned char TorchLocOK__Fii(int xp, int yp)") del_items(0x8014DEA8) SetType(0x8014DEA8, "void AddL2Torches__Fv()") del_items(0x8014E05C) SetType(0x8014E05C, "unsigned char WallTrapLocOk__Fii(int xp, int yp)") del_items(0x8014E0C4) SetType(0x8014E0C4, "void AddObjTraps__Fv()") del_items(0x8014E43C) SetType(0x8014E43C, "void AddChestTraps__Fv()") del_items(0x8014E58C) SetType(0x8014E58C, "void LoadMapObjects__FPUciiiiiii(unsigned char *pMap, int startx, int starty, int x1, int y1, int w, int h, int leveridx)") del_items(0x8014E6F8) SetType(0x8014E6F8, "void AddDiabObjs__Fv()") del_items(0x8014E84C) SetType(0x8014E84C, "void AddStoryBooks__Fv()") del_items(0x8014E99C) SetType(0x8014E99C, "void AddHookedBodies__Fi(int freq)") del_items(0x8014EB94) SetType(0x8014EB94, "void AddL4Goodies__Fv()") del_items(0x8014EC44) SetType(0x8014EC44, "void AddLazStand__Fv()") del_items(0x8014EDD8) SetType(0x8014EDD8, "void InitObjects__Fv()") del_items(0x8014F43C) SetType(0x8014F43C, "void PreObjObjAddSwitch__Fiiii(int ot, int ox, int oy, int oi)") del_items(0x8014F784) SetType(0x8014F784, "void FillSolidBlockTbls__Fv()") del_items(0x8014F954) SetType(0x8014F954, "void SetDungeonMicros__Fv()") del_items(0x8014F95C) SetType(0x8014F95C, "void DRLG_InitTrans__Fv()") del_items(0x8014F9D0) SetType(0x8014F9D0, "void DRLG_MRectTrans__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x8014FA70) SetType(0x8014FA70, "void DRLG_RectTrans__Fiiii(int x1, int y1, int x2, int y2)") del_items(0x8014FAF0) SetType(0x8014FAF0, "void DRLG_CopyTrans__Fiiii(int sx, int sy, int dx, int dy)") del_items(0x8014FB58) SetType(0x8014FB58, "void DRLG_ListTrans__FiPUc(int num, unsigned char *List)") del_items(0x8014FBCC) SetType(0x8014FBCC, "void DRLG_AreaTrans__FiPUc(int num, unsigned char *List)") del_items(0x8014FC5C) SetType(0x8014FC5C, "void DRLG_InitSetPC__Fv()") del_items(0x8014FC74) SetType(0x8014FC74, "void DRLG_SetPC__Fv()") del_items(0x8014FD24) SetType(0x8014FD24, "void Make_SetPC__Fiiii(int x, int y, int w, int h)") del_items(0x8014FDC4) SetType(0x8014FDC4, "unsigned char DRLG_WillThemeRoomFit__FiiiiiPiT5(int floor, int x, int y, int minSize, int maxSize, int *width, int *height)") del_items(0x8015008C) SetType(0x8015008C, "void DRLG_CreateThemeRoom__Fi(int themeIndex)") del_items(0x80151094) SetType(0x80151094, "void DRLG_PlaceThemeRooms__FiiiiUc(int minSize, int maxSize, int floor, int freq, int rndSize)") del_items(0x8015133C) SetType(0x8015133C, "void DRLG_HoldThemeRooms__Fv()") del_items(0x801514F0) SetType(0x801514F0, "unsigned char SkipThemeRoom__Fii(int x, int y)") del_items(0x801515BC) SetType(0x801515BC, "void InitLevels__Fv()") del_items(0x801516C0) SetType(0x801516C0, "unsigned char TFit_Shrine__Fi(int i)") del_items(0x80151968) SetType(0x80151968, "unsigned char TFit_Obj5__Fi(int t)") del_items(0x80151B58) SetType(0x80151B58, "unsigned char TFit_SkelRoom__Fi(int t)") del_items(0x80151C08) SetType(0x80151C08, "unsigned char TFit_GoatShrine__Fi(int t)") del_items(0x80151CA0) SetType(0x80151CA0, "unsigned char CheckThemeObj3__Fiiii(int xp, int yp, int t, int f)") del_items(0x80151E0C) SetType(0x80151E0C, "unsigned char TFit_Obj3__Fi(int t)") del_items(0x80151ECC) SetType(0x80151ECC, "unsigned char CheckThemeReqs__Fi(int t)") del_items(0x80151F98) SetType(0x80151F98, "unsigned char SpecialThemeFit__Fii(int i, int t)") del_items(0x80152174) SetType(0x80152174, "unsigned char CheckThemeRoom__Fi(int tv)") del_items(0x80152420) SetType(0x80152420, "void InitThemes__Fv()") del_items(0x80152794) SetType(0x80152794, "void HoldThemeRooms__Fv()") del_items(0x801528A0) SetType(0x801528A0, "void PlaceThemeMonsts__Fii(int t, int f)") del_items(0x80152A6C) SetType(0x80152A6C, "void Theme_Barrel__Fi(int t)") del_items(0x80152C04) SetType(0x80152C04, "void Theme_Shrine__Fi(int t)") del_items(0x80152CEC) SetType(0x80152CEC, "void Theme_MonstPit__Fi(int t)") del_items(0x80152E38) SetType(0x80152E38, "void Theme_SkelRoom__Fi(int t)") del_items(0x8015313C) SetType(0x8015313C, "void Theme_Treasure__Fi(int t)") del_items(0x801533BC) SetType(0x801533BC, "void Theme_Library__Fi(int t)") del_items(0x8015362C) SetType(0x8015362C, "void Theme_Torture__Fi(int t)") del_items(0x801537BC) SetType(0x801537BC, "void Theme_BloodFountain__Fi(int t)") del_items(0x80153830) SetType(0x80153830, "void Theme_Decap__Fi(int t)") del_items(0x801539C0) SetType(0x801539C0, "void Theme_PurifyingFountain__Fi(int t)") del_items(0x80153A34) SetType(0x80153A34, "void Theme_ArmorStand__Fi(int t)") del_items(0x80153BEC) SetType(0x80153BEC, "void Theme_GoatShrine__Fi(int t)") del_items(0x80153D5C) SetType(0x80153D5C, "void Theme_Cauldron__Fi(int t)") del_items(0x80153DD0) SetType(0x80153DD0, "void Theme_MurkyFountain__Fi(int t)") del_items(0x80153E44) SetType(0x80153E44, "void Theme_TearFountain__Fi(int t)") del_items(0x80153EB8) SetType(0x80153EB8, "void Theme_BrnCross__Fi(int t)") del_items(0x80154050) SetType(0x80154050, "void Theme_WeaponRack__Fi(int t)") del_items(0x80154208) SetType(0x80154208, "void UpdateL4Trans__Fv()") del_items(0x80154268) SetType(0x80154268, "void CreateThemeRooms__Fv()") del_items(0x80154470) SetType(0x80154470, "void InitPortals__Fv()") del_items(0x801544D0) SetType(0x801544D0, "void InitQuests__Fv()") del_items(0x801548D4) SetType(0x801548D4, "void DrawButcher__Fv()") del_items(0x80154918) SetType(0x80154918, "void DrawSkelKing__Fiii(int q, int x, int y)") del_items(0x801549A4) SetType(0x801549A4, "void DrawWarLord__Fii(int x, int y)") del_items(0x80154B10) SetType(0x80154B10, "void DrawSChamber__Fiii(int q, int x, int y)") del_items(0x80154CE0) SetType(0x80154CE0, "void DrawLTBanner__Fii(int x, int y)") del_items(0x80154E24) SetType(0x80154E24, "void DrawBlind__Fii(int x, int y)") del_items(0x80154F68) SetType(0x80154F68, "void DrawBlood__Fii(int x, int y)") del_items(0x801550B0) SetType(0x801550B0, "void DRLG_CheckQuests__Fii(int x, int y)") del_items(0x801551EC) SetType(0x801551EC, "void InitInv__Fv()") del_items(0x8015524C) SetType(0x8015524C, "void InitAutomap__Fv()") del_items(0x80155410) SetType(0x80155410, "void InitAutomapOnce__Fv()") del_items(0x80155420) SetType(0x80155420, "unsigned char MonstPlace__Fii(int xp, int yp)") del_items(0x801554DC) SetType(0x801554DC, "void InitMonsterGFX__Fi(int monst)") del_items(0x801555E4) SetType(0x801555E4, "void PlaceMonster__Fiiii(int i, int mtype, int x, int y)") del_items(0x80155684) SetType(0x80155684, "int AddMonsterType__Fii(int type, int placeflag)") del_items(0x801557B8) SetType(0x801557B8, "void GetMonsterTypes__FUl(unsigned long QuestMask)") del_items(0x80155868) SetType(0x80155868, "void ClrAllMonsters__Fv()") del_items(0x801559A8) SetType(0x801559A8, "void InitLevelMonsters__Fv()") del_items(0x80155A2C) SetType(0x80155A2C, "void GetLevelMTypes__Fv()") del_items(0x80155E74) SetType(0x80155E74, "void PlaceQuestMonsters__Fv()") del_items(0x8015628C) SetType(0x8015628C, "void LoadDiabMonsts__Fv()") del_items(0x8015639C) SetType(0x8015639C, "void PlaceGroup__FiiUci(int mtype, int num, unsigned char leaderf, int leader)") del_items(0x801569AC) SetType(0x801569AC, "void SetMapMonsters__FPUcii(unsigned char *pMap, int startx, int starty)") del_items(0x80156BD0) SetType(0x80156BD0, "void InitMonsters__Fv()") del_items(0x80156FAC) SetType(0x80156FAC, "void PlaceUniqueMonst__Fiii(int uniqindex, int miniontype, int unpackfilesize)") del_items(0x801577CC) SetType(0x801577CC, "void PlaceUniques__Fv()") del_items(0x80157990) SetType(0x80157990, "int PreSpawnSkeleton__Fv()") del_items(0x80157AF8) SetType(0x80157AF8, "int encode_enemy__Fi(int m)") del_items(0x80157B50) SetType(0x80157B50, "void decode_enemy__Fii(int m, int enemy)") del_items(0x80157C68) SetType(0x80157C68, "unsigned char IsGoat__Fi(int mt)") del_items(0x80157C94) SetType(0x80157C94, "void InitMissiles__Fv()") del_items(0x80157EB0) SetType(0x80157EB0, "void InitNoTriggers__Fv()") del_items(0x80157ED4) SetType(0x80157ED4, "void InitTownTriggers__Fv()") del_items(0x80158234) SetType(0x80158234, "void InitL1Triggers__Fv()") del_items(0x80158348) SetType(0x80158348, "void InitL2Triggers__Fv()") del_items(0x801584D8) SetType(0x801584D8, "void InitL3Triggers__Fv()") del_items(0x80158634) SetType(0x80158634, "void InitL4Triggers__Fv()") del_items(0x80158848) SetType(0x80158848, "void InitSKingTriggers__Fv()") del_items(0x80158894) SetType(0x80158894, "void InitSChambTriggers__Fv()") del_items(0x801588E0) SetType(0x801588E0, "void InitPWaterTriggers__Fv()") del_items(0x8015892C) SetType(0x8015892C, "void InitVPTriggers__Fv()") del_items(0x80158978) SetType(0x80158978, "void InitStores__Fv()") del_items(0x801589F8) SetType(0x801589F8, "void SetupTownStores__Fv()") del_items(0x80158BA8) SetType(0x80158BA8, "void DeltaLoadLevel__Fv()") del_items(0x80159828) SetType(0x80159828, "unsigned char SmithItemOk__Fi(int i)") del_items(0x8015988C) SetType(0x8015988C, "int RndSmithItem__Fi(int lvl)") del_items(0x80159998) SetType(0x80159998, "unsigned char WitchItemOk__Fi(int i)") del_items(0x80159AD8) SetType(0x80159AD8, "int RndWitchItem__Fi(int lvl)") del_items(0x80159BD8) SetType(0x80159BD8, "void BubbleSwapItem__FP10ItemStructT0(struct ItemStruct *a, struct ItemStruct *b)") del_items(0x80159CBC) SetType(0x80159CBC, "void SortWitch__Fv()") del_items(0x80159DDC) SetType(0x80159DDC, "int RndBoyItem__Fi(int lvl)") del_items(0x80159F00) SetType(0x80159F00, "unsigned char HealerItemOk__Fi(int i)") del_items(0x8015A0B4) SetType(0x8015A0B4, "int RndHealerItem__Fi(int lvl)") del_items(0x8015A1B4) SetType(0x8015A1B4, "void RecreatePremiumItem__Fiiii(int ii, int idx, int plvl, int iseed)") del_items(0x8015A27C) SetType(0x8015A27C, "void RecreateWitchItem__Fiiii(int ii, int idx, int lvl, int iseed)") del_items(0x8015A3D4) SetType(0x8015A3D4, "void RecreateSmithItem__Fiiii(int ii, int idx, int lvl, int iseed)") del_items(0x8015A470) SetType(0x8015A470, "void RecreateHealerItem__Fiiii(int ii, int idx, int lvl, int iseed)") del_items(0x8015A530) SetType(0x8015A530, "void RecreateBoyItem__Fiiii(int ii, int idx, int lvl, int iseed)") del_items(0x8015A5F4) SetType(0x8015A5F4, "void RecreateTownItem__FiiUsii(int ii, int idx, unsigned short icreateinfo, int iseed, int ivalue)") del_items(0x8015A680) SetType(0x8015A680, "void SpawnSmith__Fi(int lvl)") del_items(0x8015A81C) SetType(0x8015A81C, "void SpawnWitch__Fi(int lvl)") del_items(0x8015AB88) SetType(0x8015AB88, "void SpawnHealer__Fi(int lvl)") del_items(0x8015AEA4) SetType(0x8015AEA4, "void SpawnBoy__Fi(int lvl)") del_items(0x8015AFF8) SetType(0x8015AFF8, "void SortSmith__Fv()") del_items(0x8015B10C) SetType(0x8015B10C, "void SortHealer__Fv()") del_items(0x8015B22C) SetType(0x8015B22C, "void RecreateItem__FiiUsii(int ii, int idx, unsigned short icreateinfo, int iseed, int ivalue)")
del_items(2148723220) set_type(2148723220, 'void PreGameOnlyTestRoutine__Fv()') del_items(2148731628) set_type(2148731628, 'void DRLG_PlaceDoor__Fii(int x, int y)') del_items(2148732864) set_type(2148732864, 'void DRLG_L1Shadows__Fv()') del_items(2148733912) set_type(2148733912, 'int DRLG_PlaceMiniSet__FPCUciiiiiii(unsigned char *miniset, int tmin, int tmax, int cx, int cy, int setview, int noquad, int ldir)') del_items(2148735044) set_type(2148735044, 'void DRLG_L1Floor__Fv()') del_items(2148735280) set_type(2148735280, 'void StoreBlock__FPiii(int *Bl, int xx, int yy)') del_items(2148735452) set_type(2148735452, 'void DRLG_L1Pass3__Fv()') del_items(2148736008) set_type(2148736008, 'void DRLG_LoadL1SP__Fv()') del_items(2148736228) set_type(2148736228, 'void DRLG_FreeL1SP__Fv()') del_items(2148736276) set_type(2148736276, 'void DRLG_Init_Globals__Fv()') del_items(2148736440) set_type(2148736440, 'void set_restore_lighting__Fv()') del_items(2148736584) set_type(2148736584, 'void DRLG_InitL1Vals__Fv()') del_items(2148736592) set_type(2148736592, 'void LoadL1Dungeon__FPcii(char *sFileName, int vx, int vy)') del_items(2148737052) set_type(2148737052, 'void LoadPreL1Dungeon__FPcii(char *sFileName, int vx, int vy)') del_items(2148737492) set_type(2148737492, 'void InitL5Dungeon__Fv()') del_items(2148737588) set_type(2148737588, 'void L5ClearFlags__Fv()') del_items(2148737664) set_type(2148737664, 'void L5drawRoom__Fiiii(int x, int y, int w, int h)') del_items(2148737772) set_type(2148737772, 'unsigned char L5checkRoom__Fiiii(int x, int y, int width, int height)') del_items(2148737920) set_type(2148737920, 'void L5roomGen__Fiiiii(int x, int y, int w, int h, int dir)') del_items(2148738684) set_type(2148738684, 'void L5firstRoom__Fv()') del_items(2148739640) set_type(2148739640, 'long L5GetArea__Fv()') del_items(2148739736) set_type(2148739736, 'void L5makeDungeon__Fv()') del_items(2148739876) set_type(2148739876, 'void L5makeDmt__Fv()') del_items(2148740108) set_type(2148740108, 'int L5HWallOk__Fii(int i, int j)') del_items(2148740424) set_type(2148740424, 'int L5VWallOk__Fii(int i, int j)') del_items(2148740756) set_type(2148740756, 'void L5HorizWall__Fiici(int i, int j, char p, int dx)') del_items(2148741332) set_type(2148741332, 'void L5VertWall__Fiici(int i, int j, char p, int dy)') del_items(2148741896) set_type(2148741896, 'void L5AddWall__Fv()') del_items(2148742520) set_type(2148742520, 'void DRLG_L5GChamber__Fiiiiii(int sx, int sy, int topflag, int bottomflag, int leftflag, int rightflag)') del_items(2148743224) set_type(2148743224, 'void DRLG_L5GHall__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148743404) set_type(2148743404, 'void L5tileFix__Fv()') del_items(2148745648) set_type(2148745648, 'void DRLG_L5Subs__Fv()') del_items(2148746152) set_type(2148746152, 'void DRLG_L5SetRoom__Fii(int rx1, int ry1)') del_items(2148746408) set_type(2148746408, 'void L5FillChambers__Fv()') del_items(2148748180) set_type(2148748180, 'void DRLG_L5FTVR__Fiiiii(int i, int j, int x, int y, int d)') del_items(2148749540) set_type(2148749540, 'void DRLG_L5FloodTVal__Fv()') del_items(2148749800) set_type(2148749800, 'void DRLG_L5TransFix__Fv()') del_items(2148750328) set_type(2148750328, 'void DRLG_L5DirtFix__Fv()') del_items(2148750676) set_type(2148750676, 'void DRLG_L5CornerFix__Fv()') del_items(2148750948) set_type(2148750948, 'void DRLG_L5__Fi(int entry)') del_items(2148752260) set_type(2148752260, 'void CreateL5Dungeon__FUii(unsigned int rseed, int entry)') del_items(2148761896) set_type(2148761896, 'unsigned char DRLG_L2PlaceMiniSet__FPUciiiiii(unsigned char *miniset, int tmin, int tmax, int cx, int cy, int setview, int ldir)') del_items(2148762908) set_type(2148762908, 'void DRLG_L2PlaceRndSet__FPUci(unsigned char *miniset, int rndper)') del_items(2148763676) set_type(2148763676, 'void DRLG_L2Subs__Fv()') del_items(2148764176) set_type(2148764176, 'void DRLG_L2Shadows__Fv()') del_items(2148764628) set_type(2148764628, 'void InitDungeon__Fv()') del_items(2148764724) set_type(2148764724, 'void DRLG_LoadL2SP__Fv()') del_items(2148764884) set_type(2148764884, 'void DRLG_FreeL2SP__Fv()') del_items(2148764932) set_type(2148764932, 'void DRLG_L2SetRoom__Fii(int rx1, int ry1)') del_items(2148765188) set_type(2148765188, 'void DefineRoom__Fiiiii(int nX1, int nY1, int nX2, int nY2, int ForceHW)') del_items(2148765712) set_type(2148765712, 'void CreateDoorType__Fii(int nX, int nY)') del_items(2148765940) set_type(2148765940, 'void PlaceHallExt__Fii(int nX, int nY)') del_items(2148765996) set_type(2148765996, 'void AddHall__Fiiiii(int nX1, int nY1, int nX2, int nY2, int nHd)') del_items(2148766212) set_type(2148766212, 'void CreateRoom__Fiiiiiiiii(int nX1, int nY1, int nX2, int nY2, int nRDest, int nHDir, int ForceHW, int nH, int nW)') del_items(2148767884) set_type(2148767884, 'void GetHall__FPiN40(int *nX1, int *nY1, int *nX2, int *nY2, int *nHd)') del_items(2148768036) set_type(2148768036, 'void ConnectHall__Fiiiii(int nX1, int nY1, int nX2, int nY2, int nHd)') del_items(2148769676) set_type(2148769676, 'void DoPatternCheck__Fii(int i, int j)') del_items(2148770368) set_type(2148770368, 'void L2TileFix__Fv()') del_items(2148770660) set_type(2148770660, 'unsigned char DL2_Cont__FUcUcUcUc(unsigned char x1f, unsigned char y1f, unsigned char x2f, unsigned char y2f)') del_items(2148770788) set_type(2148770788, 'int DL2_NumNoChar__Fv()') del_items(2148770880) set_type(2148770880, 'void DL2_DrawRoom__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148771140) set_type(2148771140, 'void DL2_KnockWalls__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148771604) set_type(2148771604, 'unsigned char DL2_FillVoids__Fv()') del_items(2148774040) set_type(2148774040, 'unsigned char CreateDungeon__Fv()') del_items(2148774820) set_type(2148774820, 'void DRLG_L2Pass3__Fv()') del_items(2148775228) set_type(2148775228, 'void DRLG_L2FTVR__Fiiiii(int i, int j, int x, int y, int d)') del_items(2148776580) set_type(2148776580, 'void DRLG_L2FloodTVal__Fv()') del_items(2148776840) set_type(2148776840, 'void DRLG_L2TransFix__Fv()') del_items(2148777368) set_type(2148777368, 'void L2DirtFix__Fv()') del_items(2148777720) set_type(2148777720, 'void L2LockoutFix__Fv()') del_items(2148778628) set_type(2148778628, 'void L2DoorFix__Fv()') del_items(2148778804) set_type(2148778804, 'void DRLG_L2__Fi(int entry)') del_items(2148781440) set_type(2148781440, 'void DRLG_InitL2Vals__Fv()') del_items(2148781448) set_type(2148781448, 'void LoadL2Dungeon__FPcii(char *sFileName, int vx, int vy)') del_items(2148781944) set_type(2148781944, 'void LoadPreL2Dungeon__FPcii(char *sFileName, int vx, int vy)') del_items(2148782436) set_type(2148782436, 'void CreateL2Dungeon__FUii(unsigned int rseed, int entry)') del_items(2148784924) set_type(2148784924, 'void InitL3Dungeon__Fv()') del_items(2148785060) set_type(2148785060, 'int DRLG_L3FillRoom__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148785664) set_type(2148785664, 'void DRLG_L3CreateBlock__Fiiii(int x, int y, int obs, int dir)') del_items(2148786332) set_type(2148786332, 'void DRLG_L3FloorArea__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148786436) set_type(2148786436, 'void DRLG_L3FillDiags__Fv()') del_items(2148786740) set_type(2148786740, 'void DRLG_L3FillSingles__Fv()') del_items(2148786944) set_type(2148786944, 'void DRLG_L3FillStraights__Fv()') del_items(2148787908) set_type(2148787908, 'void DRLG_L3Edges__Fv()') del_items(2148787972) set_type(2148787972, 'int DRLG_L3GetFloorArea__Fv()') del_items(2148788052) set_type(2148788052, 'void DRLG_L3MakeMegas__Fv()') del_items(2148788376) set_type(2148788376, 'void DRLG_L3River__Fv()') del_items(2148791000) set_type(2148791000, 'int DRLG_L3SpawnEdge__FiiPi(int x, int y, int *totarea)') del_items(2148791652) set_type(2148791652, 'int DRLG_L3Spawn__FiiPi(int x, int y, int *totarea)') del_items(2148792184) set_type(2148792184, 'void DRLG_L3Pool__Fv()') del_items(2148792780) set_type(2148792780, 'void DRLG_L3PoolFix__Fv()') del_items(2148793088) set_type(2148793088, 'int DRLG_L3PlaceMiniSet__FPCUciiiiii(unsigned char *miniset, int tmin, int tmax, int cx, int cy, int setview, int ldir)') del_items(2148793984) set_type(2148793984, 'void DRLG_L3PlaceRndSet__FPCUci(unsigned char *miniset, int rndper)') del_items(2148794824) set_type(2148794824, 'unsigned char WoodVertU__Fii(int i, int y)') del_items(2148794996) set_type(2148794996, 'unsigned char WoodVertD__Fii(int i, int y)') del_items(2148795152) set_type(2148795152, 'unsigned char WoodHorizL__Fii(int x, int j)') del_items(2148795300) set_type(2148795300, 'unsigned char WoodHorizR__Fii(int x, int j)') del_items(2148795432) set_type(2148795432, 'void AddFenceDoors__Fv()') del_items(2148795660) set_type(2148795660, 'void FenceDoorFix__Fv()') del_items(2148796160) set_type(2148796160, 'void DRLG_L3Wood__Fv()') del_items(2148798192) set_type(2148798192, 'int DRLG_L3Anvil__Fv()') del_items(2148798796) set_type(2148798796, 'void FixL3Warp__Fv()') del_items(2148799028) set_type(2148799028, 'void FixL3HallofHeroes__Fv()') del_items(2148799368) set_type(2148799368, 'void DRLG_L3LockRec__Fii(int x, int y)') del_items(2148799524) set_type(2148799524, 'unsigned char DRLG_L3Lockout__Fv()') del_items(2148799716) set_type(2148799716, 'void DRLG_L3__Fi(int entry)') del_items(2148801540) set_type(2148801540, 'void DRLG_L3Pass3__Fv()') del_items(2148801960) set_type(2148801960, 'void CreateL3Dungeon__FUii(unsigned int rseed, int entry)') del_items(2148802236) set_type(2148802236, 'void LoadL3Dungeon__FPcii(char *sFileName, int vx, int vy)') del_items(2148802784) set_type(2148802784, 'void LoadPreL3Dungeon__FPcii(char *sFileName, int vx, int vy)') del_items(2148810560) set_type(2148810560, 'void DRLG_L4Shadows__Fv()') del_items(2148810756) set_type(2148810756, 'void InitL4Dungeon__Fv()') del_items(2148810912) set_type(2148810912, 'void DRLG_LoadL4SP__Fv()') del_items(2148811112) set_type(2148811112, 'void DRLG_FreeL4SP__Fv()') del_items(2148811152) set_type(2148811152, 'void DRLG_L4SetSPRoom__Fii(int rx1, int ry1)') del_items(2148811408) set_type(2148811408, 'void L4makeDmt__Fv()') del_items(2148811572) set_type(2148811572, 'int L4HWallOk__Fii(int i, int j)') del_items(2148811908) set_type(2148811908, 'int L4VWallOk__Fii(int i, int j)') del_items(2148812288) set_type(2148812288, 'void L4HorizWall__Fiii(int i, int j, int dx)') del_items(2148812752) set_type(2148812752, 'void L4VertWall__Fiii(int i, int j, int dy)') del_items(2148813208) set_type(2148813208, 'void L4AddWall__Fv()') del_items(2148814456) set_type(2148814456, 'void L4tileFix__Fv()') del_items(2148823136) set_type(2148823136, 'void DRLG_L4Subs__Fv()') del_items(2148823608) set_type(2148823608, 'void L4makeDungeon__Fv()') del_items(2148824176) set_type(2148824176, 'void uShape__Fv()') del_items(2148824852) set_type(2148824852, 'long GetArea__Fv()') del_items(2148824944) set_type(2148824944, 'void L4drawRoom__Fiiii(int x, int y, int width, int height)') del_items(2148825048) set_type(2148825048, 'unsigned char L4checkRoom__Fiiii(int x, int y, int width, int height)') del_items(2148825204) set_type(2148825204, 'void L4roomGen__Fiiiii(int x, int y, int w, int h, int dir)') del_items(2148825968) set_type(2148825968, 'void L4firstRoom__Fv()') del_items(2148826556) set_type(2148826556, 'void L4SaveQuads__Fv()') del_items(2148826716) set_type(2148826716, 'void DRLG_L4SetRoom__FPUcii(unsigned char *pSetPiece, int rx1, int ry1)') del_items(2148826928) set_type(2148826928, 'void DRLG_LoadDiabQuads__FUc(unsigned char preflag)') del_items(2148827284) set_type(2148827284, 'unsigned char DRLG_L4PlaceMiniSet__FPCUciiiiii(unsigned char *miniset, int tmin, int tmax, int cx, int cy, int setview, int ldir)') del_items(2148828332) set_type(2148828332, 'void DRLG_L4FTVR__Fiiiii(int i, int j, int x, int y, int d)') del_items(2148829684) set_type(2148829684, 'void DRLG_L4FloodTVal__Fv()') del_items(2148829944) set_type(2148829944, 'unsigned char IsDURWall__Fc(char d)') del_items(2148829992) set_type(2148829992, 'unsigned char IsDLLWall__Fc(char dd)') del_items(2148830040) set_type(2148830040, 'void DRLG_L4TransFix__Fv()') del_items(2148830896) set_type(2148830896, 'void DRLG_L4Corners__Fv()') del_items(2148831044) set_type(2148831044, 'void L4FixRim__Fv()') del_items(2148831104) set_type(2148831104, 'void DRLG_L4GeneralFix__Fv()') del_items(2148831268) set_type(2148831268, 'void DRLG_L4__Fi(int entry)') del_items(2148833568) set_type(2148833568, 'void DRLG_L4Pass3__Fv()') del_items(2148833988) set_type(2148833988, 'void CreateL4Dungeon__FUii(unsigned int rseed, int entry)') del_items(2148834132) set_type(2148834132, 'int ObjIndex__Fii(int x, int y)') del_items(2148834312) set_type(2148834312, 'void AddSKingObjs__Fv()') del_items(2148834616) set_type(2148834616, 'void AddSChamObjs__Fv()') del_items(2148834740) set_type(2148834740, 'void AddVileObjs__Fv()') del_items(2148834912) set_type(2148834912, 'void DRLG_SetMapTrans__FPc(char *sFileName)') del_items(2148835108) set_type(2148835108, 'void LoadSetMap__Fv()') del_items(2148835884) set_type(2148835884, 'unsigned long CM_QuestToBitPattern__Fi(int QuestNum)') del_items(2148836092) set_type(2148836092, 'void CM_ShowMonsterList__Fii(int Level, int List)') del_items(2148836212) set_type(2148836212, 'int CM_ChooseMonsterList__FiUl(int Level, unsigned long QuestsNeededMask)') del_items(2148836372) set_type(2148836372, 'int NoUiListChoose__FiUl(int Level, unsigned long QuestsNeededMask)') del_items(2148836380) set_type(2148836380, 'void ChooseTask__FP4TASK(struct TASK *T)') del_items(2148837680) set_type(2148837680, 'void ShowTask__FP4TASK(struct TASK *T)') del_items(2148838220) set_type(2148838220, 'int GetListsAvailable__FiUlPUc(int Level, unsigned long QuestsNeededMask, unsigned char *ListofLists)') del_items(2148838512) set_type(2148838512, 'unsigned short GetDown__C4CPad(struct CPad *this)') del_items(2148838552) set_type(2148838552, 'void AddL1Door__Fiiii(int i, int x, int y, int ot)') del_items(2148838952) set_type(2148838952, 'void AddSCambBook__Fi(int i)') del_items(2148839168) set_type(2148839168, 'void AddChest__Fii(int i, int t)') del_items(2148839680) set_type(2148839680, 'void AddL2Door__Fiiii(int i, int x, int y, int ot)') del_items(2148840048) set_type(2148840048, 'void AddL3Door__Fiiii(int i, int x, int y, int ot)') del_items(2148840268) set_type(2148840268, 'void AddSarc__Fi(int i)') del_items(2148840528) set_type(2148840528, 'void AddFlameTrap__Fi(int i)') del_items(2148840676) set_type(2148840676, 'void AddTrap__Fii(int i, int ot)') del_items(2148840960) set_type(2148840960, 'void AddObjLight__Fii(int i, int r)') del_items(2148841180) set_type(2148841180, 'void AddBarrel__Fii(int i, int ot)') del_items(2148841388) set_type(2148841388, 'void AddShrine__Fi(int i)') del_items(2148841752) set_type(2148841752, 'void AddBookcase__Fi(int i)') del_items(2148841872) set_type(2148841872, 'void AddBookstand__Fi(int i)') del_items(2148841976) set_type(2148841976, 'void AddBloodFtn__Fi(int i)') del_items(2148842080) set_type(2148842080, 'void AddPurifyingFountain__Fi(int i)') del_items(2148842340) set_type(2148842340, 'void AddArmorStand__Fi(int i)') del_items(2148842508) set_type(2148842508, 'void AddGoatShrine__Fi(int i)') del_items(2148842612) set_type(2148842612, 'void AddCauldron__Fi(int i)') del_items(2148842716) set_type(2148842716, 'void AddMurkyFountain__Fi(int i)') del_items(2148842976) set_type(2148842976, 'void AddTearFountain__Fi(int i)') del_items(2148843080) set_type(2148843080, 'void AddDecap__Fi(int i)') del_items(2148843232) set_type(2148843232, 'void AddVilebook__Fi(int i)') del_items(2148843364) set_type(2148843364, 'void AddMagicCircle__Fi(int i)') del_items(2148843512) set_type(2148843512, 'void AddBrnCross__Fi(int i)') del_items(2148843616) set_type(2148843616, 'void AddPedistal__Fi(int i)') del_items(2148843788) set_type(2148843788, 'void AddStoryBook__Fi(int i)') del_items(2148844232) set_type(2148844232, 'void AddWeaponRack__Fi(int i)') del_items(2148844400) set_type(2148844400, 'void AddTorturedBody__Fi(int i)') del_items(2148844552) set_type(2148844552, 'void AddFlameLvr__Fi(int i)') del_items(2148844672) set_type(2148844672, 'void GetRndObjLoc__FiRiT1(int randarea, int *xx, int *yy)') del_items(2148844940) set_type(2148844940, 'void AddMushPatch__Fv()') del_items(2148845232) set_type(2148845232, 'void AddSlainHero__Fv()') del_items(2148845296) set_type(2148845296, 'unsigned char RndLocOk__Fii(int xp, int yp)') del_items(2148845524) set_type(2148845524, 'unsigned char TrapLocOk__Fii(int xp, int yp)') del_items(2148845628) set_type(2148845628, 'unsigned char RoomLocOk__Fii(int xp, int yp)') del_items(2148845780) set_type(2148845780, 'void InitRndLocObj__Fiii(int min, int max, int objtype)') del_items(2148846208) set_type(2148846208, 'void InitRndLocBigObj__Fiii(int min, int max, int objtype)') del_items(2148846712) set_type(2148846712, 'void InitRndLocObj5x5__Fiii(int min, int max, int objtype)') del_items(2148847008) set_type(2148847008, 'void SetMapObjects__FPUcii(unsigned char *pMap, int startx, int starty)') del_items(2148847716) set_type(2148847716, 'void ClrAllObjects__Fv()') del_items(2148847956) set_type(2148847956, 'void AddTortures__Fv()') del_items(2148848352) set_type(2148848352, 'void AddCandles__Fv()') del_items(2148848488) set_type(2148848488, 'void AddTrapLine__Fiiii(int min, int max, int tobjtype, int lobjtype)') del_items(2148849412) set_type(2148849412, 'void AddLeverObj__Fiiiiiiii(int lx1, int ly1, int lx2, int ly2, int x1, int y1, int x2, int y2)') del_items(2148849420) set_type(2148849420, 'void AddBookLever__Fiiiiiiiii(int lx1, int ly1, int lx2, int ly2, int x1, int y1, int x2, int y2, int msg)') del_items(2148850048) set_type(2148850048, 'void InitRndBarrels__Fv()') del_items(2148850460) set_type(2148850460, 'void AddL1Objs__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148850772) set_type(2148850772, 'void AddL2Objs__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148851048) set_type(2148851048, 'void AddL3Objs__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148851304) set_type(2148851304, 'unsigned char TorchLocOK__Fii(int xp, int yp)') del_items(2148851368) set_type(2148851368, 'void AddL2Torches__Fv()') del_items(2148851804) set_type(2148851804, 'unsigned char WallTrapLocOk__Fii(int xp, int yp)') del_items(2148851908) set_type(2148851908, 'void AddObjTraps__Fv()') del_items(2148852796) set_type(2148852796, 'void AddChestTraps__Fv()') del_items(2148853132) set_type(2148853132, 'void LoadMapObjects__FPUciiiiiii(unsigned char *pMap, int startx, int starty, int x1, int y1, int w, int h, int leveridx)') del_items(2148853496) set_type(2148853496, 'void AddDiabObjs__Fv()') del_items(2148853836) set_type(2148853836, 'void AddStoryBooks__Fv()') del_items(2148854172) set_type(2148854172, 'void AddHookedBodies__Fi(int freq)') del_items(2148854676) set_type(2148854676, 'void AddL4Goodies__Fv()') del_items(2148854852) set_type(2148854852, 'void AddLazStand__Fv()') del_items(2148855256) set_type(2148855256, 'void InitObjects__Fv()') del_items(2148856892) set_type(2148856892, 'void PreObjObjAddSwitch__Fiiii(int ot, int ox, int oy, int oi)') del_items(2148857732) set_type(2148857732, 'void FillSolidBlockTbls__Fv()') del_items(2148858196) set_type(2148858196, 'void SetDungeonMicros__Fv()') del_items(2148858204) set_type(2148858204, 'void DRLG_InitTrans__Fv()') del_items(2148858320) set_type(2148858320, 'void DRLG_MRectTrans__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148858480) set_type(2148858480, 'void DRLG_RectTrans__Fiiii(int x1, int y1, int x2, int y2)') del_items(2148858608) set_type(2148858608, 'void DRLG_CopyTrans__Fiiii(int sx, int sy, int dx, int dy)') del_items(2148858712) set_type(2148858712, 'void DRLG_ListTrans__FiPUc(int num, unsigned char *List)') del_items(2148858828) set_type(2148858828, 'void DRLG_AreaTrans__FiPUc(int num, unsigned char *List)') del_items(2148858972) set_type(2148858972, 'void DRLG_InitSetPC__Fv()') del_items(2148858996) set_type(2148858996, 'void DRLG_SetPC__Fv()') del_items(2148859172) set_type(2148859172, 'void Make_SetPC__Fiiii(int x, int y, int w, int h)') del_items(2148859332) set_type(2148859332, 'unsigned char DRLG_WillThemeRoomFit__FiiiiiPiT5(int floor, int x, int y, int minSize, int maxSize, int *width, int *height)') del_items(2148860044) set_type(2148860044, 'void DRLG_CreateThemeRoom__Fi(int themeIndex)') del_items(2148864148) set_type(2148864148, 'void DRLG_PlaceThemeRooms__FiiiiUc(int minSize, int maxSize, int floor, int freq, int rndSize)') del_items(2148864828) set_type(2148864828, 'void DRLG_HoldThemeRooms__Fv()') del_items(2148865264) set_type(2148865264, 'unsigned char SkipThemeRoom__Fii(int x, int y)') del_items(2148865468) set_type(2148865468, 'void InitLevels__Fv()') del_items(2148865728) set_type(2148865728, 'unsigned char TFit_Shrine__Fi(int i)') del_items(2148866408) set_type(2148866408, 'unsigned char TFit_Obj5__Fi(int t)') del_items(2148866904) set_type(2148866904, 'unsigned char TFit_SkelRoom__Fi(int t)') del_items(2148867080) set_type(2148867080, 'unsigned char TFit_GoatShrine__Fi(int t)') del_items(2148867232) set_type(2148867232, 'unsigned char CheckThemeObj3__Fiiii(int xp, int yp, int t, int f)') del_items(2148867596) set_type(2148867596, 'unsigned char TFit_Obj3__Fi(int t)') del_items(2148867788) set_type(2148867788, 'unsigned char CheckThemeReqs__Fi(int t)') del_items(2148867992) set_type(2148867992, 'unsigned char SpecialThemeFit__Fii(int i, int t)') del_items(2148868468) set_type(2148868468, 'unsigned char CheckThemeRoom__Fi(int tv)') del_items(2148869152) set_type(2148869152, 'void InitThemes__Fv()') del_items(2148870036) set_type(2148870036, 'void HoldThemeRooms__Fv()') del_items(2148870304) set_type(2148870304, 'void PlaceThemeMonsts__Fii(int t, int f)') del_items(2148870764) set_type(2148870764, 'void Theme_Barrel__Fi(int t)') del_items(2148871172) set_type(2148871172, 'void Theme_Shrine__Fi(int t)') del_items(2148871404) set_type(2148871404, 'void Theme_MonstPit__Fi(int t)') del_items(2148871736) set_type(2148871736, 'void Theme_SkelRoom__Fi(int t)') del_items(2148872508) set_type(2148872508, 'void Theme_Treasure__Fi(int t)') del_items(2148873148) set_type(2148873148, 'void Theme_Library__Fi(int t)') del_items(2148873772) set_type(2148873772, 'void Theme_Torture__Fi(int t)') del_items(2148874172) set_type(2148874172, 'void Theme_BloodFountain__Fi(int t)') del_items(2148874288) set_type(2148874288, 'void Theme_Decap__Fi(int t)') del_items(2148874688) set_type(2148874688, 'void Theme_PurifyingFountain__Fi(int t)') del_items(2148874804) set_type(2148874804, 'void Theme_ArmorStand__Fi(int t)') del_items(2148875244) set_type(2148875244, 'void Theme_GoatShrine__Fi(int t)') del_items(2148875612) set_type(2148875612, 'void Theme_Cauldron__Fi(int t)') del_items(2148875728) set_type(2148875728, 'void Theme_MurkyFountain__Fi(int t)') del_items(2148875844) set_type(2148875844, 'void Theme_TearFountain__Fi(int t)') del_items(2148875960) set_type(2148875960, 'void Theme_BrnCross__Fi(int t)') del_items(2148876368) set_type(2148876368, 'void Theme_WeaponRack__Fi(int t)') del_items(2148876808) set_type(2148876808, 'void UpdateL4Trans__Fv()') del_items(2148876904) set_type(2148876904, 'void CreateThemeRooms__Fv()') del_items(2148877424) set_type(2148877424, 'void InitPortals__Fv()') del_items(2148877520) set_type(2148877520, 'void InitQuests__Fv()') del_items(2148878548) set_type(2148878548, 'void DrawButcher__Fv()') del_items(2148878616) set_type(2148878616, 'void DrawSkelKing__Fiii(int q, int x, int y)') del_items(2148878756) set_type(2148878756, 'void DrawWarLord__Fii(int x, int y)') del_items(2148879120) set_type(2148879120, 'void DrawSChamber__Fiii(int q, int x, int y)') del_items(2148879584) set_type(2148879584, 'void DrawLTBanner__Fii(int x, int y)') del_items(2148879908) set_type(2148879908, 'void DrawBlind__Fii(int x, int y)') del_items(2148880232) set_type(2148880232, 'void DrawBlood__Fii(int x, int y)') del_items(2148880560) set_type(2148880560, 'void DRLG_CheckQuests__Fii(int x, int y)') del_items(2148880876) set_type(2148880876, 'void InitInv__Fv()') del_items(2148880972) set_type(2148880972, 'void InitAutomap__Fv()') del_items(2148881424) set_type(2148881424, 'void InitAutomapOnce__Fv()') del_items(2148881440) set_type(2148881440, 'unsigned char MonstPlace__Fii(int xp, int yp)') del_items(2148881628) set_type(2148881628, 'void InitMonsterGFX__Fi(int monst)') del_items(2148881892) set_type(2148881892, 'void PlaceMonster__Fiiii(int i, int mtype, int x, int y)') del_items(2148882052) set_type(2148882052, 'int AddMonsterType__Fii(int type, int placeflag)') del_items(2148882360) set_type(2148882360, 'void GetMonsterTypes__FUl(unsigned long QuestMask)') del_items(2148882536) set_type(2148882536, 'void ClrAllMonsters__Fv()') del_items(2148882856) set_type(2148882856, 'void InitLevelMonsters__Fv()') del_items(2148882988) set_type(2148882988, 'void GetLevelMTypes__Fv()') del_items(2148884084) set_type(2148884084, 'void PlaceQuestMonsters__Fv()') del_items(2148885132) set_type(2148885132, 'void LoadDiabMonsts__Fv()') del_items(2148885404) set_type(2148885404, 'void PlaceGroup__FiiUci(int mtype, int num, unsigned char leaderf, int leader)') del_items(2148886956) set_type(2148886956, 'void SetMapMonsters__FPUcii(unsigned char *pMap, int startx, int starty)') del_items(2148887504) set_type(2148887504, 'void InitMonsters__Fv()') del_items(2148888492) set_type(2148888492, 'void PlaceUniqueMonst__Fiii(int uniqindex, int miniontype, int unpackfilesize)') del_items(2148890572) set_type(2148890572, 'void PlaceUniques__Fv()') del_items(2148891024) set_type(2148891024, 'int PreSpawnSkeleton__Fv()') del_items(2148891384) set_type(2148891384, 'int encode_enemy__Fi(int m)') del_items(2148891472) set_type(2148891472, 'void decode_enemy__Fii(int m, int enemy)') del_items(2148891752) set_type(2148891752, 'unsigned char IsGoat__Fi(int mt)') del_items(2148891796) set_type(2148891796, 'void InitMissiles__Fv()') del_items(2148892336) set_type(2148892336, 'void InitNoTriggers__Fv()') del_items(2148892372) set_type(2148892372, 'void InitTownTriggers__Fv()') del_items(2148893236) set_type(2148893236, 'void InitL1Triggers__Fv()') del_items(2148893512) set_type(2148893512, 'void InitL2Triggers__Fv()') del_items(2148893912) set_type(2148893912, 'void InitL3Triggers__Fv()') del_items(2148894260) set_type(2148894260, 'void InitL4Triggers__Fv()') del_items(2148894792) set_type(2148894792, 'void InitSKingTriggers__Fv()') del_items(2148894868) set_type(2148894868, 'void InitSChambTriggers__Fv()') del_items(2148894944) set_type(2148894944, 'void InitPWaterTriggers__Fv()') del_items(2148895020) set_type(2148895020, 'void InitVPTriggers__Fv()') del_items(2148895096) set_type(2148895096, 'void InitStores__Fv()') del_items(2148895224) set_type(2148895224, 'void SetupTownStores__Fv()') del_items(2148895656) set_type(2148895656, 'void DeltaLoadLevel__Fv()') del_items(2148898856) set_type(2148898856, 'unsigned char SmithItemOk__Fi(int i)') del_items(2148898956) set_type(2148898956, 'int RndSmithItem__Fi(int lvl)') del_items(2148899224) set_type(2148899224, 'unsigned char WitchItemOk__Fi(int i)') del_items(2148899544) set_type(2148899544, 'int RndWitchItem__Fi(int lvl)') del_items(2148899800) set_type(2148899800, 'void BubbleSwapItem__FP10ItemStructT0(struct ItemStruct *a, struct ItemStruct *b)') del_items(2148900028) set_type(2148900028, 'void SortWitch__Fv()') del_items(2148900316) set_type(2148900316, 'int RndBoyItem__Fi(int lvl)') del_items(2148900608) set_type(2148900608, 'unsigned char HealerItemOk__Fi(int i)') del_items(2148901044) set_type(2148901044, 'int RndHealerItem__Fi(int lvl)') del_items(2148901300) set_type(2148901300, 'void RecreatePremiumItem__Fiiii(int ii, int idx, int plvl, int iseed)') del_items(2148901500) set_type(2148901500, 'void RecreateWitchItem__Fiiii(int ii, int idx, int lvl, int iseed)') del_items(2148901844) set_type(2148901844, 'void RecreateSmithItem__Fiiii(int ii, int idx, int lvl, int iseed)') del_items(2148902000) set_type(2148902000, 'void RecreateHealerItem__Fiiii(int ii, int idx, int lvl, int iseed)') del_items(2148902192) set_type(2148902192, 'void RecreateBoyItem__Fiiii(int ii, int idx, int lvl, int iseed)') del_items(2148902388) set_type(2148902388, 'void RecreateTownItem__FiiUsii(int ii, int idx, unsigned short icreateinfo, int iseed, int ivalue)') del_items(2148902528) set_type(2148902528, 'void SpawnSmith__Fi(int lvl)') del_items(2148902940) set_type(2148902940, 'void SpawnWitch__Fi(int lvl)') del_items(2148903816) set_type(2148903816, 'void SpawnHealer__Fi(int lvl)') del_items(2148904612) set_type(2148904612, 'void SpawnBoy__Fi(int lvl)') del_items(2148904952) set_type(2148904952, 'void SortSmith__Fv()') del_items(2148905228) set_type(2148905228, 'void SortHealer__Fv()') del_items(2148905516) set_type(2148905516, 'void RecreateItem__FiiUsii(int ii, int idx, unsigned short icreateinfo, int iseed, int ivalue)')
# -*- coding: utf-8 -*- description = "Gauss meter setup" group = "optional" tango_base = "tango://phys.maria.frm2:10000/maria" devices = dict( field = device("nicos.devices.entangle.AnalogInput", description = "Lakeshore LS455, DSP Gauss Meter", tangodevice = tango_base + "/ls455/field", ), )
description = 'Gauss meter setup' group = 'optional' tango_base = 'tango://phys.maria.frm2:10000/maria' devices = dict(field=device('nicos.devices.entangle.AnalogInput', description='Lakeshore LS455, DSP Gauss Meter', tangodevice=tango_base + '/ls455/field'))
"""Main module.""" class TemplateCollection: def __init__(self, list_of_templates): self.list_of_templates = list_of_templates def write(self, filename, header=None): with open(filename, 'w') as fi: if header: fi.write(header+"\n\n\n") for ntemp, t in enumerate(self.list_of_templates): if len(t.filled_template) == 0: print(f"warning: template {ntemp} is not filled") for ln in t.filled_template: fi.write(ln) def fill_line(ln, replace_dict): for key, val in replace_dict.items(): ln = ln.replace(key, val) return ln class Template: def __init__(self, replace_dict=None): self.line_list, self.replaceable_strings = self.empty_template() self.filled_template = [] if replace_dict: self.fill_template(replace_dict) def _validate_replace_dict(self, replace_dict: dict): for k, v in replace_dict.items(): if k not in self.replaceable_strings: raise ValueError(f"{k} is not a valid template string, please check replaceable_strings") if type(v) is not str: raise ValueError(f"{k} value must be a string") def fill_template(self, replace_dict: dict): self._validate_replace_dict(replace_dict) for ln in self.line_list: f_ln = fill_line(ln, replace_dict) self.filled_template.append(f_ln) def empty_template(self): # needs to returna the template as a list of strings and a list of strings # that are allowed to be replaced raise NotImplementedError
"""Main module.""" class Templatecollection: def __init__(self, list_of_templates): self.list_of_templates = list_of_templates def write(self, filename, header=None): with open(filename, 'w') as fi: if header: fi.write(header + '\n\n\n') for (ntemp, t) in enumerate(self.list_of_templates): if len(t.filled_template) == 0: print(f'warning: template {ntemp} is not filled') for ln in t.filled_template: fi.write(ln) def fill_line(ln, replace_dict): for (key, val) in replace_dict.items(): ln = ln.replace(key, val) return ln class Template: def __init__(self, replace_dict=None): (self.line_list, self.replaceable_strings) = self.empty_template() self.filled_template = [] if replace_dict: self.fill_template(replace_dict) def _validate_replace_dict(self, replace_dict: dict): for (k, v) in replace_dict.items(): if k not in self.replaceable_strings: raise value_error(f'{k} is not a valid template string, please check replaceable_strings') if type(v) is not str: raise value_error(f'{k} value must be a string') def fill_template(self, replace_dict: dict): self._validate_replace_dict(replace_dict) for ln in self.line_list: f_ln = fill_line(ln, replace_dict) self.filled_template.append(f_ln) def empty_template(self): raise NotImplementedError