mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-08-22 06:13:47 -07:00
Compare commits
38 commits
Author | SHA1 | Date | |
---|---|---|---|
|
6b0f8f5e03 | ||
|
8ac092ea96 | ||
|
4f4b6148d2 | ||
|
6bc100cf90 | ||
|
c52d22a70e | ||
|
3a32727c28 | ||
|
e9cdacc684 | ||
|
26d6b83356 | ||
|
6d365b0f6a | ||
|
de48ddb481 | ||
|
f1adeb7c07 |
||
|
dc5dc27ff3 | ||
|
b7d1a40e70 | ||
|
d7f0b36dc1 | ||
|
a2bb0f4129 | ||
|
591d0be758 | ||
|
6b438e0b9a | ||
|
bdd06aa0b7 | ||
|
c0b1a43141 | ||
|
7c915822bf | ||
|
8ff8498a22 | ||
|
aa5450538b | ||
|
de7d7c7722 | ||
|
cfea1967ab | ||
|
f9b49002c7 | ||
|
127ad7e14a | ||
|
6b76dfbe66 | ||
|
4215f7ab74 | ||
|
5098643b77 | ||
|
66b8d1f72a |
||
|
627ce8a867 |
||
|
39063d7831 |
||
|
1e94b00b13 |
||
|
fbf764f4fb |
||
|
28fbd13ef6 |
||
|
1b54b35f52 | ||
|
57585a9e0b | ||
|
e6d7753dc8 |
874 changed files with 6981 additions and 52032 deletions
871
.editorconfig
Normal file
871
.editorconfig
Normal file
|
@ -0,0 +1,871 @@
|
|||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
max_line_length = 600
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
ij_continuation_indent_size = 8
|
||||
ij_formatter_off_tag = @formatter:off
|
||||
ij_formatter_on_tag = @formatter:on
|
||||
ij_formatter_tags_enabled = false
|
||||
ij_smart_tabs = false
|
||||
ij_visual_guides = none
|
||||
ij_wrap_on_typing = false
|
||||
|
||||
[*.blade.php]
|
||||
ij_blade_keep_indents_on_empty_lines = false
|
||||
|
||||
[*.css]
|
||||
ij_css_align_closing_brace_with_properties = false
|
||||
ij_css_blank_lines_around_nested_selector = 1
|
||||
ij_css_blank_lines_between_blocks = 1
|
||||
ij_css_brace_placement = end_of_line
|
||||
ij_css_enforce_quotes_on_format = false
|
||||
ij_css_hex_color_long_format = true
|
||||
ij_css_hex_color_lower_case = false
|
||||
ij_css_hex_color_short_format = false
|
||||
ij_css_hex_color_upper_case = true
|
||||
ij_css_keep_blank_lines_in_code = 2
|
||||
ij_css_keep_indents_on_empty_lines = false
|
||||
ij_css_keep_single_line_blocks = false
|
||||
ij_css_properties_order = position,display,visibility,float,clear,top,right,bottom,left,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,order,z-index,width,height,min-width,min-height,max-width,max-height,box-sizing,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,overflow,overflow-x,overflow-y,content,resize,opacity,outline,outline-width,outline-style,outline-color,outline-offset,box-decoration-break,box-shadow,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,background,background-color,background-image,background-position,background-position-x,background-position-y,background-size,background-repeat,background-origin,background-clip,background-attachment,scroll-behavior,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,letter-spacing,word-spacing,tab-size,align-content,align-items,align-self,text-align,text-align-last,text-indent,text-justify,justify-content,vertical-align,color,text-shadow,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,quotes,user-select,white-space,word-wrap,word-break,hyphens,list-style,list-style-position,list-style-type,list-style-image,table-layout,empty-cells,caption-side,border-spacing,border-collapse,nav-index,nav-left,nav-up,nav-right,nav-down,zoom,counter-reset,counter-increment,cursor,pointer-events
|
||||
ij_css_space_after_colon = true
|
||||
ij_css_space_before_opening_brace = true
|
||||
ij_css_use_double_quotes = true
|
||||
ij_css_value_alignment = do_not_align
|
||||
|
||||
[*.feature]
|
||||
indent_size = 2
|
||||
ij_gherkin_keep_indents_on_empty_lines = false
|
||||
|
||||
[*.haml]
|
||||
indent_size = 2
|
||||
ij_haml_keep_indents_on_empty_lines = false
|
||||
|
||||
[*.less]
|
||||
indent_size = 2
|
||||
ij_less_align_closing_brace_with_properties = false
|
||||
ij_less_blank_lines_around_nested_selector = 1
|
||||
ij_less_blank_lines_between_blocks = 1
|
||||
ij_less_brace_placement = 0
|
||||
ij_less_enforce_quotes_on_format = false
|
||||
ij_less_hex_color_long_format = true
|
||||
ij_less_hex_color_lower_case = false
|
||||
ij_less_hex_color_short_format = false
|
||||
ij_less_hex_color_upper_case = true
|
||||
ij_less_keep_blank_lines_in_code = 2
|
||||
ij_less_keep_indents_on_empty_lines = false
|
||||
ij_less_keep_single_line_blocks = false
|
||||
ij_less_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
|
||||
ij_less_space_after_colon = true
|
||||
ij_less_space_before_opening_brace = true
|
||||
ij_less_use_double_quotes = true
|
||||
ij_less_value_alignment = 0
|
||||
|
||||
[*.sass]
|
||||
indent_size = 2
|
||||
ij_sass_align_closing_brace_with_properties = false
|
||||
ij_sass_blank_lines_around_nested_selector = 1
|
||||
ij_sass_blank_lines_between_blocks = 1
|
||||
ij_sass_brace_placement = 0
|
||||
ij_sass_enforce_quotes_on_format = false
|
||||
ij_sass_hex_color_long_format = false
|
||||
ij_sass_hex_color_lower_case = false
|
||||
ij_sass_hex_color_short_format = false
|
||||
ij_sass_hex_color_upper_case = false
|
||||
ij_sass_keep_blank_lines_in_code = 2
|
||||
ij_sass_keep_indents_on_empty_lines = false
|
||||
ij_sass_keep_single_line_blocks = false
|
||||
ij_sass_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
|
||||
ij_sass_space_after_colon = true
|
||||
ij_sass_space_before_opening_brace = true
|
||||
ij_sass_use_double_quotes = true
|
||||
ij_sass_value_alignment = 0
|
||||
|
||||
[*.scss]
|
||||
ij_scss_align_closing_brace_with_properties = false
|
||||
ij_scss_blank_lines_around_nested_selector = 1
|
||||
ij_scss_blank_lines_between_blocks = 1
|
||||
ij_scss_brace_placement = 0
|
||||
ij_scss_enforce_quotes_on_format = false
|
||||
ij_scss_hex_color_long_format = true
|
||||
ij_scss_hex_color_lower_case = false
|
||||
ij_scss_hex_color_short_format = false
|
||||
ij_scss_hex_color_upper_case = true
|
||||
ij_scss_keep_blank_lines_in_code = 1
|
||||
ij_scss_keep_indents_on_empty_lines = false
|
||||
ij_scss_keep_single_line_blocks = false
|
||||
ij_scss_properties_order = position,display,visibility,float,clear,top,right,bottom,left,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,order,z-index,width,height,min-width,min-height,max-width,max-height,box-sizing,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,overflow,overflow-x,overflow-y,content,resize,opacity,outline,outline-width,outline-style,outline-color,outline-offset,box-decoration-break,box-shadow,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,background,background-color,background-image,background-position,background-position-x,background-position-y,background-size,background-repeat,background-origin,background-clip,background-attachment,scroll-behavior,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,letter-spacing,word-spacing,tab-size,align-content,align-items,align-self,text-align,text-align-last,text-indent,text-justify,justify-content,vertical-align,color,text-shadow,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,quotes,user-select,white-space,word-wrap,word-break,hyphens,list-style,list-style-position,list-style-type,list-style-image,table-layout,empty-cells,caption-side,border-spacing,border-collapse,nav-index,nav-left,nav-up,nav-right,nav-down,zoom,counter-reset,counter-increment,cursor,pointer-events
|
||||
ij_scss_space_after_colon = true
|
||||
ij_scss_space_before_opening_brace = true
|
||||
ij_scss_use_double_quotes = true
|
||||
ij_scss_value_alignment = 0
|
||||
|
||||
[*.twig]
|
||||
ij_twig_keep_indents_on_empty_lines = false
|
||||
ij_twig_spaces_inside_comments_delimiters = true
|
||||
ij_twig_spaces_inside_delimiters = true
|
||||
ij_twig_spaces_inside_variable_delimiters = true
|
||||
|
||||
[*.vue]
|
||||
ij_continuation_indent_size = 4
|
||||
ij_vue_indent_children_of_top_level = template
|
||||
ij_vue_interpolation_new_line_after_start_delimiter = true
|
||||
ij_vue_interpolation_new_line_before_end_delimiter = true
|
||||
ij_vue_interpolation_wrap = off
|
||||
ij_vue_keep_indents_on_empty_lines = false
|
||||
ij_vue_spaces_within_interpolation_expressions = true
|
||||
|
||||
[.editorconfig]
|
||||
ij_editorconfig_align_group_field_declarations = false
|
||||
ij_editorconfig_space_after_colon = false
|
||||
ij_editorconfig_space_after_comma = true
|
||||
ij_editorconfig_space_before_colon = false
|
||||
ij_editorconfig_space_before_comma = false
|
||||
ij_editorconfig_spaces_around_assignment_operators = true
|
||||
|
||||
[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.rng,*.tld,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul,phpunit.xml.dist}]
|
||||
ij_xml_align_attributes = true
|
||||
ij_xml_align_text = false
|
||||
ij_xml_attribute_wrap = normal
|
||||
ij_xml_block_comment_at_first_column = true
|
||||
ij_xml_keep_blank_lines = 2
|
||||
ij_xml_keep_indents_on_empty_lines = false
|
||||
ij_xml_keep_line_breaks = true
|
||||
ij_xml_keep_line_breaks_in_text = true
|
||||
ij_xml_keep_whitespaces = false
|
||||
ij_xml_keep_whitespaces_around_cdata = preserve
|
||||
ij_xml_keep_whitespaces_inside_cdata = false
|
||||
ij_xml_line_comment_at_first_column = true
|
||||
ij_xml_space_after_tag_name = false
|
||||
ij_xml_space_around_equals_in_attribute = false
|
||||
ij_xml_space_inside_empty_tag = false
|
||||
ij_xml_text_wrap = normal
|
||||
|
||||
[{*.ats,*.ts}]
|
||||
ij_continuation_indent_size = 4
|
||||
ij_typescript_align_imports = false
|
||||
ij_typescript_align_multiline_array_initializer_expression = false
|
||||
ij_typescript_align_multiline_binary_operation = false
|
||||
ij_typescript_align_multiline_chained_methods = false
|
||||
ij_typescript_align_multiline_extends_list = false
|
||||
ij_typescript_align_multiline_for = true
|
||||
ij_typescript_align_multiline_parameters = true
|
||||
ij_typescript_align_multiline_parameters_in_calls = false
|
||||
ij_typescript_align_multiline_ternary_operation = false
|
||||
ij_typescript_align_object_properties = 0
|
||||
ij_typescript_align_union_types = false
|
||||
ij_typescript_align_var_statements = 0
|
||||
ij_typescript_array_initializer_new_line_after_left_brace = false
|
||||
ij_typescript_array_initializer_right_brace_on_new_line = false
|
||||
ij_typescript_array_initializer_wrap = off
|
||||
ij_typescript_assignment_wrap = off
|
||||
ij_typescript_binary_operation_sign_on_next_line = false
|
||||
ij_typescript_binary_operation_wrap = off
|
||||
ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/**
|
||||
ij_typescript_blank_lines_after_imports = 1
|
||||
ij_typescript_blank_lines_around_class = 1
|
||||
ij_typescript_blank_lines_around_field = 0
|
||||
ij_typescript_blank_lines_around_field_in_interface = 0
|
||||
ij_typescript_blank_lines_around_function = 1
|
||||
ij_typescript_blank_lines_around_method = 1
|
||||
ij_typescript_blank_lines_around_method_in_interface = 1
|
||||
ij_typescript_block_brace_style = end_of_line
|
||||
ij_typescript_call_parameters_new_line_after_left_paren = false
|
||||
ij_typescript_call_parameters_right_paren_on_new_line = false
|
||||
ij_typescript_call_parameters_wrap = off
|
||||
ij_typescript_catch_on_new_line = false
|
||||
ij_typescript_chained_call_dot_on_new_line = true
|
||||
ij_typescript_class_brace_style = end_of_line
|
||||
ij_typescript_comma_on_new_line = false
|
||||
ij_typescript_do_while_brace_force = never
|
||||
ij_typescript_else_on_new_line = false
|
||||
ij_typescript_enforce_trailing_comma = keep
|
||||
ij_typescript_extends_keyword_wrap = off
|
||||
ij_typescript_extends_list_wrap = off
|
||||
ij_typescript_field_prefix = _
|
||||
ij_typescript_file_name_style = relaxed
|
||||
ij_typescript_finally_on_new_line = false
|
||||
ij_typescript_for_brace_force = never
|
||||
ij_typescript_for_statement_new_line_after_left_paren = false
|
||||
ij_typescript_for_statement_right_paren_on_new_line = false
|
||||
ij_typescript_for_statement_wrap = off
|
||||
ij_typescript_force_quote_style = false
|
||||
ij_typescript_force_semicolon_style = false
|
||||
ij_typescript_function_expression_brace_style = end_of_line
|
||||
ij_typescript_if_brace_force = never
|
||||
ij_typescript_import_merge_members = global
|
||||
ij_typescript_import_prefer_absolute_path = global
|
||||
ij_typescript_import_sort_members = true
|
||||
ij_typescript_import_sort_module_name = false
|
||||
ij_typescript_import_use_node_resolution = true
|
||||
ij_typescript_imports_wrap = on_every_item
|
||||
ij_typescript_indent_case_from_switch = true
|
||||
ij_typescript_indent_chained_calls = true
|
||||
ij_typescript_indent_package_children = 0
|
||||
ij_typescript_jsdoc_include_types = false
|
||||
ij_typescript_jsx_attribute_value = braces
|
||||
ij_typescript_keep_blank_lines_in_code = 2
|
||||
ij_typescript_keep_first_column_comment = true
|
||||
ij_typescript_keep_indents_on_empty_lines = false
|
||||
ij_typescript_keep_line_breaks = true
|
||||
ij_typescript_keep_simple_blocks_in_one_line = false
|
||||
ij_typescript_keep_simple_methods_in_one_line = false
|
||||
ij_typescript_line_comment_add_space = true
|
||||
ij_typescript_line_comment_at_first_column = false
|
||||
ij_typescript_method_brace_style = end_of_line
|
||||
ij_typescript_method_call_chain_wrap = off
|
||||
ij_typescript_method_parameters_new_line_after_left_paren = false
|
||||
ij_typescript_method_parameters_right_paren_on_new_line = false
|
||||
ij_typescript_method_parameters_wrap = off
|
||||
ij_typescript_object_literal_wrap = on_every_item
|
||||
ij_typescript_parentheses_expression_new_line_after_left_paren = false
|
||||
ij_typescript_parentheses_expression_right_paren_on_new_line = false
|
||||
ij_typescript_place_assignment_sign_on_next_line = false
|
||||
ij_typescript_prefer_as_type_cast = false
|
||||
ij_typescript_prefer_explicit_types_function_expression_returns = false
|
||||
ij_typescript_prefer_explicit_types_function_returns = false
|
||||
ij_typescript_prefer_explicit_types_vars_fields = false
|
||||
ij_typescript_prefer_parameters_wrap = false
|
||||
ij_typescript_reformat_c_style_comments = false
|
||||
ij_typescript_space_after_colon = true
|
||||
ij_typescript_space_after_comma = true
|
||||
ij_typescript_space_after_dots_in_rest_parameter = false
|
||||
ij_typescript_space_after_generator_mult = true
|
||||
ij_typescript_space_after_property_colon = true
|
||||
ij_typescript_space_after_quest = true
|
||||
ij_typescript_space_after_type_colon = true
|
||||
ij_typescript_space_after_unary_not = false
|
||||
ij_typescript_space_before_async_arrow_lparen = true
|
||||
ij_typescript_space_before_catch_keyword = true
|
||||
ij_typescript_space_before_catch_left_brace = true
|
||||
ij_typescript_space_before_catch_parentheses = true
|
||||
ij_typescript_space_before_class_lbrace = true
|
||||
ij_typescript_space_before_class_left_brace = true
|
||||
ij_typescript_space_before_colon = true
|
||||
ij_typescript_space_before_comma = false
|
||||
ij_typescript_space_before_do_left_brace = true
|
||||
ij_typescript_space_before_else_keyword = true
|
||||
ij_typescript_space_before_else_left_brace = true
|
||||
ij_typescript_space_before_finally_keyword = true
|
||||
ij_typescript_space_before_finally_left_brace = true
|
||||
ij_typescript_space_before_for_left_brace = true
|
||||
ij_typescript_space_before_for_parentheses = true
|
||||
ij_typescript_space_before_for_semicolon = false
|
||||
ij_typescript_space_before_function_left_parenth = true
|
||||
ij_typescript_space_before_generator_mult = false
|
||||
ij_typescript_space_before_if_left_brace = true
|
||||
ij_typescript_space_before_if_parentheses = true
|
||||
ij_typescript_space_before_method_call_parentheses = false
|
||||
ij_typescript_space_before_method_left_brace = true
|
||||
ij_typescript_space_before_method_parentheses = false
|
||||
ij_typescript_space_before_property_colon = false
|
||||
ij_typescript_space_before_quest = true
|
||||
ij_typescript_space_before_switch_left_brace = true
|
||||
ij_typescript_space_before_switch_parentheses = true
|
||||
ij_typescript_space_before_try_left_brace = true
|
||||
ij_typescript_space_before_type_colon = false
|
||||
ij_typescript_space_before_unary_not = false
|
||||
ij_typescript_space_before_while_keyword = true
|
||||
ij_typescript_space_before_while_left_brace = true
|
||||
ij_typescript_space_before_while_parentheses = true
|
||||
ij_typescript_spaces_around_additive_operators = true
|
||||
ij_typescript_spaces_around_arrow_function_operator = true
|
||||
ij_typescript_spaces_around_assignment_operators = true
|
||||
ij_typescript_spaces_around_bitwise_operators = true
|
||||
ij_typescript_spaces_around_equality_operators = true
|
||||
ij_typescript_spaces_around_logical_operators = true
|
||||
ij_typescript_spaces_around_multiplicative_operators = true
|
||||
ij_typescript_spaces_around_relational_operators = true
|
||||
ij_typescript_spaces_around_shift_operators = true
|
||||
ij_typescript_spaces_around_unary_operator = false
|
||||
ij_typescript_spaces_within_array_initializer_brackets = false
|
||||
ij_typescript_spaces_within_brackets = false
|
||||
ij_typescript_spaces_within_catch_parentheses = false
|
||||
ij_typescript_spaces_within_for_parentheses = false
|
||||
ij_typescript_spaces_within_if_parentheses = false
|
||||
ij_typescript_spaces_within_imports = false
|
||||
ij_typescript_spaces_within_interpolation_expressions = false
|
||||
ij_typescript_spaces_within_method_call_parentheses = false
|
||||
ij_typescript_spaces_within_method_parentheses = false
|
||||
ij_typescript_spaces_within_object_literal_braces = false
|
||||
ij_typescript_spaces_within_object_type_braces = true
|
||||
ij_typescript_spaces_within_parentheses = false
|
||||
ij_typescript_spaces_within_switch_parentheses = false
|
||||
ij_typescript_spaces_within_type_assertion = false
|
||||
ij_typescript_spaces_within_union_types = true
|
||||
ij_typescript_spaces_within_while_parentheses = false
|
||||
ij_typescript_special_else_if_treatment = true
|
||||
ij_typescript_ternary_operation_signs_on_next_line = false
|
||||
ij_typescript_ternary_operation_wrap = off
|
||||
ij_typescript_union_types_wrap = on_every_item
|
||||
ij_typescript_use_chained_calls_group_indents = false
|
||||
ij_typescript_use_double_quotes = true
|
||||
ij_typescript_use_explicit_js_extension = global
|
||||
ij_typescript_use_path_mapping = always
|
||||
ij_typescript_use_public_modifier = false
|
||||
ij_typescript_use_semicolon_after_statement = true
|
||||
ij_typescript_var_declaration_wrap = normal
|
||||
ij_typescript_while_brace_force = never
|
||||
ij_typescript_while_on_new_line = false
|
||||
ij_typescript_wrap_comments = false
|
||||
|
||||
[{*.bash,*.sh,*.zsh}]
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
ij_shell_binary_ops_start_line = false
|
||||
ij_shell_keep_column_alignment_padding = false
|
||||
ij_shell_minify_program = false
|
||||
ij_shell_redirect_followed_by_space = false
|
||||
ij_shell_switch_cases_indented = false
|
||||
ij_shell_use_unix_line_separator = true
|
||||
|
||||
[{*.cjs,*.js}]
|
||||
ij_continuation_indent_size = 4
|
||||
ij_javascript_align_imports = false
|
||||
ij_javascript_align_multiline_array_initializer_expression = false
|
||||
ij_javascript_align_multiline_binary_operation = false
|
||||
ij_javascript_align_multiline_chained_methods = false
|
||||
ij_javascript_align_multiline_extends_list = false
|
||||
ij_javascript_align_multiline_for = true
|
||||
ij_javascript_align_multiline_parameters = true
|
||||
ij_javascript_align_multiline_parameters_in_calls = false
|
||||
ij_javascript_align_multiline_ternary_operation = false
|
||||
ij_javascript_align_object_properties = 0
|
||||
ij_javascript_align_union_types = false
|
||||
ij_javascript_align_var_statements = 0
|
||||
ij_javascript_array_initializer_new_line_after_left_brace = true
|
||||
ij_javascript_array_initializer_right_brace_on_new_line = false
|
||||
ij_javascript_array_initializer_wrap = on_every_item
|
||||
ij_javascript_assignment_wrap = off
|
||||
ij_javascript_binary_operation_sign_on_next_line = false
|
||||
ij_javascript_binary_operation_wrap = normal
|
||||
ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/**
|
||||
ij_javascript_blank_lines_after_imports = 1
|
||||
ij_javascript_blank_lines_around_class = 1
|
||||
ij_javascript_blank_lines_around_field = 0
|
||||
ij_javascript_blank_lines_around_function = 1
|
||||
ij_javascript_blank_lines_around_method = 1
|
||||
ij_javascript_block_brace_style = end_of_line
|
||||
ij_javascript_call_parameters_new_line_after_left_paren = false
|
||||
ij_javascript_call_parameters_right_paren_on_new_line = false
|
||||
ij_javascript_call_parameters_wrap = normal
|
||||
ij_javascript_catch_on_new_line = false
|
||||
ij_javascript_chained_call_dot_on_new_line = true
|
||||
ij_javascript_class_brace_style = end_of_line
|
||||
ij_javascript_comma_on_new_line = false
|
||||
ij_javascript_do_while_brace_force = never
|
||||
ij_javascript_else_on_new_line = false
|
||||
ij_javascript_enforce_trailing_comma = whenmultiline
|
||||
ij_javascript_extends_keyword_wrap = off
|
||||
ij_javascript_extends_list_wrap = off
|
||||
ij_javascript_field_prefix = _
|
||||
ij_javascript_file_name_style = relaxed
|
||||
ij_javascript_finally_on_new_line = false
|
||||
ij_javascript_for_brace_force = never
|
||||
ij_javascript_for_statement_new_line_after_left_paren = false
|
||||
ij_javascript_for_statement_right_paren_on_new_line = false
|
||||
ij_javascript_for_statement_wrap = off
|
||||
ij_javascript_force_quote_style = true
|
||||
ij_javascript_force_semicolon_style = true
|
||||
ij_javascript_function_expression_brace_style = end_of_line
|
||||
ij_javascript_if_brace_force = never
|
||||
ij_javascript_import_merge_members = global
|
||||
ij_javascript_import_prefer_absolute_path = global
|
||||
ij_javascript_import_sort_members = true
|
||||
ij_javascript_import_sort_module_name = false
|
||||
ij_javascript_import_use_node_resolution = true
|
||||
ij_javascript_imports_wrap = on_every_item
|
||||
ij_javascript_indent_case_from_switch = true
|
||||
ij_javascript_indent_chained_calls = true
|
||||
ij_javascript_indent_package_children = 0
|
||||
ij_javascript_jsx_attribute_value = braces
|
||||
ij_javascript_keep_blank_lines_in_code = 1
|
||||
ij_javascript_keep_first_column_comment = true
|
||||
ij_javascript_keep_indents_on_empty_lines = false
|
||||
ij_javascript_keep_line_breaks = true
|
||||
ij_javascript_keep_simple_blocks_in_one_line = false
|
||||
ij_javascript_keep_simple_methods_in_one_line = false
|
||||
ij_javascript_line_comment_add_space = true
|
||||
ij_javascript_line_comment_at_first_column = false
|
||||
ij_javascript_method_brace_style = end_of_line
|
||||
ij_javascript_method_call_chain_wrap = on_every_item
|
||||
ij_javascript_method_parameters_new_line_after_left_paren = true
|
||||
ij_javascript_method_parameters_right_paren_on_new_line = false
|
||||
ij_javascript_method_parameters_wrap = normal
|
||||
ij_javascript_object_literal_wrap = on_every_item
|
||||
ij_javascript_parentheses_expression_new_line_after_left_paren = false
|
||||
ij_javascript_parentheses_expression_right_paren_on_new_line = false
|
||||
ij_javascript_place_assignment_sign_on_next_line = false
|
||||
ij_javascript_prefer_as_type_cast = false
|
||||
ij_javascript_prefer_explicit_types_function_expression_returns = false
|
||||
ij_javascript_prefer_explicit_types_function_returns = false
|
||||
ij_javascript_prefer_explicit_types_vars_fields = false
|
||||
ij_javascript_prefer_parameters_wrap = false
|
||||
ij_javascript_reformat_c_style_comments = false
|
||||
ij_javascript_space_after_colon = true
|
||||
ij_javascript_space_after_comma = true
|
||||
ij_javascript_space_after_dots_in_rest_parameter = false
|
||||
ij_javascript_space_after_generator_mult = true
|
||||
ij_javascript_space_after_property_colon = true
|
||||
ij_javascript_space_after_quest = true
|
||||
ij_javascript_space_after_type_colon = true
|
||||
ij_javascript_space_after_unary_not = false
|
||||
ij_javascript_space_before_async_arrow_lparen = true
|
||||
ij_javascript_space_before_catch_keyword = true
|
||||
ij_javascript_space_before_catch_left_brace = true
|
||||
ij_javascript_space_before_catch_parentheses = true
|
||||
ij_javascript_space_before_class_lbrace = true
|
||||
ij_javascript_space_before_class_left_brace = true
|
||||
ij_javascript_space_before_colon = true
|
||||
ij_javascript_space_before_comma = false
|
||||
ij_javascript_space_before_do_left_brace = true
|
||||
ij_javascript_space_before_else_keyword = true
|
||||
ij_javascript_space_before_else_left_brace = true
|
||||
ij_javascript_space_before_finally_keyword = true
|
||||
ij_javascript_space_before_finally_left_brace = true
|
||||
ij_javascript_space_before_for_left_brace = true
|
||||
ij_javascript_space_before_for_parentheses = true
|
||||
ij_javascript_space_before_for_semicolon = false
|
||||
ij_javascript_space_before_function_left_parenth = false
|
||||
ij_javascript_space_before_generator_mult = false
|
||||
ij_javascript_space_before_if_left_brace = true
|
||||
ij_javascript_space_before_if_parentheses = true
|
||||
ij_javascript_space_before_method_call_parentheses = false
|
||||
ij_javascript_space_before_method_left_brace = true
|
||||
ij_javascript_space_before_method_parentheses = false
|
||||
ij_javascript_space_before_property_colon = false
|
||||
ij_javascript_space_before_quest = true
|
||||
ij_javascript_space_before_switch_left_brace = true
|
||||
ij_javascript_space_before_switch_parentheses = true
|
||||
ij_javascript_space_before_try_left_brace = true
|
||||
ij_javascript_space_before_type_colon = false
|
||||
ij_javascript_space_before_unary_not = false
|
||||
ij_javascript_space_before_while_keyword = true
|
||||
ij_javascript_space_before_while_left_brace = true
|
||||
ij_javascript_space_before_while_parentheses = true
|
||||
ij_javascript_spaces_around_additive_operators = true
|
||||
ij_javascript_spaces_around_arrow_function_operator = true
|
||||
ij_javascript_spaces_around_assignment_operators = true
|
||||
ij_javascript_spaces_around_bitwise_operators = true
|
||||
ij_javascript_spaces_around_equality_operators = true
|
||||
ij_javascript_spaces_around_logical_operators = true
|
||||
ij_javascript_spaces_around_multiplicative_operators = true
|
||||
ij_javascript_spaces_around_relational_operators = true
|
||||
ij_javascript_spaces_around_shift_operators = true
|
||||
ij_javascript_spaces_around_unary_operator = false
|
||||
ij_javascript_spaces_within_array_initializer_brackets = false
|
||||
ij_javascript_spaces_within_brackets = false
|
||||
ij_javascript_spaces_within_catch_parentheses = false
|
||||
ij_javascript_spaces_within_for_parentheses = false
|
||||
ij_javascript_spaces_within_if_parentheses = false
|
||||
ij_javascript_spaces_within_imports = false
|
||||
ij_javascript_spaces_within_interpolation_expressions = false
|
||||
ij_javascript_spaces_within_method_call_parentheses = false
|
||||
ij_javascript_spaces_within_method_parentheses = false
|
||||
ij_javascript_spaces_within_object_literal_braces = true
|
||||
ij_javascript_spaces_within_object_type_braces = true
|
||||
ij_javascript_spaces_within_parentheses = false
|
||||
ij_javascript_spaces_within_switch_parentheses = false
|
||||
ij_javascript_spaces_within_type_assertion = false
|
||||
ij_javascript_spaces_within_union_types = true
|
||||
ij_javascript_spaces_within_while_parentheses = false
|
||||
ij_javascript_special_else_if_treatment = true
|
||||
ij_javascript_ternary_operation_signs_on_next_line = false
|
||||
ij_javascript_ternary_operation_wrap = on_every_item
|
||||
ij_javascript_union_types_wrap = on_every_item
|
||||
ij_javascript_use_chained_calls_group_indents = false
|
||||
ij_javascript_use_double_quotes = false
|
||||
ij_javascript_use_explicit_js_extension = global
|
||||
ij_javascript_use_path_mapping = always
|
||||
ij_javascript_use_public_modifier = false
|
||||
ij_javascript_use_semicolon_after_statement = true
|
||||
ij_javascript_var_declaration_wrap = normal
|
||||
ij_javascript_while_brace_force = never
|
||||
ij_javascript_while_on_new_line = false
|
||||
ij_javascript_wrap_comments = false
|
||||
|
||||
[{*.cjsx,*.coffee}]
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
ij_continuation_indent_size = 2
|
||||
ij_coffeescript_align_function_body = false
|
||||
ij_coffeescript_align_imports = false
|
||||
ij_coffeescript_align_multiline_array_initializer_expression = true
|
||||
ij_coffeescript_align_multiline_parameters = true
|
||||
ij_coffeescript_align_multiline_parameters_in_calls = false
|
||||
ij_coffeescript_align_object_properties = 0
|
||||
ij_coffeescript_align_union_types = false
|
||||
ij_coffeescript_align_var_statements = 0
|
||||
ij_coffeescript_array_initializer_new_line_after_left_brace = false
|
||||
ij_coffeescript_array_initializer_right_brace_on_new_line = false
|
||||
ij_coffeescript_array_initializer_wrap = normal
|
||||
ij_coffeescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/**
|
||||
ij_coffeescript_blank_lines_around_function = 1
|
||||
ij_coffeescript_call_parameters_new_line_after_left_paren = false
|
||||
ij_coffeescript_call_parameters_right_paren_on_new_line = false
|
||||
ij_coffeescript_call_parameters_wrap = normal
|
||||
ij_coffeescript_chained_call_dot_on_new_line = true
|
||||
ij_coffeescript_comma_on_new_line = false
|
||||
ij_coffeescript_enforce_trailing_comma = keep
|
||||
ij_coffeescript_field_prefix = _
|
||||
ij_coffeescript_file_name_style = relaxed
|
||||
ij_coffeescript_force_quote_style = false
|
||||
ij_coffeescript_force_semicolon_style = false
|
||||
ij_coffeescript_function_expression_brace_style = end_of_line
|
||||
ij_coffeescript_import_merge_members = global
|
||||
ij_coffeescript_import_prefer_absolute_path = global
|
||||
ij_coffeescript_import_sort_members = true
|
||||
ij_coffeescript_import_sort_module_name = false
|
||||
ij_coffeescript_import_use_node_resolution = true
|
||||
ij_coffeescript_imports_wrap = on_every_item
|
||||
ij_coffeescript_indent_chained_calls = true
|
||||
ij_coffeescript_indent_package_children = 0
|
||||
ij_coffeescript_jsx_attribute_value = braces
|
||||
ij_coffeescript_keep_blank_lines_in_code = 2
|
||||
ij_coffeescript_keep_first_column_comment = true
|
||||
ij_coffeescript_keep_indents_on_empty_lines = false
|
||||
ij_coffeescript_keep_line_breaks = true
|
||||
ij_coffeescript_keep_simple_methods_in_one_line = false
|
||||
ij_coffeescript_method_parameters_new_line_after_left_paren = false
|
||||
ij_coffeescript_method_parameters_right_paren_on_new_line = false
|
||||
ij_coffeescript_method_parameters_wrap = off
|
||||
ij_coffeescript_object_literal_wrap = on_every_item
|
||||
ij_coffeescript_prefer_as_type_cast = false
|
||||
ij_coffeescript_prefer_explicit_types_function_expression_returns = false
|
||||
ij_coffeescript_prefer_explicit_types_function_returns = false
|
||||
ij_coffeescript_prefer_explicit_types_vars_fields = false
|
||||
ij_coffeescript_reformat_c_style_comments = false
|
||||
ij_coffeescript_space_after_comma = true
|
||||
ij_coffeescript_space_after_dots_in_rest_parameter = false
|
||||
ij_coffeescript_space_after_generator_mult = true
|
||||
ij_coffeescript_space_after_property_colon = true
|
||||
ij_coffeescript_space_after_type_colon = true
|
||||
ij_coffeescript_space_after_unary_not = false
|
||||
ij_coffeescript_space_before_async_arrow_lparen = true
|
||||
ij_coffeescript_space_before_class_lbrace = true
|
||||
ij_coffeescript_space_before_comma = false
|
||||
ij_coffeescript_space_before_function_left_parenth = true
|
||||
ij_coffeescript_space_before_generator_mult = false
|
||||
ij_coffeescript_space_before_property_colon = false
|
||||
ij_coffeescript_space_before_type_colon = false
|
||||
ij_coffeescript_space_before_unary_not = false
|
||||
ij_coffeescript_spaces_around_additive_operators = true
|
||||
ij_coffeescript_spaces_around_arrow_function_operator = true
|
||||
ij_coffeescript_spaces_around_assignment_operators = true
|
||||
ij_coffeescript_spaces_around_bitwise_operators = true
|
||||
ij_coffeescript_spaces_around_equality_operators = true
|
||||
ij_coffeescript_spaces_around_logical_operators = true
|
||||
ij_coffeescript_spaces_around_multiplicative_operators = true
|
||||
ij_coffeescript_spaces_around_relational_operators = true
|
||||
ij_coffeescript_spaces_around_shift_operators = true
|
||||
ij_coffeescript_spaces_around_unary_operator = false
|
||||
ij_coffeescript_spaces_within_array_initializer_braces = false
|
||||
ij_coffeescript_spaces_within_array_initializer_brackets = false
|
||||
ij_coffeescript_spaces_within_imports = false
|
||||
ij_coffeescript_spaces_within_index_brackets = false
|
||||
ij_coffeescript_spaces_within_interpolation_expressions = false
|
||||
ij_coffeescript_spaces_within_method_call_parentheses = false
|
||||
ij_coffeescript_spaces_within_method_parentheses = false
|
||||
ij_coffeescript_spaces_within_object_braces = false
|
||||
ij_coffeescript_spaces_within_object_literal_braces = false
|
||||
ij_coffeescript_spaces_within_object_type_braces = true
|
||||
ij_coffeescript_spaces_within_range_brackets = false
|
||||
ij_coffeescript_spaces_within_type_assertion = false
|
||||
ij_coffeescript_spaces_within_union_types = true
|
||||
ij_coffeescript_union_types_wrap = on_every_item
|
||||
ij_coffeescript_use_chained_calls_group_indents = false
|
||||
ij_coffeescript_use_double_quotes = true
|
||||
ij_coffeescript_use_explicit_js_extension = global
|
||||
ij_coffeescript_use_path_mapping = always
|
||||
ij_coffeescript_use_public_modifier = false
|
||||
ij_coffeescript_use_semicolon_after_statement = false
|
||||
ij_coffeescript_var_declaration_wrap = normal
|
||||
|
||||
[{*.ctp,*.hphp,*.inc,*.module,*.php,*.php4,*.php5,*.phtml,yii_te}]
|
||||
ij_continuation_indent_size = 4
|
||||
ij_php_align_assignments = false
|
||||
ij_php_align_class_constants = false
|
||||
ij_php_align_group_field_declarations = false
|
||||
ij_php_align_inline_comments = false
|
||||
ij_php_align_key_value_pairs = false
|
||||
ij_php_align_match_arm_bodies = false
|
||||
ij_php_align_multiline_array_initializer_expression = false
|
||||
ij_php_align_multiline_binary_operation = false
|
||||
ij_php_align_multiline_chained_methods = false
|
||||
ij_php_align_multiline_extends_list = true
|
||||
ij_php_align_multiline_for = true
|
||||
ij_php_align_multiline_parameters = false
|
||||
ij_php_align_multiline_parameters_in_calls = true
|
||||
ij_php_align_multiline_ternary_operation = false
|
||||
ij_php_align_named_arguments = false
|
||||
ij_php_align_phpdoc_comments = false
|
||||
ij_php_align_phpdoc_param_names = false
|
||||
ij_php_anonymous_brace_style = end_of_line
|
||||
ij_php_api_weight = 28
|
||||
ij_php_array_initializer_new_line_after_left_brace = true
|
||||
ij_php_array_initializer_right_brace_on_new_line = true
|
||||
ij_php_array_initializer_wrap = on_every_item
|
||||
ij_php_assignment_wrap = off
|
||||
ij_php_attributes_wrap = off
|
||||
ij_php_author_weight = 28
|
||||
ij_php_binary_operation_sign_on_next_line = false
|
||||
ij_php_binary_operation_wrap = off
|
||||
ij_php_blank_lines_after_class_header = 0
|
||||
ij_php_blank_lines_after_function = 1
|
||||
ij_php_blank_lines_after_imports = 1
|
||||
ij_php_blank_lines_after_opening_tag = 1
|
||||
ij_php_blank_lines_after_package = 1
|
||||
ij_php_blank_lines_around_class = 1
|
||||
ij_php_blank_lines_around_constants = 0
|
||||
ij_php_blank_lines_around_field = 0
|
||||
ij_php_blank_lines_around_method = 1
|
||||
ij_php_blank_lines_before_class_end = 0
|
||||
ij_php_blank_lines_before_imports = 1
|
||||
ij_php_blank_lines_before_method_body = 0
|
||||
ij_php_blank_lines_before_package = 1
|
||||
ij_php_blank_lines_before_return_statement = 0
|
||||
ij_php_blank_lines_between_imports = 1
|
||||
ij_php_block_brace_style = end_of_line
|
||||
ij_php_call_parameters_new_line_after_left_paren = true
|
||||
ij_php_call_parameters_right_paren_on_new_line = true
|
||||
ij_php_call_parameters_wrap = on_every_item
|
||||
ij_php_catch_on_new_line = false
|
||||
ij_php_category_weight = 28
|
||||
ij_php_class_brace_style = next_line
|
||||
ij_php_comma_after_last_array_element = true
|
||||
ij_php_concat_spaces = true
|
||||
ij_php_copyright_weight = 28
|
||||
ij_php_deprecated_weight = 28
|
||||
ij_php_do_while_brace_force = always
|
||||
ij_php_else_if_style = combine
|
||||
ij_php_else_on_new_line = false
|
||||
ij_php_example_weight = 28
|
||||
ij_php_extends_keyword_wrap = off
|
||||
ij_php_extends_list_wrap = on_every_item
|
||||
ij_php_fields_default_visibility = private
|
||||
ij_php_filesource_weight = 28
|
||||
ij_php_finally_on_new_line = false
|
||||
ij_php_for_brace_force = always
|
||||
ij_php_for_statement_new_line_after_left_paren = true
|
||||
ij_php_for_statement_right_paren_on_new_line = true
|
||||
ij_php_for_statement_wrap = off
|
||||
ij_php_force_short_declaration_array_style = false
|
||||
ij_php_getters_setters_naming_style = camel_case
|
||||
ij_php_getters_setters_order_style = getters_first
|
||||
ij_php_global_weight = 28
|
||||
ij_php_group_use_wrap = on_every_item
|
||||
ij_php_if_brace_force = always
|
||||
ij_php_if_lparen_on_next_line = false
|
||||
ij_php_if_rparen_on_next_line = false
|
||||
ij_php_ignore_weight = 28
|
||||
ij_php_import_sorting = alphabetic
|
||||
ij_php_indent_break_from_case = true
|
||||
ij_php_indent_case_from_switch = true
|
||||
ij_php_indent_code_in_php_tags = false
|
||||
ij_php_internal_weight = 28
|
||||
ij_php_keep_blank_lines_after_lbrace = 0
|
||||
ij_php_keep_blank_lines_before_right_brace = 0
|
||||
ij_php_keep_blank_lines_in_code = 2
|
||||
ij_php_keep_blank_lines_in_declarations = 2
|
||||
ij_php_keep_control_statement_in_one_line = true
|
||||
ij_php_keep_first_column_comment = true
|
||||
ij_php_keep_indents_on_empty_lines = false
|
||||
ij_php_keep_line_breaks = true
|
||||
ij_php_keep_rparen_and_lbrace_on_one_line = true
|
||||
ij_php_keep_simple_classes_in_one_line = false
|
||||
ij_php_keep_simple_methods_in_one_line = false
|
||||
ij_php_lambda_brace_style = end_of_line
|
||||
ij_php_license_weight = 28
|
||||
ij_php_line_comment_add_space = false
|
||||
ij_php_line_comment_at_first_column = true
|
||||
ij_php_link_weight = 28
|
||||
ij_php_lower_case_boolean_const = true
|
||||
ij_php_lower_case_keywords = true
|
||||
ij_php_lower_case_null_const = true
|
||||
ij_php_method_brace_style = next_line
|
||||
ij_php_method_call_chain_wrap = off
|
||||
ij_php_method_parameters_new_line_after_left_paren = true
|
||||
ij_php_method_parameters_right_paren_on_new_line = true
|
||||
ij_php_method_parameters_wrap = on_every_item
|
||||
ij_php_method_weight = 28
|
||||
ij_php_modifier_list_wrap = false
|
||||
ij_php_multiline_chained_calls_semicolon_on_new_line = false
|
||||
ij_php_namespace_brace_style = 1
|
||||
ij_php_new_line_after_php_opening_tag = true
|
||||
ij_php_null_type_position = in_the_end
|
||||
ij_php_package_weight = 28
|
||||
ij_php_param_weight = 0
|
||||
ij_php_parameters_attributes_wrap = off
|
||||
ij_php_parentheses_expression_new_line_after_left_paren = false
|
||||
ij_php_parentheses_expression_right_paren_on_new_line = false
|
||||
ij_php_phpdoc_blank_line_before_tags = true
|
||||
ij_php_phpdoc_blank_lines_around_parameters = true
|
||||
ij_php_phpdoc_keep_blank_lines = true
|
||||
ij_php_phpdoc_param_spaces_between_name_and_description = 1
|
||||
ij_php_phpdoc_param_spaces_between_tag_and_type = 1
|
||||
ij_php_phpdoc_param_spaces_between_type_and_name = 1
|
||||
ij_php_phpdoc_use_fqcn = true
|
||||
ij_php_phpdoc_wrap_long_lines = false
|
||||
ij_php_place_assignment_sign_on_next_line = false
|
||||
ij_php_place_parens_for_constructor = 0
|
||||
ij_php_property_read_weight = 28
|
||||
ij_php_property_weight = 28
|
||||
ij_php_property_write_weight = 28
|
||||
ij_php_return_type_on_new_line = false
|
||||
ij_php_return_weight = 1
|
||||
ij_php_see_weight = 28
|
||||
ij_php_since_weight = 28
|
||||
ij_php_sort_phpdoc_elements = true
|
||||
ij_php_space_after_colon = true
|
||||
ij_php_space_after_colon_in_enum_backed_type = true
|
||||
ij_php_space_after_colon_in_named_argument = true
|
||||
ij_php_space_after_colon_in_return_type = true
|
||||
ij_php_space_after_comma = true
|
||||
ij_php_space_after_for_semicolon = true
|
||||
ij_php_space_after_quest = true
|
||||
ij_php_space_after_type_cast = false
|
||||
ij_php_space_after_unary_not = false
|
||||
ij_php_space_before_array_initializer_left_brace = false
|
||||
ij_php_space_before_catch_keyword = true
|
||||
ij_php_space_before_catch_left_brace = true
|
||||
ij_php_space_before_catch_parentheses = true
|
||||
ij_php_space_before_class_left_brace = true
|
||||
ij_php_space_before_closure_left_parenthesis = true
|
||||
ij_php_space_before_colon = true
|
||||
ij_php_space_before_colon_in_enum_backed_type = false
|
||||
ij_php_space_before_colon_in_named_argument = false
|
||||
ij_php_space_before_colon_in_return_type = false
|
||||
ij_php_space_before_comma = false
|
||||
ij_php_space_before_do_left_brace = true
|
||||
ij_php_space_before_else_keyword = true
|
||||
ij_php_space_before_else_left_brace = true
|
||||
ij_php_space_before_finally_keyword = true
|
||||
ij_php_space_before_finally_left_brace = true
|
||||
ij_php_space_before_for_left_brace = true
|
||||
ij_php_space_before_for_parentheses = true
|
||||
ij_php_space_before_for_semicolon = false
|
||||
ij_php_space_before_if_left_brace = true
|
||||
ij_php_space_before_if_parentheses = true
|
||||
ij_php_space_before_method_call_parentheses = false
|
||||
ij_php_space_before_method_left_brace = true
|
||||
ij_php_space_before_method_parentheses = false
|
||||
ij_php_space_before_quest = true
|
||||
ij_php_space_before_short_closure_left_parenthesis = false
|
||||
ij_php_space_before_switch_left_brace = true
|
||||
ij_php_space_before_switch_parentheses = true
|
||||
ij_php_space_before_try_left_brace = true
|
||||
ij_php_space_before_unary_not = false
|
||||
ij_php_space_before_while_keyword = true
|
||||
ij_php_space_before_while_left_brace = true
|
||||
ij_php_space_before_while_parentheses = true
|
||||
ij_php_space_between_ternary_quest_and_colon = false
|
||||
ij_php_spaces_around_additive_operators = true
|
||||
ij_php_spaces_around_arrow = false
|
||||
ij_php_spaces_around_assignment_in_declare = false
|
||||
ij_php_spaces_around_assignment_operators = true
|
||||
ij_php_spaces_around_bitwise_operators = true
|
||||
ij_php_spaces_around_equality_operators = true
|
||||
ij_php_spaces_around_logical_operators = true
|
||||
ij_php_spaces_around_multiplicative_operators = true
|
||||
ij_php_spaces_around_null_coalesce_operator = true
|
||||
ij_php_spaces_around_pipe_in_union_type = false
|
||||
ij_php_spaces_around_relational_operators = true
|
||||
ij_php_spaces_around_shift_operators = true
|
||||
ij_php_spaces_around_unary_operator = false
|
||||
ij_php_spaces_around_var_within_brackets = false
|
||||
ij_php_spaces_within_array_initializer_braces = false
|
||||
ij_php_spaces_within_brackets = false
|
||||
ij_php_spaces_within_catch_parentheses = false
|
||||
ij_php_spaces_within_for_parentheses = false
|
||||
ij_php_spaces_within_if_parentheses = false
|
||||
ij_php_spaces_within_method_call_parentheses = false
|
||||
ij_php_spaces_within_method_parentheses = false
|
||||
ij_php_spaces_within_parentheses = false
|
||||
ij_php_spaces_within_short_echo_tags = true
|
||||
ij_php_spaces_within_switch_parentheses = false
|
||||
ij_php_spaces_within_while_parentheses = false
|
||||
ij_php_special_else_if_treatment = false
|
||||
ij_php_subpackage_weight = 28
|
||||
ij_php_ternary_operation_signs_on_next_line = false
|
||||
ij_php_ternary_operation_wrap = off
|
||||
ij_php_throws_weight = 2
|
||||
ij_php_todo_weight = 28
|
||||
ij_php_unknown_tag_weight = 28
|
||||
ij_php_upper_case_boolean_const = false
|
||||
ij_php_upper_case_null_const = false
|
||||
ij_php_uses_weight = 28
|
||||
ij_php_var_weight = 28
|
||||
ij_php_variable_naming_style = mixed
|
||||
ij_php_version_weight = 28
|
||||
ij_php_while_brace_force = always
|
||||
ij_php_while_on_new_line = false
|
||||
|
||||
[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,composer.lock,jest.config}]
|
||||
indent_size = 2
|
||||
ij_json_keep_blank_lines_in_code = 0
|
||||
ij_json_keep_indents_on_empty_lines = false
|
||||
ij_json_keep_line_breaks = true
|
||||
ij_json_space_after_colon = true
|
||||
ij_json_space_after_comma = true
|
||||
ij_json_space_before_colon = true
|
||||
ij_json_space_before_comma = false
|
||||
ij_json_spaces_within_braces = false
|
||||
ij_json_spaces_within_brackets = false
|
||||
ij_json_wrap_long_lines = false
|
||||
|
||||
[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}]
|
||||
ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3
|
||||
ij_html_align_attributes = true
|
||||
ij_html_align_text = false
|
||||
ij_html_attribute_wrap = normal
|
||||
ij_html_block_comment_at_first_column = true
|
||||
ij_html_do_not_align_children_of_min_lines = 0
|
||||
ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p
|
||||
ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot
|
||||
ij_html_enforce_quotes = false
|
||||
ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var
|
||||
ij_html_keep_blank_lines = 2
|
||||
ij_html_keep_indents_on_empty_lines = false
|
||||
ij_html_keep_line_breaks = true
|
||||
ij_html_keep_line_breaks_in_text = true
|
||||
ij_html_keep_whitespaces = false
|
||||
ij_html_keep_whitespaces_inside = span,pre,textarea
|
||||
ij_html_line_comment_at_first_column = true
|
||||
ij_html_new_line_after_last_attribute = never
|
||||
ij_html_new_line_before_first_attribute = never
|
||||
ij_html_quote_style = double
|
||||
ij_html_remove_new_line_before_tags = br
|
||||
ij_html_space_after_tag_name = false
|
||||
ij_html_space_around_equality_in_attribute = false
|
||||
ij_html_space_inside_empty_tag = false
|
||||
ij_html_text_wrap = normal
|
||||
|
||||
[{*.markdown,*.md}]
|
||||
ij_markdown_force_one_space_after_blockquote_symbol = true
|
||||
ij_markdown_force_one_space_after_header_symbol = true
|
||||
ij_markdown_force_one_space_after_list_bullet = true
|
||||
ij_markdown_force_one_space_between_words = true
|
||||
ij_markdown_keep_indents_on_empty_lines = false
|
||||
ij_markdown_max_lines_around_block_elements = 1
|
||||
ij_markdown_max_lines_around_header = 1
|
||||
ij_markdown_max_lines_between_paragraphs = 1
|
||||
ij_markdown_min_lines_around_block_elements = 1
|
||||
ij_markdown_min_lines_around_header = 1
|
||||
ij_markdown_min_lines_between_paragraphs = 1
|
||||
|
||||
[{*.yaml,*.yml}]
|
||||
indent_size = 2
|
||||
ij_yaml_align_values_properties = do_not_align
|
||||
ij_yaml_autoinsert_sequence_marker = true
|
||||
ij_yaml_block_mapping_on_new_line = false
|
||||
ij_yaml_indent_sequence_value = true
|
||||
ij_yaml_keep_indents_on_empty_lines = false
|
||||
ij_yaml_keep_line_breaks = true
|
||||
ij_yaml_sequence_on_new_line = false
|
||||
ij_yaml_space_before_colon = false
|
||||
ij_yaml_spaces_within_braces = true
|
||||
ij_yaml_spaces_within_brackets = true
|
3
.env.example
Normal file
3
.env.example
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPACES_KEY=
|
||||
SPACES_SECRET=
|
||||
|
38
.github/ISSUE_TEMPLATE/BUG.yml
vendored
Normal file
38
.github/ISSUE_TEMPLATE/BUG.yml
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
name: Bug Report
|
||||
description: File a bug report
|
||||
title: "[Bug]: "
|
||||
labels: [ bug, triage ]
|
||||
assignees:
|
||||
- MacroMan
|
||||
body:
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: What happened?
|
||||
description: Please provide all information required to reproduce the bug
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: What version of Spaces-API is this occuring on? Versions below 3 will not be fixed. Please upgrade.
|
||||
options:
|
||||
- 3.5.0
|
||||
- 3.4.0
|
||||
- 3.3.0
|
||||
- 3.2.0
|
||||
- 3.1.0
|
||||
- 3.0.0
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: php-version
|
||||
attributes:
|
||||
label: What version of PHP are you using?
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Relevant log output
|
||||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
||||
render: shell
|
14
.github/ISSUE_TEMPLATE/FEATURE.yml
vendored
Normal file
14
.github/ISSUE_TEMPLATE/FEATURE.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
name: Feature request
|
||||
description: Request new functionality
|
||||
title: "[Feature]: "
|
||||
labels: [ new ]
|
||||
assignees:
|
||||
- MacroMan
|
||||
body:
|
||||
- type: textarea
|
||||
id: idea
|
||||
attributes:
|
||||
label: Description
|
||||
description: Please provide as much detail as you can about what you'd like to see. If you can, a pull request is the fastest way to add new features.
|
||||
validations:
|
||||
required: true
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
blank_issues_enabled: false
|
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
.DS_Store
|
||||
vendor/
|
||||
.idea/
|
||||
.env
|
||||
.phpunit.result.cache
|
12
.phpdoc-md
Normal file
12
.phpdoc-md
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
return (object)[
|
||||
'rootNamespace' => 'SpacesAPI',
|
||||
'destDirectory' => 'docs',
|
||||
'format' => 'github',
|
||||
'classes' => [
|
||||
'\SpacesAPI\Spaces',
|
||||
'\SpacesAPI\Space',
|
||||
'\SpacesAPI\File',
|
||||
],
|
||||
];
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 Devang Srivastava
|
||||
Copyright (c) 2020 Devang Srivastava
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
261
README.md
261
README.md
|
@ -1,231 +1,52 @@
|
|||
# Spaces-API
|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2FSociallyDev%2FSpaces-API?ref=badge_shield)
|
||||
# This library is deprecated
|
||||
We recommend using the [official SDK](https://github.com/DigitalOceanPHP/Client) or the [Laravel package](https://github.com/GrahamCampbell/Laravel-DigitalOcean)
|
||||
|
||||
An API wrapper for DigitalOcean's Spaces object storage designed for easy use.
|
||||
All issues will be closed and new PRs will not be accepted
|
||||
|
||||
|
||||
### Installation
|
||||
* **Using Composer**:
|
||||
```sh
|
||||
composer require sociallydev/spaces-api:dev-master
|
||||
## Installation
|
||||
Install via composer
|
||||
```
|
||||
composer require sociallydev/spaces-api
|
||||
```
|
||||
|
||||
### Connecting
|
||||
```php
|
||||
//Either:
|
||||
require_once("spaces.php");
|
||||
//OR COMPOSER:
|
||||
require_once("vendor/autoload.php"); //Install first by executing: composer require SociallyDev/Spaces-API in your project's directory.
|
||||
## Quick start
|
||||
|
||||
$key = "EXAMPLE_KEY";
|
||||
$secret = "EXAMPLE_SECRET";
|
||||
|
||||
$space_name = "my-space";
|
||||
$region = "nyc3";
|
||||
|
||||
$space = new SpacesConnect($key, $secret, $space_name, $region);
|
||||
```
|
||||
|
||||
All available options:
|
||||
###### SpacesConnect(REQUIRED KEY, REQUIRED SECRET, OPTIONAL SPACE's NAME, OPTIONAL REGION, OPTIONAL HOST);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Uploading/Downloading Files
|
||||
```php
|
||||
// Don't start any path with a forward slash, or it will give "SignatureDoesNotMatch" exception
|
||||
$path_to_file = "image.png";
|
||||
|
||||
$space->UploadFile($path_to_file, "public");
|
||||
|
||||
|
||||
|
||||
$download_file = "image.png";
|
||||
$save_as = "folder/downloaded-image.png";
|
||||
|
||||
$space->DownloadFile($download_file, $save_as);
|
||||
```
|
||||
All available options:
|
||||
###### UploadFile(REQUIRED PATH TO FILE, OPTIONAL PRIVACY (public|private) OPTIONAL NAME TO SAVE FILE AS);
|
||||
###### DownloadFile(REQUIRED FILE TO DOWNLOAD, REQUIRED LOCATION TO SAVE IN);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Deleting Files/Folders
|
||||
```php
|
||||
|
||||
$file_name = "image.png";
|
||||
|
||||
$space->DeleteObject($file_name);
|
||||
```
|
||||
All available options:
|
||||
###### DeleteObject(REQUIRED FILE OR FOLDER TO DELETE, OPTIONAL RECURSIVE (false|true));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Changing Privacy Settings
|
||||
```php
|
||||
$file = "image.png";
|
||||
|
||||
$space->MakePublic($file);
|
||||
$space->MakePrivate($file);
|
||||
|
||||
```
|
||||
All available options:
|
||||
###### MakePublic(REQUIRED PATH TO FILE);
|
||||
###### MakePrivate(REQUIRED PATH TO FILE);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Creating Temporary Links
|
||||
```php
|
||||
$file = "image.png";
|
||||
$valid_for = "1 day";
|
||||
|
||||
$link = $space->CreateTemporaryURL($file, $valid_for);
|
||||
```
|
||||
All available options:
|
||||
###### CreateTemporaryURL(REQUIRED FILE NAME, OPTIONAL TIME LINK IS VALID FOR);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Other File APIs
|
||||
```php
|
||||
//List all files and folders
|
||||
$files = $space->ListObjects();
|
||||
|
||||
|
||||
//Check if a file/folder by that name already exists. True/False.
|
||||
$space->DoesObjectExist($file_name);
|
||||
|
||||
|
||||
//Pull information about a single object.
|
||||
$file_info = $space->GetObject($file_name);
|
||||
|
||||
|
||||
//Upload a complete directory instead of a single file.
|
||||
$space->UploadDirectory($path_to_directory, $key_prefix);
|
||||
|
||||
|
||||
//Pull Access Control List information.
|
||||
$acl = $space-ListObjectACL($file_name);
|
||||
|
||||
|
||||
//Update Access Control List information.
|
||||
$space->PutObjectACL($file_name, $acl_info_array);
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Creating Spaces
|
||||
```php
|
||||
$new_space = "my-new-space";
|
||||
|
||||
$space->CreateSpace($new_space);
|
||||
```
|
||||
All available options:
|
||||
###### CreateSpace(REQUIRED SPACE NAME, OPTIONAL REGION FOR SPACE);
|
||||
|
||||
|
||||
|
||||
|
||||
### Switching Spaces
|
||||
```php
|
||||
$new_space = "my-new-space";
|
||||
|
||||
$space->SetSpace($new_space);
|
||||
```
|
||||
All available options:
|
||||
###### SetSpace(REQUIRED SPACE NAME, OPTIONAL REGION FOR SPACE, OPTIONAL HOST);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Other Spaces APIs
|
||||
```php
|
||||
//List all Spaces available in account.
|
||||
$spaces = $space->ListSpaces();
|
||||
|
||||
|
||||
//Delete a Space.
|
||||
$space->DestroyThisSpace();
|
||||
|
||||
|
||||
//Download whole Space to a folder.
|
||||
$space->DownloadSpaceToDirectory($directory_to_download_to);
|
||||
|
||||
|
||||
//Get the name of the current Space.
|
||||
$space_name = $space->GetSpaceName();
|
||||
|
||||
|
||||
//Pull the CORS policy of the Space.
|
||||
$cors = $space->ListCORS();
|
||||
|
||||
|
||||
//Update the CORS policy of the Space.
|
||||
$space->PutCORS($new_policy);
|
||||
|
||||
|
||||
//Pull the Access Control List information of the Space.
|
||||
$acl = $space->ListSpaceACL();
|
||||
|
||||
|
||||
//Update the Access Control List information of the Space.
|
||||
$space->PutSpaceACL($new_acl);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
### Handling Errors
|
||||
Obtain API keys from the [Digital Ocean Applications & API dashboard](https://cloud.digitalocean.com/account/api/tokens)
|
||||
|
||||
```php
|
||||
try {
|
||||
$space->CreateSpace("dev");
|
||||
} catch (\SpacesAPIException $e) {
|
||||
$error = $e->GetError();
|
||||
use SpacesAPI\Spaces;
|
||||
|
||||
//Error management code.
|
||||
echo "<pre>";
|
||||
print_r($error);
|
||||
/*
|
||||
EG:
|
||||
Array (
|
||||
[message] => Bucket already exists
|
||||
[code] => BucketAlreadyExists
|
||||
[type] => client
|
||||
[http_code] => 409
|
||||
)
|
||||
*/
|
||||
}
|
||||
// Connect to a space
|
||||
$spaces = new Spaces('api-key', 'api-secret');
|
||||
$space = $spaces->space('space-name');
|
||||
|
||||
// Download a file
|
||||
$file = $space->file('remote-file-1.txt');
|
||||
$file->download('local/file/path/file.txt');
|
||||
|
||||
// Upload text to a file
|
||||
$file2 = $space->uploadText("Lorem ipsum","remote-file-2.txt");
|
||||
|
||||
// Get a signed public link, valid for 2 hours
|
||||
$file2url = $file2->getSignedURL("2 hours");
|
||||
|
||||
// Make a copy
|
||||
$file3 = $file2->copy('remote-file-3.txt');
|
||||
|
||||
// Move or rename a file
|
||||
$file2->move('new-filename.txt')
|
||||
|
||||
// Make a file public and get the URL
|
||||
$file3->makePublic();
|
||||
$file3url = $file3->getURL();
|
||||
```
|
||||
|
||||
See more examples in [docs/Examples.md](docs/Examples.md)
|
||||
|
||||
## License
|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2FSociallyDev%2FSpaces-API?ref=badge_large)
|
||||
## Upgrading?
|
||||
Version 3 has many changes over version 2, so we have written a [migration guide](docs/Upgrade2-3.md)
|
||||
|
||||
## API reference
|
||||
* [\SpacesAPI\Spaces](docs/Spaces.md)
|
||||
* [\SpacesAPI\Space](docs/Space.md)
|
||||
* [\SpacesAPI\File](docs/File.md)
|
||||
|
|
7
SpacesAPI/Exceptions/AuthenticationException.php
Normal file
7
SpacesAPI/Exceptions/AuthenticationException.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class AuthenticationException extends Exception {}
|
9
SpacesAPI/Exceptions/FileDoesntExistException.php
Normal file
9
SpacesAPI/Exceptions/FileDoesntExistException.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class FileDoesntExistException extends Exception
|
||||
{
|
||||
}
|
9
SpacesAPI/Exceptions/SpaceDoesntExistException.php
Normal file
9
SpacesAPI/Exceptions/SpaceDoesntExistException.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class SpaceDoesntExistException extends Exception
|
||||
{
|
||||
}
|
7
SpacesAPI/Exceptions/SpaceExistsException.php
Normal file
7
SpacesAPI/Exceptions/SpaceExistsException.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class SpaceExistsException extends Exception {}
|
9
SpacesAPI/Exceptions/SpacesException.php
Normal file
9
SpacesAPI/Exceptions/SpacesException.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class SpacesException extends Exception
|
||||
{
|
||||
}
|
285
SpacesAPI/File.php
Normal file
285
SpacesAPI/File.php
Normal file
|
@ -0,0 +1,285 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI;
|
||||
|
||||
use SpacesAPI\Exceptions\FileDoesntExistException;
|
||||
|
||||
use function PHPUnit\Framework\isNull;
|
||||
|
||||
/**
|
||||
* Represents a single file
|
||||
*
|
||||
* You wouldn't normally instantiate this class directly,
|
||||
* Rather obtain an instance from `\SpacesAPI\Space::list()`, `\SpacesAPI\Spaces::file()`, `\SpacesAPI\Spaces::uploadText()` or `\SpacesAPI\Spaces::uploadFile()`
|
||||
*
|
||||
* @property string $filename
|
||||
* @property string $expiration
|
||||
* @property string $e_tag
|
||||
* @property int $last_modified
|
||||
* @property string $content_type
|
||||
* @property int $content_length
|
||||
*/
|
||||
class File
|
||||
{
|
||||
use StringFunctions;
|
||||
|
||||
/**
|
||||
* @var \SpacesAPI\Space
|
||||
*/
|
||||
private $space;
|
||||
|
||||
/**
|
||||
* The name of the current space
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $space_name;
|
||||
|
||||
/**
|
||||
* @var \Aws\S3\S3Client
|
||||
*/
|
||||
private $s3;
|
||||
|
||||
private $_expiration;
|
||||
private $_e_tag;
|
||||
private $_filename;
|
||||
private $_last_modified;
|
||||
private $_content_type;
|
||||
private $_content_length;
|
||||
|
||||
/**
|
||||
* @param \SpacesAPI\Space $space An instance of `\SpacesAPI\Space`
|
||||
* @param string $filename The filename of a file
|
||||
* @param array $info Any information already known about the file (eg content_length, content_type, etc). Default `[]`
|
||||
* @param bool $validate Check that the file exists
|
||||
*
|
||||
* @throws \SpacesAPI\Exceptions\FileDoesntExistException If validation is `true` and the file doesn't exist
|
||||
*/
|
||||
public function __construct(Space $space, string $filename, array $info = [], bool $validate = true)
|
||||
{
|
||||
$this->space = $space;
|
||||
$this->space_name = $space->getName();
|
||||
$this->s3 = $space->getS3Client();
|
||||
$this->_filename = $filename;
|
||||
|
||||
if ($validate && !$this->s3->doesObjectExist($this->space_name, $filename)) {
|
||||
throw new FileDoesntExistException("File $filename doesn't exist");
|
||||
}
|
||||
|
||||
if (count($info) > 0) {
|
||||
$this->setFileInfo($info);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic getter to make the properties read-only
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function __get(string $name)
|
||||
{
|
||||
if (!property_exists($this, "_$name")) {
|
||||
trigger_error("Undefined property: SpacesAPI\File::$name", E_USER_NOTICE);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!$this->{"_$name"}) {
|
||||
$this->fetchFileInfo();
|
||||
}
|
||||
|
||||
return $this->{"_$name"};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $info
|
||||
*/
|
||||
private function setFileInfo(array $info): void
|
||||
{
|
||||
foreach ($info as $_property => $value) {
|
||||
$property = "_" . $this->pascalCaseToCamelCase($_property);
|
||||
|
||||
if ($property == 'size') {
|
||||
$property = 'content_length';
|
||||
}
|
||||
|
||||
if (property_exists($this, $property)) {
|
||||
$this->$property = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function fetchFileInfo(): void
|
||||
{
|
||||
$this->setFileInfo(
|
||||
Result::parse(
|
||||
$this->s3->headObject([
|
||||
"Bucket" => $this->space_name,
|
||||
"Key" => $this->_filename,
|
||||
])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this file publicly accessible
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isPublic(): bool
|
||||
{
|
||||
$acl = Result::parse(
|
||||
$this->s3->getObjectAcl([
|
||||
"Bucket" => $this->space_name,
|
||||
"Key" => $this->_filename,
|
||||
])
|
||||
);
|
||||
|
||||
return (
|
||||
isset($acl['Grants'][0]['Grantee']['URI']) &&
|
||||
$acl['Grants'][0]['Grantee']['URI'] == "http://acs.amazonaws.com/groups/global/AllUsers" &&
|
||||
$acl['Grants'][0]['Permission'] == "READ"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a file public or privately accessible
|
||||
*
|
||||
* @param bool $public
|
||||
*/
|
||||
private function updatePrivacy(bool $public): void
|
||||
{
|
||||
$this->s3->putObjectAcl([
|
||||
"Bucket" => $this->space_name,
|
||||
"Key" => $this->_filename,
|
||||
"ACL" => ($public) ? "public-read" : "private",
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make file publicly accessible
|
||||
*/
|
||||
public function makePublic(): void
|
||||
{
|
||||
$this->updatePrivacy(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make file non-publicly accessible
|
||||
*/
|
||||
public function makePrivate(): void
|
||||
{
|
||||
$this->updatePrivacy(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the file contents as a string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContents(): string
|
||||
{
|
||||
return $this->s3->getObject([
|
||||
"Bucket" => $this->space_name,
|
||||
"Key" => $this->_filename,
|
||||
])["Body"]->getContents();
|
||||
}
|
||||
|
||||
/**
|
||||
* Download the file to a local location
|
||||
*
|
||||
* @param string $saveAs
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function download(string $saveAs): void
|
||||
{
|
||||
$this->s3->getObject([
|
||||
"Bucket" => $this->space_name,
|
||||
"Key" => $this->_filename,
|
||||
"SaveAs" => $saveAs,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy the file on the space
|
||||
*
|
||||
* @param string $newFilename
|
||||
* @param false $public
|
||||
*
|
||||
* @return \SpacesAPI\File
|
||||
*/
|
||||
public function copy(string $newFilename): File
|
||||
{
|
||||
$this->s3->copy(
|
||||
$this->space_name,
|
||||
$this->_filename,
|
||||
$this->space_name,
|
||||
$newFilename,
|
||||
($this->isPublic()) ? 'public-read' : 'private'
|
||||
);
|
||||
|
||||
return new self($this->space, $newFilename);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $newFilename
|
||||
*
|
||||
* @return \SpacesAPI\File
|
||||
*/
|
||||
public function move(string $newFilename): File
|
||||
{
|
||||
$this->copy($newFilename);
|
||||
$this->delete();
|
||||
$this->_filename = $newFilename;
|
||||
$this->fetchFileInfo();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the public URL
|
||||
* This URL will not work if the file is private
|
||||
*
|
||||
* @return string
|
||||
* @see getSignedURL
|
||||
*
|
||||
*/
|
||||
public function getURL(): string
|
||||
{
|
||||
return $this->s3->getObjectUrl($this->space_name, $this->_filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a signed URL, which will work for private files
|
||||
*
|
||||
* @param string|\DateTime|int $validFor Can be any string recognised by strtotime(), an instance of DateTime or a unix timestamp
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSignedURL($validFor = "15 minutes"): string
|
||||
{
|
||||
return (string)$this->s3->createPresignedRequest(
|
||||
$this->s3->getCommand("GetObject", [
|
||||
"Bucket" => $this->space_name,
|
||||
"Key" => $this->_filename,
|
||||
]),
|
||||
$validFor
|
||||
)->getUri();
|
||||
}
|
||||
|
||||
/**
|
||||
* Permanently delete this file
|
||||
*/
|
||||
public function delete(): void
|
||||
{
|
||||
$this->s3->deleteObject([
|
||||
"Bucket" => $this->space_name,
|
||||
"Key" => $this->_filename,
|
||||
]);
|
||||
}
|
||||
}
|
37
SpacesAPI/Result.php
Normal file
37
SpacesAPI/Result.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI;
|
||||
|
||||
use Aws\Api\DateTimeResult;
|
||||
|
||||
/**
|
||||
* AWS Results parser
|
||||
*/
|
||||
class Result
|
||||
{
|
||||
/**
|
||||
* Convert AWS result object into plain, multidimensional array
|
||||
*
|
||||
* @param $data
|
||||
*
|
||||
* @return array|mixed
|
||||
*/
|
||||
public static function parse($data) {
|
||||
if (gettype($data) == "object" && get_class($data) == \Aws\Result::class) {
|
||||
$data = $data->toArray();
|
||||
}
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$data[$key] = self::parse($value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (gettype($value) == "object" && get_class($value) == DateTimeResult::class) {
|
||||
$data[$key] = strtotime($value);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
369
SpacesAPI/Space.php
Normal file
369
SpacesAPI/Space.php
Normal file
|
@ -0,0 +1,369 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI;
|
||||
|
||||
use Aws\S3\Exception\S3Exception;
|
||||
use Aws\S3\S3Client;
|
||||
use SpacesAPI\Exceptions\SpaceDoesntExistException;
|
||||
|
||||
/**
|
||||
* Represents a space once connected/created
|
||||
*
|
||||
* You wouldn't normally instantiate this class directly,
|
||||
* Rather obtain an instance from `\SpacesAPI\Spaces::space()` or `\SpacesAPI\Spaces::create()`
|
||||
*/
|
||||
class Space
|
||||
{
|
||||
/**
|
||||
* AWS S3 client
|
||||
*
|
||||
* @var \Aws\S3\S3Client
|
||||
*/
|
||||
private $s3;
|
||||
|
||||
/**
|
||||
* The name of the current space
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* Load a space
|
||||
*
|
||||
* You wouldn't normally call this directly,
|
||||
* rather obtain an instance from `\SpacesAPI\Spaces::space()` or `\SpacesAPI\Spaces::create()`
|
||||
*
|
||||
* @param \Aws\S3\S3Client $s3 An authenticated S3Client instance
|
||||
* @param string $name Space name
|
||||
* @param bool $validate Check that the space exists
|
||||
*
|
||||
* @throws \SpacesAPI\Exceptions\SpaceDoesntExistException If validation is `true` and the space doesn't exist
|
||||
*/
|
||||
public function __construct(S3Client $s3, string $name, bool $validate = true)
|
||||
{
|
||||
$this->s3 = $s3;
|
||||
$this->name = $name;
|
||||
|
||||
if ($validate && !$this->s3->doesBucketExist($name)) {
|
||||
throw new SpaceDoesntExistException("Space '$this->name' does not exist");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current AWS S3 client instance
|
||||
*
|
||||
* For internal library use
|
||||
*
|
||||
* @return \Aws\S3\S3Client
|
||||
*/
|
||||
public function getS3Client(): S3Client
|
||||
{
|
||||
return $this->s3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of this space
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update space privacy
|
||||
*
|
||||
* @param bool $public
|
||||
*/
|
||||
private function updatePrivacy(bool $public): void
|
||||
{
|
||||
$this->s3->putBucketAcl([
|
||||
"Bucket" => $this->name,
|
||||
"ACL" => ($public) ? "public-read" : "private",
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable file listing
|
||||
*/
|
||||
public function makePublic(): void
|
||||
{
|
||||
$this->updatePrivacy(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable file listing
|
||||
*/
|
||||
public function makePrivate(): void
|
||||
{
|
||||
$this->updatePrivacy(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is file listing enabled?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isPublic(): bool
|
||||
{
|
||||
$acl = Result::parse($this->s3->getBucketAcl(["Bucket" => $this->name]));
|
||||
|
||||
return (
|
||||
isset($acl['Grants'][0]['Grantee']['URI']) &&
|
||||
$acl['Grants'][0]['Grantee']['URI'] == "http://acs.amazonaws.com/groups/global/AllUsers" &&
|
||||
$acl['Grants'][0]['Permission'] == "READ"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy/Delete this space, along with all files
|
||||
*/
|
||||
public function destroy(): void
|
||||
{
|
||||
$this->s3->deleteMatchingObjects($this->name, "", "(.*?)");
|
||||
$this->s3->deleteBucket(["Bucket" => $this->name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CORS configuration for the space
|
||||
*
|
||||
* @return array|null An array of CORS rules or null if no rules exist
|
||||
*/
|
||||
public function getCORS(): ?array
|
||||
{
|
||||
try {
|
||||
return Result::parse(
|
||||
$this->s3->getBucketCors([
|
||||
"Bucket" => $this->name,
|
||||
])
|
||||
)['CORSRules'];
|
||||
} catch (S3Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CORS rules, removing the origin specified
|
||||
*
|
||||
* @param string $origin
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getCORSRemovingOrigin(string $origin): array
|
||||
{
|
||||
if (!$CORSRules = $this->getCORS()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach ($CORSRules as $i => $cors) {
|
||||
if ($cors['AllowedOrigins'][0] == $origin) {
|
||||
array_splice($CORSRules, $i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return $CORSRules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the CORS rules
|
||||
*
|
||||
* @param array $rules
|
||||
*/
|
||||
private function putCORS(array $rules): void
|
||||
{
|
||||
$this->s3->putBucketCors([
|
||||
"Bucket" => $this->name,
|
||||
"CORSConfiguration" => [
|
||||
"CORSRules" => $rules,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an origin to the CORS settings on this space
|
||||
*
|
||||
* @param string $origin eg `http://example.com`
|
||||
* @param array $methods Array items must be one of `GET`, `PUT`, `DELETE`, `POST` and `HEAD`
|
||||
* @param int $maxAge Access Control Max Age
|
||||
* @param array $headers Allowed Headers
|
||||
*/
|
||||
public function addCORSOrigin(string $origin, array $methods, int $maxAge = 0, array $headers = []): void
|
||||
{
|
||||
$rules = $this->getCORSRemovingOrigin($origin);
|
||||
|
||||
$this->putCORS(
|
||||
array_merge($rules, [
|
||||
[
|
||||
"AllowedHeaders" => $headers,
|
||||
"AllowedMethods" => $methods,
|
||||
"AllowedOrigins" => [$origin],
|
||||
"MaxAgeSeconds" => $maxAge,
|
||||
],
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an origin from the CORS settings on this space
|
||||
*
|
||||
* @param string $origin eg `http://example.com`
|
||||
*/
|
||||
public function removeCORSOrigin(string $origin): void
|
||||
{
|
||||
$rules = $this->getCORSRemovingOrigin($origin);
|
||||
|
||||
if (empty($rules)) {
|
||||
$this->removeAllCORSOrigins();
|
||||
} else {
|
||||
$this->putCORS($rules);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all CORS rules
|
||||
*/
|
||||
public function removeAllCORSOrigins(): void
|
||||
{
|
||||
$this->s3->deleteBucketCors([
|
||||
'Bucket' => $this->name,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* List all files in the space (recursively)
|
||||
*
|
||||
* @param string $directory The directory to list files in. Empty string for root directory
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function listFiles(string $directory = ""): array
|
||||
{
|
||||
$rawFiles = $this->rawListFiles($directory);
|
||||
$files = [];
|
||||
|
||||
foreach ($rawFiles as $fileInfo) {
|
||||
$files[$fileInfo['Key']] = new File($this, $fileInfo['Key'], $fileInfo, false);
|
||||
}
|
||||
|
||||
return ['files' => $files];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $directory The directory to list files in. Empty string for root directory
|
||||
* @param string|null $continuationToken Used internally to work around request limits (1000 files per request)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function rawListFiles(string $directory = "", ?string $continuationToken = null): array
|
||||
{
|
||||
$data = Result::parse(
|
||||
$this->s3->listObjectsV2([
|
||||
"Bucket" => $this->name,
|
||||
"Prefix" => $directory,
|
||||
"MaxKeys" => 1000,
|
||||
// "StartAfter" => 0, // For skipping files, maybe for future limit/skip ability
|
||||
"FetchOwner" => false,
|
||||
"ContinuationToken" => $continuationToken,
|
||||
])
|
||||
);
|
||||
|
||||
if (!isset($data['Contents'])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$files = $data['Contents'];
|
||||
|
||||
if (isset($data["NextContinuationToken"]) && $data["NextContinuationToken"] != "") {
|
||||
$files = array_merge($files, $this->rawListFiles($directory, $data["NextContinuationToken"]));
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload a string of text to file
|
||||
*
|
||||
* @param string $text The text to upload
|
||||
* @param string $filename The filepath/name to save to
|
||||
* @param array $params Any extra parameters. [See here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property)
|
||||
* @param bool $private True for the file to be private, false to allow public access
|
||||
*
|
||||
* @return \SpacesAPI\File
|
||||
*/
|
||||
public function uploadText(string $text, string $filename, array $params = [], bool $private = true): File
|
||||
{
|
||||
$this->s3->upload($this->name, $filename, $text, ($private) ? 'private' : 'public-read', $params);
|
||||
return new File($this, $filename, [], false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload a file
|
||||
*
|
||||
* @param string $filepath The path to the file, including the filename. Relative and absolute paths are accepted.
|
||||
* @param string|null $filename The remote filename. If `null`, the local filename will be used.
|
||||
* @param string|null $mimeType The file mime type to pass as ContentType for the file (e.g. 'image/jpeg').
|
||||
* @param bool $private True for the file to be private, false to allow public access.
|
||||
*
|
||||
* @return \SpacesAPI\File
|
||||
*/
|
||||
public function uploadFile(string $filepath, ?string $filename = null, ?string $mimeType = null, bool $private = true): File
|
||||
{
|
||||
$this->s3->putObject([
|
||||
'Bucket' => $this->name,
|
||||
'Key' => ($filename) ?: basename($filepath),
|
||||
'SourceFile' => $filepath,
|
||||
'ContentType' => $mimeType,
|
||||
'ACL' => ($private) ? 'private' : 'public-read'
|
||||
]);
|
||||
|
||||
return new File($this, ($filename) ?: basename($filepath), [], false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an instance of \SpacesAPI\File for a given filename
|
||||
*
|
||||
* @param string $filename
|
||||
* @package bool $validate
|
||||
*
|
||||
* @return \SpacesAPI\File
|
||||
* @throws \SpacesAPI\Exceptions\FileDoesntExistException Thrown if the file doesn't exist
|
||||
*/
|
||||
public function file(string $filename, bool $validate = true): File
|
||||
{
|
||||
return new File($this, $filename, [], $validate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively upload an entire directory
|
||||
*
|
||||
* @param string $local The local directory to upload
|
||||
* @param string|null $remote The remote directory to place the files in. `null` to place in the root
|
||||
*/
|
||||
public function uploadDirectory(string $local, ?string $remote = null): void
|
||||
{
|
||||
$this->s3->uploadDirectory($local, $this->name, $remote);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively download an entire directory.
|
||||
*
|
||||
* @param string $local The local directory to save the directories/files in
|
||||
* @param string|null $remote The remote directory to download. `null` to download the entire space
|
||||
*/
|
||||
public function downloadDirectory(string $local, ?string $remote = null): void
|
||||
{
|
||||
$this->s3->downloadBucket($local, $this->name, $remote);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an entire directory, including its contents
|
||||
*
|
||||
* @param string $path The directory to delete
|
||||
*/
|
||||
public function deleteDirectory(string $path): void
|
||||
{
|
||||
$this->s3->deleteMatchingObjects($this->name, $path);
|
||||
}
|
||||
}
|
105
SpacesAPI/Spaces.php
Normal file
105
SpacesAPI/Spaces.php
Normal file
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI;
|
||||
|
||||
use Aws\S3\Exception\S3Exception;
|
||||
use Aws\S3\S3Client;
|
||||
use SpacesAPI\Exceptions\AuthenticationException;
|
||||
use SpacesAPI\Exceptions\SpaceExistsException;
|
||||
|
||||
/**
|
||||
* Represents the connection to Digital Ocean spaces.
|
||||
* The entry point for managing spaces.
|
||||
*
|
||||
* Instantiate your connection with `new \SpacesAPI\Spaces("access-key", "secret-key", "region")`
|
||||
*
|
||||
* Obtain your access and secret keys from the [DigitalOcean Applications & API dashboard](https://cloud.digitalocean.com/account/api/tokens)
|
||||
*/
|
||||
class Spaces
|
||||
{
|
||||
/**
|
||||
* @var \Aws\S3\S3Client
|
||||
*/
|
||||
private $s3;
|
||||
|
||||
/**
|
||||
* Initialise the API
|
||||
*
|
||||
* @param string $accessKey Digital Ocean API access key
|
||||
* @param string $secretKey Digital Ocean API secret key
|
||||
* @param string $region Region, defaults to ams3
|
||||
* @param string $host API endpoint, defaults to digitaloceanspaces.com
|
||||
*
|
||||
* @throws \SpacesAPI\Exceptions\AuthenticationException Authentication failed
|
||||
*/
|
||||
public function __construct(string $accessKey, string $secretKey, string $region = "ams3", string $host = "digitaloceanspaces.com")
|
||||
{
|
||||
$this->s3 = new S3Client([
|
||||
"version" => "latest",
|
||||
"region" => $region,
|
||||
"endpoint" => "https://$region.$host",
|
||||
"credentials" => ["key" => $accessKey, "secret" => $secretKey],
|
||||
"ua_append" => "SociallyDev-Spaces-API/2",
|
||||
]);
|
||||
|
||||
try {
|
||||
$this->s3->headBucket(["Bucket" => 'auth-check']);
|
||||
} catch (S3Exception $e) {
|
||||
if ($e->getStatusCode() == 403) {
|
||||
throw new AuthenticationException("Authentication failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List all your spaces
|
||||
*
|
||||
* @return array An array of \SpacesAPI\Space instances
|
||||
*/
|
||||
public function list(): array
|
||||
{
|
||||
$spaces = [];
|
||||
|
||||
foreach (Result::parse($this->s3->listBuckets()['Buckets']) as $bucket) {
|
||||
$spaces[$bucket['Name']] = new Space($this->s3, $bucket['Name'], false);
|
||||
}
|
||||
|
||||
return $spaces;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new space
|
||||
*
|
||||
* @param string $name The name of the new space
|
||||
* @param bool $public Enable file listing. Default `false`
|
||||
*
|
||||
* @return \SpacesAPI\Space The newly created space
|
||||
* @throws \SpacesAPI\Exceptions\SpaceExistsException The named space already exists
|
||||
*/
|
||||
public function create(string $name, bool $public = false): Space
|
||||
{
|
||||
try {
|
||||
$this->s3->createBucket([
|
||||
"ACL" => ($public) ? "public-read" : "private",
|
||||
"Bucket" => $name,
|
||||
]);
|
||||
} catch (S3Exception $e) {
|
||||
throw new SpaceExistsException($e->getAwsErrorMessage());
|
||||
}
|
||||
|
||||
return new Space($this->s3, $name, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use an existing space
|
||||
*
|
||||
* @param string $name The name of the space
|
||||
*
|
||||
* @return \SpacesAPI\Space The loaded space
|
||||
* @throws \SpacesAPI\Exceptions\SpaceDoesntExistException The named space doesn't exist
|
||||
*/
|
||||
public function space(string $name): Space
|
||||
{
|
||||
return new Space($this->s3, $name);
|
||||
}
|
||||
}
|
11
SpacesAPI/StringFunctions.php
Normal file
11
SpacesAPI/StringFunctions.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace SpacesAPI;
|
||||
|
||||
trait StringFunctions
|
||||
{
|
||||
public function pascalCaseToCamelCase(string $name): string
|
||||
{
|
||||
return strtolower(preg_replace("/([a-z])([A-Z])/", "$1_$2", $name));
|
||||
}
|
||||
}
|
BIN
aws/Aws/.DS_Store
vendored
BIN
aws/Aws/.DS_Store
vendored
Binary file not shown.
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Acm;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **AWS Certificate Manager** service.
|
||||
*
|
||||
* @method \Aws\Result addTagsToCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise addTagsToCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result deleteCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result describeCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result getCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result importCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise importCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result listCertificates(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listCertificatesAsync(array $args = [])
|
||||
* @method \Aws\Result listTagsForCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listTagsForCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result removeTagsFromCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise removeTagsFromCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result requestCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise requestCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result resendValidationEmail(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise resendValidationEmailAsync(array $args = [])
|
||||
*/
|
||||
class AcmClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Acm\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **AWS Certificate Manager** service.
|
||||
*/
|
||||
class AcmException extends AwsException {}
|
|
@ -1,81 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\AlexaForBusiness;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **Alexa For Business** service.
|
||||
* @method \Aws\Result associateDeviceWithRoom(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise associateDeviceWithRoomAsync(array $args = [])
|
||||
* @method \Aws\Result associateSkillGroupWithRoom(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise associateSkillGroupWithRoomAsync(array $args = [])
|
||||
* @method \Aws\Result createProfile(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createProfileAsync(array $args = [])
|
||||
* @method \Aws\Result createRoom(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createRoomAsync(array $args = [])
|
||||
* @method \Aws\Result createSkillGroup(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createSkillGroupAsync(array $args = [])
|
||||
* @method \Aws\Result createUser(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createUserAsync(array $args = [])
|
||||
* @method \Aws\Result deleteProfile(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteProfileAsync(array $args = [])
|
||||
* @method \Aws\Result deleteRoom(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteRoomAsync(array $args = [])
|
||||
* @method \Aws\Result deleteRoomSkillParameter(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteRoomSkillParameterAsync(array $args = [])
|
||||
* @method \Aws\Result deleteSkillGroup(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteSkillGroupAsync(array $args = [])
|
||||
* @method \Aws\Result deleteUser(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteUserAsync(array $args = [])
|
||||
* @method \Aws\Result disassociateDeviceFromRoom(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise disassociateDeviceFromRoomAsync(array $args = [])
|
||||
* @method \Aws\Result disassociateSkillGroupFromRoom(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise disassociateSkillGroupFromRoomAsync(array $args = [])
|
||||
* @method \Aws\Result getDevice(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDeviceAsync(array $args = [])
|
||||
* @method \Aws\Result getProfile(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getProfileAsync(array $args = [])
|
||||
* @method \Aws\Result getRoom(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getRoomAsync(array $args = [])
|
||||
* @method \Aws\Result getRoomSkillParameter(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getRoomSkillParameterAsync(array $args = [])
|
||||
* @method \Aws\Result getSkillGroup(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getSkillGroupAsync(array $args = [])
|
||||
* @method \Aws\Result listSkills(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listSkillsAsync(array $args = [])
|
||||
* @method \Aws\Result listTags(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = [])
|
||||
* @method \Aws\Result putRoomSkillParameter(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putRoomSkillParameterAsync(array $args = [])
|
||||
* @method \Aws\Result resolveRoom(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise resolveRoomAsync(array $args = [])
|
||||
* @method \Aws\Result revokeInvitation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise revokeInvitationAsync(array $args = [])
|
||||
* @method \Aws\Result searchDevices(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise searchDevicesAsync(array $args = [])
|
||||
* @method \Aws\Result searchProfiles(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise searchProfilesAsync(array $args = [])
|
||||
* @method \Aws\Result searchRooms(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise searchRoomsAsync(array $args = [])
|
||||
* @method \Aws\Result searchSkillGroups(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise searchSkillGroupsAsync(array $args = [])
|
||||
* @method \Aws\Result searchUsers(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise searchUsersAsync(array $args = [])
|
||||
* @method \Aws\Result sendInvitation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise sendInvitationAsync(array $args = [])
|
||||
* @method \Aws\Result startDeviceSync(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise startDeviceSyncAsync(array $args = [])
|
||||
* @method \Aws\Result tagResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
|
||||
* @method \Aws\Result untagResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
|
||||
* @method \Aws\Result updateDevice(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateDeviceAsync(array $args = [])
|
||||
* @method \Aws\Result updateProfile(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateProfileAsync(array $args = [])
|
||||
* @method \Aws\Result updateRoom(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateRoomAsync(array $args = [])
|
||||
* @method \Aws\Result updateSkillGroup(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateSkillGroupAsync(array $args = [])
|
||||
*/
|
||||
class AlexaForBusinessClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\AlexaForBusiness\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **Alexa For Business** service.
|
||||
*/
|
||||
class AlexaForBusinessException extends AwsException {}
|
|
@ -1,67 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* Base class that is used by most API shapes
|
||||
*/
|
||||
abstract class AbstractModel implements \ArrayAccess
|
||||
{
|
||||
/** @var array */
|
||||
protected $definition;
|
||||
|
||||
/** @var ShapeMap */
|
||||
protected $shapeMap;
|
||||
|
||||
/**
|
||||
* @param array $definition Service description
|
||||
* @param ShapeMap $shapeMap Shapemap used for creating shapes
|
||||
*/
|
||||
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||
{
|
||||
$this->definition = $definition;
|
||||
$this->shapeMap = $shapeMap;
|
||||
}
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
return $this->definition;
|
||||
}
|
||||
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->definition[$offset])
|
||||
? $this->definition[$offset] : null;
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
$this->definition[$offset] = $value;
|
||||
}
|
||||
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->definition[$offset]);
|
||||
}
|
||||
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->definition[$offset]);
|
||||
}
|
||||
|
||||
protected function shapeAt($key)
|
||||
{
|
||||
if (!isset($this->definition[$key])) {
|
||||
throw new \InvalidArgumentException('Expected shape definition at '
|
||||
. $key);
|
||||
}
|
||||
|
||||
return $this->shapeFor($this->definition[$key]);
|
||||
}
|
||||
|
||||
protected function shapeFor(array $definition)
|
||||
{
|
||||
return isset($definition['shape'])
|
||||
? $this->shapeMap->resolve($definition)
|
||||
: Shape::create($definition, $this->shapeMap);
|
||||
}
|
||||
}
|
|
@ -1,244 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
use Aws\Exception\UnresolvedApiException;
|
||||
|
||||
/**
|
||||
* API providers.
|
||||
*
|
||||
* An API provider is a function that accepts a type, service, and version and
|
||||
* returns an array of API data on success or NULL if no API data can be created
|
||||
* for the provided arguments.
|
||||
*
|
||||
* You can wrap your calls to an API provider with the
|
||||
* {@see ApiProvider::resolve} method to ensure that API data is created. If the
|
||||
* API data is not created, then the resolve() method will throw a
|
||||
* {@see Aws\Exception\UnresolvedApiException}.
|
||||
*
|
||||
* use Aws\Api\ApiProvider;
|
||||
* $provider = ApiProvider::defaultProvider();
|
||||
* // Returns an array or NULL.
|
||||
* $data = $provider('api', 's3', '2006-03-01');
|
||||
* // Returns an array or throws.
|
||||
* $data = ApiProvider::resolve($provider, 'api', 'elasticfood', '2020-01-01');
|
||||
*
|
||||
* You can compose multiple providers into a single provider using
|
||||
* {@see Aws\or_chain}. This method accepts providers as arguments and
|
||||
* returns a new function that will invoke each provider until a non-null value
|
||||
* is returned.
|
||||
*
|
||||
* $a = ApiProvider::filesystem(sys_get_temp_dir() . '/aws-beta-models');
|
||||
* $b = ApiProvider::manifest();
|
||||
*
|
||||
* $c = \Aws\or_chain($a, $b);
|
||||
* $data = $c('api', 'betaservice', '2015-08-08'); // $a handles this.
|
||||
* $data = $c('api', 's3', '2006-03-01'); // $b handles this.
|
||||
* $data = $c('api', 'invalid', '2014-12-15'); // Neither handles this.
|
||||
*/
|
||||
class ApiProvider
|
||||
{
|
||||
/** @var array A map of public API type names to their file suffix. */
|
||||
private static $typeMap = [
|
||||
'api' => 'api-2',
|
||||
'paginator' => 'paginators-1',
|
||||
'waiter' => 'waiters-2',
|
||||
'docs' => 'docs-2',
|
||||
];
|
||||
|
||||
/** @var array API manifest */
|
||||
private $manifest;
|
||||
|
||||
/** @var string The directory containing service models. */
|
||||
private $modelsDir;
|
||||
|
||||
/**
|
||||
* Resolves an API provider and ensures a non-null return value.
|
||||
*
|
||||
* @param callable $provider Provider function to invoke.
|
||||
* @param string $type Type of data ('api', 'waiter', 'paginator').
|
||||
* @param string $service Service name.
|
||||
* @param string $version API version.
|
||||
*
|
||||
* @return array
|
||||
* @throws UnresolvedApiException
|
||||
*/
|
||||
public static function resolve(callable $provider, $type, $service, $version)
|
||||
{
|
||||
// Execute the provider and return the result, if there is one.
|
||||
$result = $provider($type, $service, $version);
|
||||
if (is_array($result)) {
|
||||
if (!isset($result['metadata']['serviceIdentifier'])) {
|
||||
$result['metadata']['serviceIdentifier'] = $service;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Throw an exception with a message depending on the inputs.
|
||||
if (!isset(self::$typeMap[$type])) {
|
||||
$msg = "The type must be one of: " . implode(', ', self::$typeMap);
|
||||
} elseif ($service) {
|
||||
$msg = "The {$service} service does not have version: {$version}.";
|
||||
} else {
|
||||
$msg = "You must specify a service name to retrieve its API data.";
|
||||
}
|
||||
|
||||
throw new UnresolvedApiException($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default SDK API provider.
|
||||
*
|
||||
* This provider loads pre-built manifest data from the `data` directory.
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function defaultProvider()
|
||||
{
|
||||
return new self(dirname(__FILE__) . '/../data', \Aws\manifest());
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads API data after resolving the version to the latest, compatible,
|
||||
* available version based on the provided manifest data.
|
||||
*
|
||||
* Manifest data is essentially an associative array of service names to
|
||||
* associative arrays of API version aliases.
|
||||
*
|
||||
* [
|
||||
* ...
|
||||
* 'ec2' => [
|
||||
* 'latest' => '2014-10-01',
|
||||
* '2014-10-01' => '2014-10-01',
|
||||
* '2014-09-01' => '2014-10-01',
|
||||
* '2014-06-15' => '2014-10-01',
|
||||
* ...
|
||||
* ],
|
||||
* 'ecs' => [...],
|
||||
* 'elasticache' => [...],
|
||||
* ...
|
||||
* ]
|
||||
*
|
||||
* @param string $dir Directory containing service models.
|
||||
* @param array $manifest The API version manifest data.
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function manifest($dir, array $manifest)
|
||||
{
|
||||
return new self($dir, $manifest);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads API data from the specified directory.
|
||||
*
|
||||
* If "latest" is specified as the version, this provider must glob the
|
||||
* directory to find which is the latest available version.
|
||||
*
|
||||
* @param string $dir Directory containing service models.
|
||||
*
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the provided `$dir` is invalid.
|
||||
*/
|
||||
public static function filesystem($dir)
|
||||
{
|
||||
return new self($dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of valid versions for the specified service.
|
||||
*
|
||||
* @param string $service Service name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getVersions($service)
|
||||
{
|
||||
if (!isset($this->manifest)) {
|
||||
$this->buildVersionsList($service);
|
||||
}
|
||||
|
||||
if (!isset($this->manifest[$service]['versions'])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_values(array_unique($this->manifest[$service]['versions']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the the provider.
|
||||
*
|
||||
* @param string $type Type of data ('api', 'waiter', 'paginator').
|
||||
* @param string $service Service name.
|
||||
* @param string $version API version.
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function __invoke($type, $service, $version)
|
||||
{
|
||||
// Resolve the type or return null.
|
||||
if (isset(self::$typeMap[$type])) {
|
||||
$type = self::$typeMap[$type];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Resolve the version or return null.
|
||||
if (!isset($this->manifest)) {
|
||||
$this->buildVersionsList($service);
|
||||
}
|
||||
|
||||
if (!isset($this->manifest[$service]['versions'][$version])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$version = $this->manifest[$service]['versions'][$version];
|
||||
$path = "{$this->modelsDir}/{$service}/{$version}/{$type}.json";
|
||||
|
||||
try {
|
||||
return \Aws\load_compiled_json($path);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $modelsDir Directory containing service models.
|
||||
* @param array $manifest The API version manifest data.
|
||||
*/
|
||||
private function __construct($modelsDir, array $manifest = null)
|
||||
{
|
||||
$this->manifest = $manifest;
|
||||
$this->modelsDir = rtrim($modelsDir, '/');
|
||||
if (!is_dir($this->modelsDir)) {
|
||||
throw new \InvalidArgumentException(
|
||||
"The specified models directory, {$modelsDir}, was not found."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the versions list for the specified service by globbing the dir.
|
||||
*/
|
||||
private function buildVersionsList($service)
|
||||
{
|
||||
$dir = "{$this->modelsDir}/{$service}/";
|
||||
|
||||
if (!is_dir($dir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get versions, remove . and .., and sort in descending order.
|
||||
$results = array_diff(scandir($dir, SCANDIR_SORT_DESCENDING), ['..', '.']);
|
||||
|
||||
if (!$results) {
|
||||
$this->manifest[$service] = ['versions' => []];
|
||||
} else {
|
||||
$this->manifest[$service] = [
|
||||
'versions' => [
|
||||
'latest' => $results[0]
|
||||
]
|
||||
];
|
||||
$this->manifest[$service]['versions'] += array_combine($results, $results);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* DateTime overrides that make DateTime work more seamlessly as a string,
|
||||
* with JSON documents, and with JMESPath.
|
||||
*/
|
||||
class DateTimeResult extends \DateTime implements \JsonSerializable
|
||||
{
|
||||
/**
|
||||
* Create a new DateTimeResult from a unix timestamp.
|
||||
*
|
||||
* @param $unixTimestamp
|
||||
*
|
||||
* @return DateTimeResult
|
||||
*/
|
||||
public static function fromEpoch($unixTimestamp)
|
||||
{
|
||||
return new self(gmdate('c', $unixTimestamp));
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize the DateTimeResult as an ISO 8601 date string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->format('c');
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize the date as an ISO 8601 date when serializing as JSON.
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return (string) $this;
|
||||
}
|
||||
}
|
|
@ -1,128 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* Encapsulates the documentation strings for a given service-version and
|
||||
* provides methods for extracting the desired parts related to a service,
|
||||
* operation, error, or shape (i.e., parameter).
|
||||
*/
|
||||
class DocModel
|
||||
{
|
||||
/** @var array */
|
||||
private $docs;
|
||||
|
||||
/**
|
||||
* @param array $docs
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function __construct(array $docs)
|
||||
{
|
||||
if (!extension_loaded('tidy')) {
|
||||
throw new \RuntimeException('The "tidy" PHP extension is required.');
|
||||
}
|
||||
|
||||
$this->docs = $docs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the doc model to an array.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return $this->docs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves documentation about the service.
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getServiceDocs()
|
||||
{
|
||||
return isset($this->docs['service']) ? $this->docs['service'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves documentation about an operation.
|
||||
*
|
||||
* @param string $operation Name of the operation
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getOperationDocs($operation)
|
||||
{
|
||||
return isset($this->docs['operations'][$operation])
|
||||
? $this->docs['operations'][$operation]
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves documentation about an error.
|
||||
*
|
||||
* @param string $error Name of the error
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getErrorDocs($error)
|
||||
{
|
||||
return isset($this->docs['shapes'][$error]['base'])
|
||||
? $this->docs['shapes'][$error]['base']
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves documentation about a shape, specific to the context.
|
||||
*
|
||||
* @param string $shapeName Name of the shape.
|
||||
* @param string $parentName Name of the parent/context shape.
|
||||
* @param string $ref Name used by the context to reference the shape.
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getShapeDocs($shapeName, $parentName, $ref)
|
||||
{
|
||||
if (!isset($this->docs['shapes'][$shapeName])) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$result = '';
|
||||
$d = $this->docs['shapes'][$shapeName];
|
||||
if (isset($d['refs']["{$parentName}\$${ref}"])) {
|
||||
$result = $d['refs']["{$parentName}\$${ref}"];
|
||||
} elseif (isset($d['base'])) {
|
||||
$result = $d['base'];
|
||||
}
|
||||
|
||||
if (isset($d['append'])) {
|
||||
$result .= $d['append'];
|
||||
}
|
||||
|
||||
return $this->clean($result);
|
||||
}
|
||||
|
||||
private function clean($content)
|
||||
{
|
||||
if (!$content) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$tidy = new \Tidy();
|
||||
$tidy->parseString($content, [
|
||||
'indent' => true,
|
||||
'doctype' => 'omit',
|
||||
'output-html' => true,
|
||||
'show-body-only' => true,
|
||||
'drop-empty-paras' => true,
|
||||
'drop-font-tags' => true,
|
||||
'drop-proprietary-attributes' => true,
|
||||
'hide-comments' => true,
|
||||
'logical-emphasis' => true
|
||||
]);
|
||||
$tidy->cleanRepair();
|
||||
|
||||
return (string) $content;
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\ErrorParser;
|
||||
|
||||
use Aws\Api\Parser\PayloadParserTrait;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* Provides basic JSON error parsing functionality.
|
||||
*/
|
||||
trait JsonParserTrait
|
||||
{
|
||||
use PayloadParserTrait;
|
||||
|
||||
private function genericHandler(ResponseInterface $response)
|
||||
{
|
||||
$code = (string) $response->getStatusCode();
|
||||
|
||||
return [
|
||||
'request_id' => (string) $response->getHeaderLine('x-amzn-requestid'),
|
||||
'code' => null,
|
||||
'message' => null,
|
||||
'type' => $code[0] == '4' ? 'client' : 'server',
|
||||
'parsed' => $this->parseJson($response->getBody())
|
||||
];
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\ErrorParser;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* Parsers JSON-RPC errors.
|
||||
*/
|
||||
class JsonRpcErrorParser
|
||||
{
|
||||
use JsonParserTrait;
|
||||
|
||||
public function __invoke(ResponseInterface $response)
|
||||
{
|
||||
$data = $this->genericHandler($response);
|
||||
// Make the casing consistent across services.
|
||||
if ($data['parsed']) {
|
||||
$data['parsed'] = array_change_key_case($data['parsed']);
|
||||
}
|
||||
|
||||
if (isset($data['parsed']['__type'])) {
|
||||
$parts = explode('#', $data['parsed']['__type']);
|
||||
$data['code'] = isset($parts[1]) ? $parts[1] : $parts[0];
|
||||
$data['message'] = isset($data['parsed']['message'])
|
||||
? $data['parsed']['message']
|
||||
: null;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\ErrorParser;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* Parses JSON-REST errors.
|
||||
*/
|
||||
class RestJsonErrorParser
|
||||
{
|
||||
use JsonParserTrait;
|
||||
|
||||
public function __invoke(ResponseInterface $response)
|
||||
{
|
||||
$data = $this->genericHandler($response);
|
||||
|
||||
// Merge in error data from the JSON body
|
||||
if ($json = $data['parsed']) {
|
||||
$data = array_replace($data, $json);
|
||||
}
|
||||
|
||||
// Correct error type from services like Amazon Glacier
|
||||
if (!empty($data['type'])) {
|
||||
$data['type'] = strtolower($data['type']);
|
||||
}
|
||||
|
||||
// Retrieve the error code from services like Amazon Elastic Transcoder
|
||||
if ($code = $response->getHeaderLine('x-amzn-errortype')) {
|
||||
$colon = strpos($code, ':');
|
||||
$data['code'] = $colon ? substr($code, 0, $colon) : $code;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\ErrorParser;
|
||||
|
||||
use Aws\Api\Parser\PayloadParserTrait;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* Parses XML errors.
|
||||
*/
|
||||
class XmlErrorParser
|
||||
{
|
||||
use PayloadParserTrait;
|
||||
|
||||
public function __invoke(ResponseInterface $response)
|
||||
{
|
||||
$code = (string) $response->getStatusCode();
|
||||
|
||||
$data = [
|
||||
'type' => $code[0] == '4' ? 'client' : 'server',
|
||||
'request_id' => null,
|
||||
'code' => null,
|
||||
'message' => null,
|
||||
'parsed' => null
|
||||
];
|
||||
|
||||
$body = $response->getBody();
|
||||
if ($body->getSize() > 0) {
|
||||
$this->parseBody($this->parseXml($body), $data);
|
||||
} else {
|
||||
$this->parseHeaders($response, $data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function parseHeaders(ResponseInterface $response, array &$data)
|
||||
{
|
||||
if ($response->getStatusCode() == '404') {
|
||||
$data['code'] = 'NotFound';
|
||||
}
|
||||
|
||||
$data['message'] = $response->getStatusCode() . ' '
|
||||
. $response->getReasonPhrase();
|
||||
|
||||
if ($requestId = $response->getHeaderLine('x-amz-request-id')) {
|
||||
$data['request_id'] = $requestId;
|
||||
$data['message'] .= " (Request-ID: $requestId)";
|
||||
}
|
||||
}
|
||||
|
||||
private function parseBody(\SimpleXMLElement $body, array &$data)
|
||||
{
|
||||
$data['parsed'] = $body;
|
||||
|
||||
$namespaces = $body->getDocNamespaces();
|
||||
if (!isset($namespaces[''])) {
|
||||
$prefix = '';
|
||||
} else {
|
||||
// Account for the default namespace being defined and PHP not
|
||||
// being able to handle it :(.
|
||||
$body->registerXPathNamespace('ns', $namespaces['']);
|
||||
$prefix = 'ns:';
|
||||
}
|
||||
|
||||
if ($tempXml = $body->xpath("//{$prefix}Code[1]")) {
|
||||
$data['code'] = (string) $tempXml[0];
|
||||
}
|
||||
|
||||
if ($tempXml = $body->xpath("//{$prefix}Message[1]")) {
|
||||
$data['message'] = (string) $tempXml[0];
|
||||
}
|
||||
|
||||
$tempXml = $body->xpath("//{$prefix}RequestId[1]");
|
||||
if (empty($tempXml)) {
|
||||
$tempXml = $body->xpath("//{$prefix}RequestID[1]");
|
||||
}
|
||||
|
||||
if (isset($tempXml[0])) {
|
||||
$data['request_id'] = (string) $tempXml[0];
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* Represents a list shape.
|
||||
*/
|
||||
class ListShape extends Shape
|
||||
{
|
||||
private $member;
|
||||
|
||||
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||
{
|
||||
$definition['type'] = 'list';
|
||||
parent::__construct($definition, $shapeMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Shape
|
||||
* @throws \RuntimeException if no member is specified
|
||||
*/
|
||||
public function getMember()
|
||||
{
|
||||
if (!$this->member) {
|
||||
if (!isset($this->definition['member'])) {
|
||||
throw new \RuntimeException('No member attribute specified');
|
||||
}
|
||||
$this->member = Shape::create(
|
||||
$this->definition['member'],
|
||||
$this->shapeMap
|
||||
);
|
||||
}
|
||||
|
||||
return $this->member;
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* Represents a map shape.
|
||||
*/
|
||||
class MapShape extends Shape
|
||||
{
|
||||
/** @var Shape */
|
||||
private $value;
|
||||
|
||||
/** @var Shape */
|
||||
private $key;
|
||||
|
||||
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||
{
|
||||
$definition['type'] = 'map';
|
||||
parent::__construct($definition, $shapeMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Shape
|
||||
* @throws \RuntimeException if no value is specified
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
if (!$this->value) {
|
||||
if (!isset($this->definition['value'])) {
|
||||
throw new \RuntimeException('No value specified');
|
||||
}
|
||||
|
||||
$this->value = Shape::create(
|
||||
$this->definition['value'],
|
||||
$this->shapeMap
|
||||
);
|
||||
}
|
||||
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Shape
|
||||
*/
|
||||
public function getKey()
|
||||
{
|
||||
if (!$this->key) {
|
||||
$this->key = isset($this->definition['key'])
|
||||
? Shape::create($this->definition['key'], $this->shapeMap)
|
||||
: new Shape(['type' => 'string'], $this->shapeMap);
|
||||
}
|
||||
|
||||
return $this->key;
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* Represents an API operation.
|
||||
*/
|
||||
class Operation extends AbstractModel
|
||||
{
|
||||
private $input;
|
||||
private $output;
|
||||
private $errors;
|
||||
|
||||
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||
{
|
||||
$definition['type'] = 'structure';
|
||||
|
||||
if (!isset($definition['http']['method'])) {
|
||||
$definition['http']['method'] = 'POST';
|
||||
}
|
||||
|
||||
if (!isset($definition['http']['requestUri'])) {
|
||||
$definition['http']['requestUri'] = '/';
|
||||
}
|
||||
|
||||
parent::__construct($definition, $shapeMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an associative array of the HTTP attribute of the operation:
|
||||
*
|
||||
* - method: HTTP method of the operation
|
||||
* - requestUri: URI of the request (can include URI template placeholders)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getHttp()
|
||||
{
|
||||
return $this->definition['http'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the input shape of the operation.
|
||||
*
|
||||
* @return StructureShape
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
if (!$this->input) {
|
||||
if ($input = $this['input']) {
|
||||
$this->input = $this->shapeFor($input);
|
||||
} else {
|
||||
$this->input = new StructureShape([], $this->shapeMap);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the output shape of the operation.
|
||||
*
|
||||
* @return StructureShape
|
||||
*/
|
||||
public function getOutput()
|
||||
{
|
||||
if (!$this->output) {
|
||||
if ($output = $this['output']) {
|
||||
$this->output = $this->shapeFor($output);
|
||||
} else {
|
||||
$this->output = new StructureShape([], $this->shapeMap);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of operation error shapes.
|
||||
*
|
||||
* @return Shape[]
|
||||
*/
|
||||
public function getErrors()
|
||||
{
|
||||
if ($this->errors === null) {
|
||||
if ($errors = $this['errors']) {
|
||||
foreach ($errors as $key => $error) {
|
||||
$errors[$key] = $this->shapeFor($error);
|
||||
}
|
||||
$this->errors = $errors;
|
||||
} else {
|
||||
$this->errors = [];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->errors;
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\Service;
|
||||
use Aws\CommandInterface;
|
||||
use Aws\ResultInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
abstract class AbstractParser
|
||||
{
|
||||
/** @var \Aws\Api\Service Representation of the service API*/
|
||||
protected $api;
|
||||
|
||||
/**
|
||||
* @param Service $api Service description.
|
||||
*/
|
||||
public function __construct(Service $api)
|
||||
{
|
||||
$this->api = $api;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CommandInterface $command Command that was executed.
|
||||
* @param ResponseInterface $response Response that was received.
|
||||
*
|
||||
* @return ResultInterface
|
||||
*/
|
||||
abstract public function __invoke(
|
||||
CommandInterface $command,
|
||||
ResponseInterface $response
|
||||
);
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\DateTimeResult;
|
||||
use Aws\Api\Shape;
|
||||
use Aws\Api\StructureShape;
|
||||
use Aws\Result;
|
||||
use Aws\CommandInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
abstract class AbstractRestParser extends AbstractParser
|
||||
{
|
||||
use PayloadParserTrait;
|
||||
/**
|
||||
* Parses a payload from a response.
|
||||
*
|
||||
* @param ResponseInterface $response Response to parse.
|
||||
* @param StructureShape $member Member to parse
|
||||
* @param array $result Result value
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract protected function payload(
|
||||
ResponseInterface $response,
|
||||
StructureShape $member,
|
||||
array &$result
|
||||
);
|
||||
|
||||
public function __invoke(
|
||||
CommandInterface $command,
|
||||
ResponseInterface $response
|
||||
) {
|
||||
$output = $this->api->getOperation($command->getName())->getOutput();
|
||||
$result = [];
|
||||
|
||||
if ($payload = $output['payload']) {
|
||||
$this->extractPayload($payload, $output, $response, $result);
|
||||
}
|
||||
|
||||
foreach ($output->getMembers() as $name => $member) {
|
||||
switch ($member['location']) {
|
||||
case 'header':
|
||||
$this->extractHeader($name, $member, $response, $result);
|
||||
break;
|
||||
case 'headers':
|
||||
$this->extractHeaders($name, $member, $response, $result);
|
||||
break;
|
||||
case 'statusCode':
|
||||
$this->extractStatus($name, $response, $result);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$payload
|
||||
&& $response->getBody()->getSize() > 0
|
||||
&& count($output->getMembers()) > 0
|
||||
) {
|
||||
// if no payload was found, then parse the contents of the body
|
||||
$this->payload($response, $output, $result);
|
||||
}
|
||||
|
||||
return new Result($result);
|
||||
}
|
||||
|
||||
private function extractPayload(
|
||||
$payload,
|
||||
StructureShape $output,
|
||||
ResponseInterface $response,
|
||||
array &$result
|
||||
) {
|
||||
$member = $output->getMember($payload);
|
||||
|
||||
if ($member instanceof StructureShape) {
|
||||
// Structure members parse top-level data into a specific key.
|
||||
$result[$payload] = [];
|
||||
$this->payload($response, $member, $result[$payload]);
|
||||
} else {
|
||||
// Streaming data is just the stream from the response body.
|
||||
$result[$payload] = $response->getBody();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract a single header from the response into the result.
|
||||
*/
|
||||
private function extractHeader(
|
||||
$name,
|
||||
Shape $shape,
|
||||
ResponseInterface $response,
|
||||
&$result
|
||||
) {
|
||||
$value = $response->getHeaderLine($shape['locationName'] ?: $name);
|
||||
|
||||
switch ($shape->getType()) {
|
||||
case 'float':
|
||||
case 'double':
|
||||
$value = (float) $value;
|
||||
break;
|
||||
case 'long':
|
||||
$value = (int) $value;
|
||||
break;
|
||||
case 'boolean':
|
||||
$value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||
break;
|
||||
case 'blob':
|
||||
$value = base64_decode($value);
|
||||
break;
|
||||
case 'timestamp':
|
||||
try {
|
||||
$value = new DateTimeResult($value);
|
||||
break;
|
||||
} catch (\Exception $e) {
|
||||
// If the value cannot be parsed, then do not add it to the
|
||||
// output structure.
|
||||
return;
|
||||
}
|
||||
case 'string':
|
||||
if ($shape['jsonvalue']) {
|
||||
$value = $this->parseJson(base64_decode($value));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$result[$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract a map of headers with an optional prefix from the response.
|
||||
*/
|
||||
private function extractHeaders(
|
||||
$name,
|
||||
Shape $shape,
|
||||
ResponseInterface $response,
|
||||
&$result
|
||||
) {
|
||||
// Check if the headers are prefixed by a location name
|
||||
$result[$name] = [];
|
||||
$prefix = $shape['locationName'];
|
||||
$prefixLen = strlen($prefix);
|
||||
|
||||
foreach ($response->getHeaders() as $k => $values) {
|
||||
if (!$prefixLen) {
|
||||
$result[$name][$k] = implode(', ', $values);
|
||||
} elseif (stripos($k, $prefix) === 0) {
|
||||
$result[$name][substr($k, $prefixLen)] = implode(', ', $values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Places the status code of the response into the result array.
|
||||
*/
|
||||
private function extractStatus(
|
||||
$name,
|
||||
ResponseInterface $response,
|
||||
array &$result
|
||||
) {
|
||||
$result[$name] = (int) $response->getStatusCode();
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\CommandInterface;
|
||||
use Aws\Exception\AwsException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use GuzzleHttp\Psr7;
|
||||
|
||||
/**
|
||||
* @internal Decorates a parser and validates the x-amz-crc32 header.
|
||||
*/
|
||||
class Crc32ValidatingParser extends AbstractParser
|
||||
{
|
||||
/** @var callable */
|
||||
private $parser;
|
||||
|
||||
/**
|
||||
* @param callable $parser Parser to wrap.
|
||||
*/
|
||||
public function __construct(callable $parser)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
}
|
||||
|
||||
public function __invoke(
|
||||
CommandInterface $command,
|
||||
ResponseInterface $response
|
||||
) {
|
||||
if ($expected = $response->getHeaderLine('x-amz-crc32')) {
|
||||
$hash = hexdec(Psr7\hash($response->getBody(), 'crc32b'));
|
||||
if ($expected != $hash) {
|
||||
throw new AwsException(
|
||||
"crc32 mismatch. Expected {$expected}, found {$hash}.",
|
||||
$command,
|
||||
[
|
||||
'code' => 'ClientChecksumMismatch',
|
||||
'connection_error' => true,
|
||||
'response' => $response
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$fn = $this->parser;
|
||||
return $fn($command, $response);
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser\Exception;
|
||||
|
||||
class ParserException extends \RuntimeException {}
|
|
@ -1,58 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\DateTimeResult;
|
||||
use Aws\Api\Shape;
|
||||
|
||||
/**
|
||||
* @internal Implements standard JSON parsing.
|
||||
*/
|
||||
class JsonParser
|
||||
{
|
||||
public function parse(Shape $shape, $value)
|
||||
{
|
||||
if ($value === null) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
switch ($shape['type']) {
|
||||
case 'structure':
|
||||
$target = [];
|
||||
foreach ($shape->getMembers() as $name => $member) {
|
||||
$locationName = $member['locationName'] ?: $name;
|
||||
if (isset($value[$locationName])) {
|
||||
$target[$name] = $this->parse($member, $value[$locationName]);
|
||||
}
|
||||
}
|
||||
return $target;
|
||||
|
||||
case 'list':
|
||||
$member = $shape->getMember();
|
||||
$target = [];
|
||||
foreach ($value as $v) {
|
||||
$target[] = $this->parse($member, $v);
|
||||
}
|
||||
return $target;
|
||||
|
||||
case 'map':
|
||||
$values = $shape->getValue();
|
||||
$target = [];
|
||||
foreach ($value as $k => $v) {
|
||||
$target[$k] = $this->parse($values, $v);
|
||||
}
|
||||
return $target;
|
||||
|
||||
case 'timestamp':
|
||||
// The Unix epoch (or Unix time or POSIX time or Unix
|
||||
// timestamp) is the number of seconds that have elapsed since
|
||||
// January 1, 1970 (midnight UTC/GMT).
|
||||
return DateTimeResult::fromEpoch($value);
|
||||
|
||||
case 'blob':
|
||||
return base64_decode($value);
|
||||
|
||||
default:
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\Service;
|
||||
use Aws\Result;
|
||||
use Aws\CommandInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* @internal Implements JSON-RPC parsing (e.g., DynamoDB)
|
||||
*/
|
||||
class JsonRpcParser extends AbstractParser
|
||||
{
|
||||
use PayloadParserTrait;
|
||||
|
||||
private $parser;
|
||||
|
||||
/**
|
||||
* @param Service $api Service description
|
||||
* @param JsonParser $parser JSON body builder
|
||||
*/
|
||||
public function __construct(Service $api, JsonParser $parser = null)
|
||||
{
|
||||
parent::__construct($api);
|
||||
$this->parser = $parser ?: new JsonParser();
|
||||
}
|
||||
|
||||
public function __invoke(
|
||||
CommandInterface $command,
|
||||
ResponseInterface $response
|
||||
) {
|
||||
$operation = $this->api->getOperation($command->getName());
|
||||
$result = null === $operation['output']
|
||||
? null
|
||||
: $this->parser->parse(
|
||||
$operation->getOutput(),
|
||||
$this->parseJson($response->getBody())
|
||||
);
|
||||
|
||||
return new Result($result ?: []);
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\Parser\Exception\ParserException;
|
||||
|
||||
trait PayloadParserTrait
|
||||
{
|
||||
/**
|
||||
* @param string $json
|
||||
*
|
||||
* @throws ParserException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function parseJson($json)
|
||||
{
|
||||
$jsonPayload = json_decode($json, true);
|
||||
|
||||
if (JSON_ERROR_NONE !== json_last_error()) {
|
||||
throw new ParserException('Error parsing JSON: '
|
||||
. json_last_error_msg());
|
||||
}
|
||||
|
||||
return $jsonPayload;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $xml
|
||||
*
|
||||
* @throws ParserException
|
||||
*
|
||||
* @return \SimpleXMLElement
|
||||
*/
|
||||
private function parseXml($xml)
|
||||
{
|
||||
$priorSetting = libxml_use_internal_errors(true);
|
||||
try {
|
||||
libxml_clear_errors();
|
||||
$xmlPayload = new \SimpleXMLElement($xml);
|
||||
if ($error = libxml_get_last_error()) {
|
||||
throw new \RuntimeException($error->message);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw new ParserException("Error parsing XML: {$e->getMessage()}", 0, $e);
|
||||
} finally {
|
||||
libxml_use_internal_errors($priorSetting);
|
||||
}
|
||||
|
||||
return $xmlPayload;
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\Service;
|
||||
use Aws\Result;
|
||||
use Aws\CommandInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* @internal Parses query (XML) responses (e.g., EC2, SQS, and many others)
|
||||
*/
|
||||
class QueryParser extends AbstractParser
|
||||
{
|
||||
use PayloadParserTrait;
|
||||
|
||||
/** @var XmlParser */
|
||||
private $xmlParser;
|
||||
|
||||
/** @var bool */
|
||||
private $honorResultWrapper;
|
||||
|
||||
/**
|
||||
* @param Service $api Service description
|
||||
* @param XmlParser $xmlParser Optional XML parser
|
||||
* @param bool $honorResultWrapper Set to false to disable the peeling
|
||||
* back of result wrappers from the
|
||||
* output structure.
|
||||
*/
|
||||
public function __construct(
|
||||
Service $api,
|
||||
XmlParser $xmlParser = null,
|
||||
$honorResultWrapper = true
|
||||
) {
|
||||
parent::__construct($api);
|
||||
$this->xmlParser = $xmlParser ?: new XmlParser();
|
||||
$this->honorResultWrapper = $honorResultWrapper;
|
||||
}
|
||||
|
||||
public function __invoke(
|
||||
CommandInterface $command,
|
||||
ResponseInterface $response
|
||||
) {
|
||||
$output = $this->api->getOperation($command->getName())->getOutput();
|
||||
$xml = $this->parseXml($response->getBody());
|
||||
|
||||
if ($this->honorResultWrapper && $output['resultWrapper']) {
|
||||
$xml = $xml->{$output['resultWrapper']};
|
||||
}
|
||||
|
||||
return new Result($this->xmlParser->parse($output, $xml));
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\Service;
|
||||
use Aws\Api\StructureShape;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* @internal Implements REST-JSON parsing (e.g., Glacier, Elastic Transcoder)
|
||||
*/
|
||||
class RestJsonParser extends AbstractRestParser
|
||||
{
|
||||
use PayloadParserTrait;
|
||||
|
||||
/** @var JsonParser */
|
||||
private $parser;
|
||||
|
||||
/**
|
||||
* @param Service $api Service description
|
||||
* @param JsonParser $parser JSON body builder
|
||||
*/
|
||||
public function __construct(Service $api, JsonParser $parser = null)
|
||||
{
|
||||
parent::__construct($api);
|
||||
$this->parser = $parser ?: new JsonParser();
|
||||
}
|
||||
|
||||
protected function payload(
|
||||
ResponseInterface $response,
|
||||
StructureShape $member,
|
||||
array &$result
|
||||
) {
|
||||
$jsonBody = $this->parseJson($response->getBody());
|
||||
|
||||
if ($jsonBody) {
|
||||
$result += $this->parser->parse($member, $jsonBody);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\StructureShape;
|
||||
use Aws\Api\Service;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* @internal Implements REST-XML parsing (e.g., S3, CloudFront, etc...)
|
||||
*/
|
||||
class RestXmlParser extends AbstractRestParser
|
||||
{
|
||||
use PayloadParserTrait;
|
||||
|
||||
/** @var XmlParser */
|
||||
private $parser;
|
||||
|
||||
/**
|
||||
* @param Service $api Service description
|
||||
* @param XmlParser $parser XML body parser
|
||||
*/
|
||||
public function __construct(Service $api, XmlParser $parser = null)
|
||||
{
|
||||
parent::__construct($api);
|
||||
$this->parser = $parser ?: new XmlParser();
|
||||
}
|
||||
|
||||
protected function payload(
|
||||
ResponseInterface $response,
|
||||
StructureShape $member,
|
||||
array &$result
|
||||
) {
|
||||
$xml = $this->parseXml($response->getBody());
|
||||
$result += $this->parser->parse($member, $xml);
|
||||
}
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\DateTimeResult;
|
||||
use Aws\Api\ListShape;
|
||||
use Aws\Api\MapShape;
|
||||
use Aws\Api\Shape;
|
||||
use Aws\Api\StructureShape;
|
||||
|
||||
/**
|
||||
* @internal Implements standard XML parsing for REST-XML and Query protocols.
|
||||
*/
|
||||
class XmlParser
|
||||
{
|
||||
public function parse(StructureShape $shape, \SimpleXMLElement $value)
|
||||
{
|
||||
return $this->dispatch($shape, $value);
|
||||
}
|
||||
|
||||
private function dispatch($shape, \SimpleXMLElement $value)
|
||||
{
|
||||
static $methods = [
|
||||
'structure' => 'parse_structure',
|
||||
'list' => 'parse_list',
|
||||
'map' => 'parse_map',
|
||||
'blob' => 'parse_blob',
|
||||
'boolean' => 'parse_boolean',
|
||||
'integer' => 'parse_integer',
|
||||
'float' => 'parse_float',
|
||||
'double' => 'parse_float',
|
||||
'timestamp' => 'parse_timestamp',
|
||||
];
|
||||
|
||||
$type = $shape['type'];
|
||||
if (isset($methods[$type])) {
|
||||
return $this->{$methods[$type]}($shape, $value);
|
||||
}
|
||||
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
private function parse_structure(
|
||||
StructureShape $shape,
|
||||
\SimpleXMLElement $value
|
||||
) {
|
||||
$target = [];
|
||||
|
||||
foreach ($shape->getMembers() as $name => $member) {
|
||||
// Extract the name of the XML node
|
||||
$node = $this->memberKey($member, $name);
|
||||
if (isset($value->{$node})) {
|
||||
$target[$name] = $this->dispatch($member, $value->{$node});
|
||||
}
|
||||
}
|
||||
|
||||
return $target;
|
||||
}
|
||||
|
||||
private function memberKey(Shape $shape, $name)
|
||||
{
|
||||
if (null !== $shape['locationName']) {
|
||||
return $shape['locationName'];
|
||||
}
|
||||
|
||||
if ($shape instanceof ListShape && $shape['flattened']) {
|
||||
return $shape->getMember()['locationName'] ?: $name;
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
private function parse_list(ListShape $shape, \SimpleXMLElement $value)
|
||||
{
|
||||
$target = [];
|
||||
$member = $shape->getMember();
|
||||
|
||||
if (!$shape['flattened']) {
|
||||
$value = $value->{$member['locationName'] ?: 'member'};
|
||||
}
|
||||
|
||||
foreach ($value as $v) {
|
||||
$target[] = $this->dispatch($member, $v);
|
||||
}
|
||||
|
||||
return $target;
|
||||
}
|
||||
|
||||
private function parse_map(MapShape $shape, \SimpleXMLElement $value)
|
||||
{
|
||||
$target = [];
|
||||
|
||||
if (!$shape['flattened']) {
|
||||
$value = $value->entry;
|
||||
}
|
||||
|
||||
$mapKey = $shape->getKey();
|
||||
$mapValue = $shape->getValue();
|
||||
$keyName = $shape->getKey()['locationName'] ?: 'key';
|
||||
$valueName = $shape->getValue()['locationName'] ?: 'value';
|
||||
|
||||
foreach ($value as $node) {
|
||||
$key = $this->dispatch($mapKey, $node->{$keyName});
|
||||
$value = $this->dispatch($mapValue, $node->{$valueName});
|
||||
$target[$key] = $value;
|
||||
}
|
||||
|
||||
return $target;
|
||||
}
|
||||
|
||||
private function parse_blob(Shape $shape, $value)
|
||||
{
|
||||
return base64_decode((string) $value);
|
||||
}
|
||||
|
||||
private function parse_float(Shape $shape, $value)
|
||||
{
|
||||
return (float) (string) $value;
|
||||
}
|
||||
|
||||
private function parse_integer(Shape $shape, $value)
|
||||
{
|
||||
return (int) (string) $value;
|
||||
}
|
||||
|
||||
private function parse_boolean(Shape $shape, $value)
|
||||
{
|
||||
return $value == 'true' ? true : false;
|
||||
}
|
||||
|
||||
private function parse_timestamp(Shape $shape, $value)
|
||||
{
|
||||
return new DateTimeResult($value);
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\Shape;
|
||||
use Aws\Api\ListShape;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class Ec2ParamBuilder extends QueryParamBuilder
|
||||
{
|
||||
protected function queryName(Shape $shape, $default = null)
|
||||
{
|
||||
return ($shape['queryName']
|
||||
?: ucfirst($shape['locationName']))
|
||||
?: $default;
|
||||
}
|
||||
|
||||
protected function isFlat(Shape $shape)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function format_list(
|
||||
ListShape $shape,
|
||||
array $value,
|
||||
$prefix,
|
||||
&$query
|
||||
) {
|
||||
// Handle empty list serialization
|
||||
if (!$value) {
|
||||
$query[$prefix] = false;
|
||||
} else {
|
||||
$items = $shape->getMember();
|
||||
foreach ($value as $k => $v) {
|
||||
$this->format($items, $v, $prefix . '.' . ($k + 1), $query);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\Service;
|
||||
use Aws\Api\Shape;
|
||||
use Aws\Api\TimestampShape;
|
||||
|
||||
/**
|
||||
* Formats the JSON body of a JSON-REST or JSON-RPC operation.
|
||||
* @internal
|
||||
*/
|
||||
class JsonBody
|
||||
{
|
||||
private $api;
|
||||
|
||||
public function __construct(Service $api)
|
||||
{
|
||||
$this->api = $api;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the JSON Content-Type header for a service API
|
||||
*
|
||||
* @param Service $service
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getContentType(Service $service)
|
||||
{
|
||||
return 'application/x-amz-json-'
|
||||
. number_format($service->getMetadata('jsonVersion'), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the JSON body based on an array of arguments.
|
||||
*
|
||||
* @param Shape $shape Operation being constructed
|
||||
* @param array $args Associative array of arguments
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function build(Shape $shape, array $args)
|
||||
{
|
||||
$result = json_encode($this->format($shape, $args));
|
||||
|
||||
return $result == '[]' ? '{}' : $result;
|
||||
}
|
||||
|
||||
private function format(Shape $shape, $value)
|
||||
{
|
||||
switch ($shape['type']) {
|
||||
case 'structure':
|
||||
$data = [];
|
||||
foreach ($value as $k => $v) {
|
||||
if ($v !== null && $shape->hasMember($k)) {
|
||||
$valueShape = $shape->getMember($k);
|
||||
$data[$valueShape['locationName'] ?: $k]
|
||||
= $this->format($valueShape, $v);
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
|
||||
case 'list':
|
||||
$items = $shape->getMember();
|
||||
foreach ($value as $k => $v) {
|
||||
$value[$k] = $this->format($items, $v);
|
||||
}
|
||||
return $value;
|
||||
|
||||
case 'map':
|
||||
if (empty($value)) {
|
||||
return new \stdClass;
|
||||
}
|
||||
$values = $shape->getValue();
|
||||
foreach ($value as $k => $v) {
|
||||
$value[$k] = $this->format($values, $v);
|
||||
}
|
||||
return $value;
|
||||
|
||||
case 'blob':
|
||||
return base64_encode($value);
|
||||
|
||||
case 'timestamp':
|
||||
return TimestampShape::format($value, 'unixTimestamp');
|
||||
|
||||
default:
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\Service;
|
||||
use Aws\CommandInterface;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
|
||||
/**
|
||||
* Prepares a JSON-RPC request for transfer.
|
||||
* @internal
|
||||
*/
|
||||
class JsonRpcSerializer
|
||||
{
|
||||
/** @var JsonBody */
|
||||
private $jsonFormatter;
|
||||
|
||||
/** @var string */
|
||||
private $endpoint;
|
||||
|
||||
/** @var Service */
|
||||
private $api;
|
||||
|
||||
/** @var string */
|
||||
private $contentType;
|
||||
|
||||
/**
|
||||
* @param Service $api Service description
|
||||
* @param string $endpoint Endpoint to connect to
|
||||
* @param JsonBody $jsonFormatter Optional JSON formatter to use
|
||||
*/
|
||||
public function __construct(
|
||||
Service $api,
|
||||
$endpoint,
|
||||
JsonBody $jsonFormatter = null
|
||||
) {
|
||||
$this->endpoint = $endpoint;
|
||||
$this->api = $api;
|
||||
$this->jsonFormatter = $jsonFormatter ?: new JsonBody($this->api);
|
||||
$this->contentType = JsonBody::getContentType($api);
|
||||
}
|
||||
|
||||
/**
|
||||
* When invoked with an AWS command, returns a serialization array
|
||||
* containing "method", "uri", "headers", and "body" key value pairs.
|
||||
*
|
||||
* @param CommandInterface $command
|
||||
*
|
||||
* @return RequestInterface
|
||||
*/
|
||||
public function __invoke(CommandInterface $command)
|
||||
{
|
||||
$name = $command->getName();
|
||||
$operation = $this->api->getOperation($name);
|
||||
|
||||
return new Request(
|
||||
$operation['http']['method'],
|
||||
$this->endpoint,
|
||||
[
|
||||
'X-Amz-Target' => $this->api->getMetadata('targetPrefix') . '.' . $name,
|
||||
'Content-Type' => $this->contentType
|
||||
],
|
||||
$this->jsonFormatter->build(
|
||||
$operation->getInput(),
|
||||
$command->toArray()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,154 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\StructureShape;
|
||||
use Aws\Api\ListShape;
|
||||
use Aws\Api\MapShape;
|
||||
use Aws\Api\Shape;
|
||||
use Aws\Api\TimestampShape;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class QueryParamBuilder
|
||||
{
|
||||
private $methods;
|
||||
|
||||
protected function queryName(Shape $shape, $default = null)
|
||||
{
|
||||
if (null !== $shape['queryName']) {
|
||||
return $shape['queryName'];
|
||||
}
|
||||
|
||||
if (null !== $shape['locationName']) {
|
||||
return $shape['locationName'];
|
||||
}
|
||||
|
||||
if ($this->isFlat($shape) && !empty($shape['member']['locationName'])) {
|
||||
return $shape['member']['locationName'];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
protected function isFlat(Shape $shape)
|
||||
{
|
||||
return $shape['flattened'] === true;
|
||||
}
|
||||
|
||||
public function __invoke(StructureShape $shape, array $params)
|
||||
{
|
||||
if (!$this->methods) {
|
||||
$this->methods = array_fill_keys(get_class_methods($this), true);
|
||||
}
|
||||
|
||||
$query = [];
|
||||
$this->format_structure($shape, $params, '', $query);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
protected function format(Shape $shape, $value, $prefix, array &$query)
|
||||
{
|
||||
$type = 'format_' . $shape['type'];
|
||||
if (isset($this->methods[$type])) {
|
||||
$this->{$type}($shape, $value, $prefix, $query);
|
||||
} else {
|
||||
$query[$prefix] = (string) $value;
|
||||
}
|
||||
}
|
||||
|
||||
protected function format_structure(
|
||||
StructureShape $shape,
|
||||
array $value,
|
||||
$prefix,
|
||||
&$query
|
||||
) {
|
||||
if ($prefix) {
|
||||
$prefix .= '.';
|
||||
}
|
||||
|
||||
foreach ($value as $k => $v) {
|
||||
if ($shape->hasMember($k)) {
|
||||
$member = $shape->getMember($k);
|
||||
$this->format(
|
||||
$member,
|
||||
$v,
|
||||
$prefix . $this->queryName($member, $k),
|
||||
$query
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function format_list(
|
||||
ListShape $shape,
|
||||
array $value,
|
||||
$prefix,
|
||||
&$query
|
||||
) {
|
||||
// Handle empty list serialization
|
||||
if (!$value) {
|
||||
$query[$prefix] = '';
|
||||
return;
|
||||
}
|
||||
|
||||
$items = $shape->getMember();
|
||||
|
||||
if (!$this->isFlat($shape)) {
|
||||
$locationName = $shape->getMember()['locationName'] ?: 'member';
|
||||
$prefix .= ".$locationName";
|
||||
} elseif ($name = $this->queryName($items)) {
|
||||
$parts = explode('.', $prefix);
|
||||
$parts[count($parts) - 1] = $name;
|
||||
$prefix = implode('.', $parts);
|
||||
}
|
||||
|
||||
foreach ($value as $k => $v) {
|
||||
$this->format($items, $v, $prefix . '.' . ($k + 1), $query);
|
||||
}
|
||||
}
|
||||
|
||||
protected function format_map(
|
||||
MapShape $shape,
|
||||
array $value,
|
||||
$prefix,
|
||||
array &$query
|
||||
) {
|
||||
$vals = $shape->getValue();
|
||||
$keys = $shape->getKey();
|
||||
|
||||
if (!$this->isFlat($shape)) {
|
||||
$prefix .= '.entry';
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$keyName = '%s.%d.' . $this->queryName($keys, 'key');
|
||||
$valueName = '%s.%s.' . $this->queryName($vals, 'value');
|
||||
|
||||
foreach ($value as $k => $v) {
|
||||
$i++;
|
||||
$this->format($keys, $k, sprintf($keyName, $prefix, $i), $query);
|
||||
$this->format($vals, $v, sprintf($valueName, $prefix, $i), $query);
|
||||
}
|
||||
}
|
||||
|
||||
protected function format_blob(Shape $shape, $value, $prefix, array &$query)
|
||||
{
|
||||
$query[$prefix] = base64_encode($value);
|
||||
}
|
||||
|
||||
protected function format_timestamp(
|
||||
TimestampShape $shape,
|
||||
$value,
|
||||
$prefix,
|
||||
array &$query
|
||||
) {
|
||||
$query[$prefix] = TimestampShape::format($value, 'iso8601');
|
||||
}
|
||||
|
||||
protected function format_boolean(Shape $shape, $value, $prefix, array &$query)
|
||||
{
|
||||
$query[$prefix] = ($value) ? 'true' : 'false';
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\Service;
|
||||
use Aws\CommandInterface;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
|
||||
/**
|
||||
* Serializes a query protocol request.
|
||||
* @internal
|
||||
*/
|
||||
class QuerySerializer
|
||||
{
|
||||
private $endpoint;
|
||||
private $api;
|
||||
private $paramBuilder;
|
||||
|
||||
public function __construct(
|
||||
Service $api,
|
||||
$endpoint,
|
||||
callable $paramBuilder = null
|
||||
) {
|
||||
$this->api = $api;
|
||||
$this->endpoint = $endpoint;
|
||||
$this->paramBuilder = $paramBuilder ?: new QueryParamBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* When invoked with an AWS command, returns a serialization array
|
||||
* containing "method", "uri", "headers", and "body" key value pairs.
|
||||
*
|
||||
* @param CommandInterface $command
|
||||
*
|
||||
* @return RequestInterface
|
||||
*/
|
||||
public function __invoke(CommandInterface $command)
|
||||
{
|
||||
$operation = $this->api->getOperation($command->getName());
|
||||
|
||||
$body = [
|
||||
'Action' => $command->getName(),
|
||||
'Version' => $this->api->getMetadata('apiVersion')
|
||||
];
|
||||
|
||||
$params = $command->toArray();
|
||||
|
||||
// Only build up the parameters when there are parameters to build
|
||||
if ($params) {
|
||||
$body += call_user_func(
|
||||
$this->paramBuilder,
|
||||
$operation->getInput(),
|
||||
$params
|
||||
);
|
||||
}
|
||||
|
||||
$body = http_build_query($body, null, '&', PHP_QUERY_RFC3986);
|
||||
|
||||
return new Request(
|
||||
'POST',
|
||||
$this->endpoint,
|
||||
[
|
||||
'Content-Length' => strlen($body),
|
||||
'Content-Type' => 'application/x-www-form-urlencoded'
|
||||
],
|
||||
$body
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\Service;
|
||||
use Aws\Api\StructureShape;
|
||||
|
||||
/**
|
||||
* Serializes requests for the REST-JSON protocol.
|
||||
* @internal
|
||||
*/
|
||||
class RestJsonSerializer extends RestSerializer
|
||||
{
|
||||
/** @var JsonBody */
|
||||
private $jsonFormatter;
|
||||
|
||||
/** @var string */
|
||||
private $contentType;
|
||||
|
||||
/**
|
||||
* @param Service $api Service API description
|
||||
* @param string $endpoint Endpoint to connect to
|
||||
* @param JsonBody $jsonFormatter Optional JSON formatter to use
|
||||
*/
|
||||
public function __construct(
|
||||
Service $api,
|
||||
$endpoint,
|
||||
JsonBody $jsonFormatter = null
|
||||
) {
|
||||
parent::__construct($api, $endpoint);
|
||||
$this->contentType = JsonBody::getContentType($api);
|
||||
$this->jsonFormatter = $jsonFormatter ?: new JsonBody($api);
|
||||
}
|
||||
|
||||
protected function payload(StructureShape $member, array $value, array &$opts)
|
||||
{
|
||||
$opts['headers']['Content-Type'] = $this->contentType;
|
||||
$opts['body'] = (string) $this->jsonFormatter->build($member, $value);
|
||||
}
|
||||
}
|
|
@ -1,208 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\MapShape;
|
||||
use Aws\Api\Service;
|
||||
use Aws\Api\Operation;
|
||||
use Aws\Api\Shape;
|
||||
use Aws\Api\StructureShape;
|
||||
use Aws\Api\TimestampShape;
|
||||
use Aws\CommandInterface;
|
||||
use GuzzleHttp\Psr7;
|
||||
use GuzzleHttp\Psr7\Uri;
|
||||
use GuzzleHttp\Psr7\UriResolver;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
|
||||
/**
|
||||
* Serializes HTTP locations like header, uri, payload, etc...
|
||||
* @internal
|
||||
*/
|
||||
abstract class RestSerializer
|
||||
{
|
||||
/** @var Service */
|
||||
private $api;
|
||||
|
||||
/** @var Psr7\Uri */
|
||||
private $endpoint;
|
||||
|
||||
/**
|
||||
* @param Service $api Service API description
|
||||
* @param string $endpoint Endpoint to connect to
|
||||
*/
|
||||
public function __construct(Service $api, $endpoint)
|
||||
{
|
||||
$this->api = $api;
|
||||
$this->endpoint = Psr7\uri_for($endpoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CommandInterface $command Command to serialized
|
||||
*
|
||||
* @return RequestInterface
|
||||
*/
|
||||
public function __invoke(CommandInterface $command)
|
||||
{
|
||||
$operation = $this->api->getOperation($command->getName());
|
||||
$args = $command->toArray();
|
||||
$opts = $this->serialize($operation, $args);
|
||||
$uri = $this->buildEndpoint($operation, $args, $opts);
|
||||
|
||||
return new Psr7\Request(
|
||||
$operation['http']['method'],
|
||||
$uri,
|
||||
isset($opts['headers']) ? $opts['headers'] : [],
|
||||
isset($opts['body']) ? $opts['body'] : null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifies a hash of request options for a payload body.
|
||||
*
|
||||
* @param StructureShape $member Member to serialize
|
||||
* @param array $value Value to serialize
|
||||
* @param array $opts Request options to modify.
|
||||
*/
|
||||
abstract protected function payload(
|
||||
StructureShape $member,
|
||||
array $value,
|
||||
array &$opts
|
||||
);
|
||||
|
||||
private function serialize(Operation $operation, array $args)
|
||||
{
|
||||
$opts = [];
|
||||
$input = $operation->getInput();
|
||||
|
||||
// Apply the payload trait if present
|
||||
if ($payload = $input['payload']) {
|
||||
$this->applyPayload($input, $payload, $args, $opts);
|
||||
}
|
||||
|
||||
foreach ($args as $name => $value) {
|
||||
if ($input->hasMember($name)) {
|
||||
$member = $input->getMember($name);
|
||||
$location = $member['location'];
|
||||
if (!$payload && !$location) {
|
||||
$bodyMembers[$name] = $value;
|
||||
} elseif ($location == 'header') {
|
||||
$this->applyHeader($name, $member, $value, $opts);
|
||||
} elseif ($location == 'querystring') {
|
||||
$this->applyQuery($name, $member, $value, $opts);
|
||||
} elseif ($location == 'headers') {
|
||||
$this->applyHeaderMap($name, $member, $value, $opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($bodyMembers)) {
|
||||
$this->payload($operation->getInput(), $bodyMembers, $opts);
|
||||
}
|
||||
|
||||
return $opts;
|
||||
}
|
||||
|
||||
private function applyPayload(StructureShape $input, $name, array $args, array &$opts)
|
||||
{
|
||||
if (!isset($args[$name])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$m = $input->getMember($name);
|
||||
|
||||
if ($m['streaming'] ||
|
||||
($m['type'] == 'string' || $m['type'] == 'blob')
|
||||
) {
|
||||
// Streaming bodies or payloads that are strings are
|
||||
// always just a stream of data.
|
||||
$opts['body'] = Psr7\stream_for($args[$name]);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->payload($m, $args[$name], $opts);
|
||||
}
|
||||
|
||||
private function applyHeader($name, Shape $member, $value, array &$opts)
|
||||
{
|
||||
if ($member->getType() == 'timestamp') {
|
||||
$value = TimestampShape::format($value, 'rfc822');
|
||||
}
|
||||
if ($member['jsonvalue']) {
|
||||
$value = json_encode($value);
|
||||
if (empty($value) && JSON_ERROR_NONE !== json_last_error()) {
|
||||
throw new \InvalidArgumentException('Unable to encode the provided value'
|
||||
. ' with \'json_encode\'. ' . json_last_error_msg());
|
||||
}
|
||||
|
||||
$value = base64_encode($value);
|
||||
}
|
||||
|
||||
$opts['headers'][$member['locationName'] ?: $name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: This is currently only present in the Amazon S3 model.
|
||||
*/
|
||||
private function applyHeaderMap($name, Shape $member, array $value, array &$opts)
|
||||
{
|
||||
$prefix = $member['locationName'];
|
||||
foreach ($value as $k => $v) {
|
||||
$opts['headers'][$prefix . $k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
private function applyQuery($name, Shape $member, $value, array &$opts)
|
||||
{
|
||||
if ($member instanceof MapShape) {
|
||||
$opts['query'] = isset($opts['query']) && is_array($opts['query'])
|
||||
? $opts['query'] + $value
|
||||
: $value;
|
||||
} elseif ($value !== null) {
|
||||
if ($member->getType() === 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
}
|
||||
|
||||
$opts['query'][$member['locationName'] ?: $name] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
private function buildEndpoint(Operation $operation, array $args, array $opts)
|
||||
{
|
||||
$varspecs = [];
|
||||
|
||||
// Create an associative array of varspecs used in expansions
|
||||
foreach ($operation->getInput()->getMembers() as $name => $member) {
|
||||
if ($member['location'] == 'uri') {
|
||||
$varspecs[$member['locationName'] ?: $name] =
|
||||
isset($args[$name])
|
||||
? $args[$name]
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
$relative = preg_replace_callback(
|
||||
'/\{([^\}]+)\}/',
|
||||
function (array $matches) use ($varspecs) {
|
||||
$isGreedy = substr($matches[1], -1, 1) == '+';
|
||||
$k = $isGreedy ? substr($matches[1], 0, -1) : $matches[1];
|
||||
if (!isset($varspecs[$k])) {
|
||||
return '';
|
||||
} elseif ($isGreedy) {
|
||||
return str_replace('%2F', '/', rawurlencode($varspecs[$k]));
|
||||
} else {
|
||||
return rawurlencode($varspecs[$k]);
|
||||
}
|
||||
},
|
||||
$operation['http']['requestUri']
|
||||
);
|
||||
|
||||
// Add the query string variables or appending to one if needed.
|
||||
if (!empty($opts['query'])) {
|
||||
$append = Psr7\build_query($opts['query']);
|
||||
$relative .= strpos($relative, '?') ? "&{$append}" : "?$append";
|
||||
}
|
||||
|
||||
// Expand path place holders using Amazon's slightly different URI
|
||||
// template syntax.
|
||||
return UriResolver::resolve($this->endpoint, new Uri($relative));
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\StructureShape;
|
||||
use Aws\Api\Service;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class RestXmlSerializer extends RestSerializer
|
||||
{
|
||||
/** @var XmlBody */
|
||||
private $xmlBody;
|
||||
|
||||
/**
|
||||
* @param Service $api Service API description
|
||||
* @param string $endpoint Endpoint to connect to
|
||||
* @param XmlBody $xmlBody Optional XML formatter to use
|
||||
*/
|
||||
public function __construct(
|
||||
Service $api,
|
||||
$endpoint,
|
||||
XmlBody $xmlBody = null
|
||||
) {
|
||||
parent::__construct($api, $endpoint);
|
||||
$this->xmlBody = $xmlBody ?: new XmlBody($api);
|
||||
}
|
||||
|
||||
protected function payload(StructureShape $member, array $value, array &$opts)
|
||||
{
|
||||
$opts['headers']['Content-Type'] = 'application/xml';
|
||||
$opts['body'] = (string) $this->xmlBody->build($member, $value);
|
||||
}
|
||||
}
|
|
@ -1,217 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\MapShape;
|
||||
use Aws\Api\Service;
|
||||
use Aws\Api\Shape;
|
||||
use Aws\Api\StructureShape;
|
||||
use Aws\Api\ListShape;
|
||||
use Aws\Api\TimestampShape;
|
||||
use XMLWriter;
|
||||
|
||||
/**
|
||||
* @internal Formats the XML body of a REST-XML services.
|
||||
*/
|
||||
class XmlBody
|
||||
{
|
||||
/** @var \Aws\Api\Service */
|
||||
private $api;
|
||||
|
||||
/**
|
||||
* @param Service $api API being used to create the XML body.
|
||||
*/
|
||||
public function __construct(Service $api)
|
||||
{
|
||||
$this->api = $api;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the XML body based on an array of arguments.
|
||||
*
|
||||
* @param Shape $shape Operation being constructed
|
||||
* @param array $args Associative array of arguments
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function build(Shape $shape, array $args)
|
||||
{
|
||||
$xml = new XMLWriter();
|
||||
$xml->openMemory();
|
||||
$xml->startDocument('1.0', 'UTF-8');
|
||||
$this->format($shape, $shape['locationName'] ?: $shape['name'], $args, $xml);
|
||||
$xml->endDocument();
|
||||
|
||||
return $xml->outputMemory();
|
||||
}
|
||||
|
||||
private function startElement(Shape $shape, $name, XMLWriter $xml)
|
||||
{
|
||||
$xml->startElement($name);
|
||||
|
||||
if ($ns = $shape['xmlNamespace']) {
|
||||
$xml->writeAttribute(
|
||||
isset($ns['prefix']) ? "xmlns:{$ns['prefix']}" : 'xmlns',
|
||||
$shape['xmlNamespace']['uri']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function format(Shape $shape, $name, $value, XMLWriter $xml)
|
||||
{
|
||||
// Any method mentioned here has a custom serialization handler.
|
||||
static $methods = [
|
||||
'add_structure' => true,
|
||||
'add_list' => true,
|
||||
'add_blob' => true,
|
||||
'add_timestamp' => true,
|
||||
'add_boolean' => true,
|
||||
'add_map' => true,
|
||||
'add_string' => true
|
||||
];
|
||||
|
||||
$type = 'add_' . $shape['type'];
|
||||
if (isset($methods[$type])) {
|
||||
$this->{$type}($shape, $name, $value, $xml);
|
||||
} else {
|
||||
$this->defaultShape($shape, $name, $value, $xml);
|
||||
}
|
||||
}
|
||||
|
||||
private function defaultShape(Shape $shape, $name, $value, XMLWriter $xml)
|
||||
{
|
||||
$this->startElement($shape, $name, $xml);
|
||||
$xml->writeRaw($value);
|
||||
$xml->endElement();
|
||||
}
|
||||
|
||||
private function add_structure(
|
||||
StructureShape $shape,
|
||||
$name,
|
||||
array $value,
|
||||
\XMLWriter $xml
|
||||
) {
|
||||
$this->startElement($shape, $name, $xml);
|
||||
|
||||
foreach ($this->getStructureMembers($shape, $value) as $k => $definition) {
|
||||
$this->format(
|
||||
$definition['member'],
|
||||
$definition['member']['locationName'] ?: $k,
|
||||
$definition['value'],
|
||||
$xml
|
||||
);
|
||||
}
|
||||
|
||||
$xml->endElement();
|
||||
}
|
||||
|
||||
private function getStructureMembers(StructureShape $shape, array $value)
|
||||
{
|
||||
$members = [];
|
||||
|
||||
foreach ($value as $k => $v) {
|
||||
if ($v !== null && $shape->hasMember($k)) {
|
||||
$definition = [
|
||||
'member' => $shape->getMember($k),
|
||||
'value' => $v,
|
||||
];
|
||||
|
||||
if ($definition['member']['xmlAttribute']) {
|
||||
// array_unshift_associative
|
||||
$members = [$k => $definition] + $members;
|
||||
} else {
|
||||
$members[$k] = $definition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $members;
|
||||
}
|
||||
|
||||
private function add_list(
|
||||
ListShape $shape,
|
||||
$name,
|
||||
array $value,
|
||||
XMLWriter $xml
|
||||
) {
|
||||
$items = $shape->getMember();
|
||||
|
||||
if ($shape['flattened']) {
|
||||
$elementName = $name;
|
||||
} else {
|
||||
$this->startElement($shape, $name, $xml);
|
||||
$elementName = $items['locationName'] ?: 'member';
|
||||
}
|
||||
|
||||
foreach ($value as $v) {
|
||||
$this->format($items, $elementName, $v, $xml);
|
||||
}
|
||||
|
||||
if (!$shape['flattened']) {
|
||||
$xml->endElement();
|
||||
}
|
||||
}
|
||||
|
||||
private function add_map(
|
||||
MapShape $shape,
|
||||
$name,
|
||||
array $value,
|
||||
XMLWriter $xml
|
||||
) {
|
||||
$xmlEntry = $shape['flattened'] ? $shape['locationName'] : 'entry';
|
||||
$xmlKey = $shape->getKey()['locationName'] ?: 'key';
|
||||
$xmlValue = $shape->getValue()['locationName'] ?: 'value';
|
||||
|
||||
$this->startElement($shape, $name, $xml);
|
||||
|
||||
foreach ($value as $key => $v) {
|
||||
$this->startElement($shape, $xmlEntry, $xml);
|
||||
$this->format($shape->getKey(), $xmlKey, $key, $xml);
|
||||
$this->format($shape->getValue(), $xmlValue, $v, $xml);
|
||||
$xml->endElement();
|
||||
}
|
||||
|
||||
$xml->endElement();
|
||||
}
|
||||
|
||||
private function add_blob(Shape $shape, $name, $value, XMLWriter $xml)
|
||||
{
|
||||
$this->startElement($shape, $name, $xml);
|
||||
$xml->writeRaw(base64_encode($value));
|
||||
$xml->endElement();
|
||||
}
|
||||
|
||||
private function add_timestamp(
|
||||
TimestampShape $shape,
|
||||
$name,
|
||||
$value,
|
||||
XMLWriter $xml
|
||||
) {
|
||||
$this->startElement($shape, $name, $xml);
|
||||
$xml->writeRaw(TimestampShape::format($value, 'iso8601'));
|
||||
$xml->endElement();
|
||||
}
|
||||
|
||||
private function add_boolean(
|
||||
Shape $shape,
|
||||
$name,
|
||||
$value,
|
||||
XMLWriter $xml
|
||||
) {
|
||||
$this->startElement($shape, $name, $xml);
|
||||
$xml->writeRaw($value ? 'true' : 'false');
|
||||
$xml->endElement();
|
||||
}
|
||||
|
||||
private function add_string(
|
||||
Shape $shape,
|
||||
$name,
|
||||
$value,
|
||||
XMLWriter $xml
|
||||
) {
|
||||
if ($shape['xmlAttribute']) {
|
||||
$xml->writeAttribute($shape['locationName'] ?: $name, $value);
|
||||
} else {
|
||||
$this->defaultShape($shape, $name, $value, $xml);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,431 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
use Aws\Api\Serializer\QuerySerializer;
|
||||
use Aws\Api\Serializer\Ec2ParamBuilder;
|
||||
use Aws\Api\Parser\QueryParser;
|
||||
|
||||
/**
|
||||
* Represents a web service API model.
|
||||
*/
|
||||
class Service extends AbstractModel
|
||||
{
|
||||
/** @var callable */
|
||||
private $apiProvider;
|
||||
|
||||
/** @var string */
|
||||
private $serviceName;
|
||||
|
||||
/** @var string */
|
||||
private $apiVersion;
|
||||
|
||||
/** @var Operation[] */
|
||||
private $operations = [];
|
||||
|
||||
/** @var array */
|
||||
private $paginators = null;
|
||||
|
||||
/** @var array */
|
||||
private $waiters = null;
|
||||
|
||||
/**
|
||||
* @param array $definition
|
||||
* @param callable $provider
|
||||
*
|
||||
* @internal param array $definition Service description
|
||||
*/
|
||||
public function __construct(array $definition, callable $provider)
|
||||
{
|
||||
static $defaults = [
|
||||
'operations' => [],
|
||||
'shapes' => [],
|
||||
'metadata' => []
|
||||
], $defaultMeta = [
|
||||
'apiVersion' => null,
|
||||
'serviceFullName' => null,
|
||||
'endpointPrefix' => null,
|
||||
'signingName' => null,
|
||||
'signatureVersion' => null,
|
||||
'protocol' => null,
|
||||
'uid' => null
|
||||
];
|
||||
|
||||
$definition += $defaults;
|
||||
$definition['metadata'] += $defaultMeta;
|
||||
$this->definition = $definition;
|
||||
$this->apiProvider = $provider;
|
||||
parent::__construct($definition, new ShapeMap($definition['shapes']));
|
||||
|
||||
if (isset($definition['metadata']['serviceIdentifier'])) {
|
||||
$this->serviceName = $this->getServiceName();
|
||||
} else {
|
||||
$this->serviceName = $this->getEndpointPrefix();
|
||||
}
|
||||
|
||||
$this->apiVersion = $this->getApiVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a request serializer for the provided API object.
|
||||
*
|
||||
* @param Service $api API that contains a protocol.
|
||||
* @param string $endpoint Endpoint to send requests to.
|
||||
*
|
||||
* @return callable
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
public static function createSerializer(Service $api, $endpoint)
|
||||
{
|
||||
static $mapping = [
|
||||
'json' => 'Aws\Api\Serializer\JsonRpcSerializer',
|
||||
'query' => 'Aws\Api\Serializer\QuerySerializer',
|
||||
'rest-json' => 'Aws\Api\Serializer\RestJsonSerializer',
|
||||
'rest-xml' => 'Aws\Api\Serializer\RestXmlSerializer'
|
||||
];
|
||||
|
||||
$proto = $api->getProtocol();
|
||||
|
||||
if (isset($mapping[$proto])) {
|
||||
return new $mapping[$proto]($api, $endpoint);
|
||||
} elseif ($proto == 'ec2') {
|
||||
return new QuerySerializer($api, $endpoint, new Ec2ParamBuilder());
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException(
|
||||
'Unknown protocol: ' . $api->getProtocol()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an error parser for the given protocol.
|
||||
*
|
||||
* @param string $protocol Protocol to parse (e.g., query, json, etc.)
|
||||
*
|
||||
* @return callable
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
public static function createErrorParser($protocol)
|
||||
{
|
||||
static $mapping = [
|
||||
'json' => 'Aws\Api\ErrorParser\JsonRpcErrorParser',
|
||||
'query' => 'Aws\Api\ErrorParser\XmlErrorParser',
|
||||
'rest-json' => 'Aws\Api\ErrorParser\RestJsonErrorParser',
|
||||
'rest-xml' => 'Aws\Api\ErrorParser\XmlErrorParser',
|
||||
'ec2' => 'Aws\Api\ErrorParser\XmlErrorParser'
|
||||
];
|
||||
|
||||
if (isset($mapping[$protocol])) {
|
||||
return new $mapping[$protocol]();
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException("Unknown protocol: $protocol");
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the listeners needed to parse client models.
|
||||
*
|
||||
* @param Service $api API to create a parser for
|
||||
* @return callable
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
public static function createParser(Service $api)
|
||||
{
|
||||
static $mapping = [
|
||||
'json' => 'Aws\Api\Parser\JsonRpcParser',
|
||||
'query' => 'Aws\Api\Parser\QueryParser',
|
||||
'rest-json' => 'Aws\Api\Parser\RestJsonParser',
|
||||
'rest-xml' => 'Aws\Api\Parser\RestXmlParser'
|
||||
];
|
||||
|
||||
$proto = $api->getProtocol();
|
||||
if (isset($mapping[$proto])) {
|
||||
return new $mapping[$proto]($api);
|
||||
} elseif ($proto == 'ec2') {
|
||||
return new QueryParser($api, null, false);
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException(
|
||||
'Unknown protocol: ' . $api->getProtocol()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the full name of the service
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getServiceFullName()
|
||||
{
|
||||
return $this->definition['metadata']['serviceFullName'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the API version of the service
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getApiVersion()
|
||||
{
|
||||
return $this->definition['metadata']['apiVersion'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the API version of the service
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEndpointPrefix()
|
||||
{
|
||||
return $this->definition['metadata']['endpointPrefix'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the signing name used by the service.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSigningName()
|
||||
{
|
||||
return $this->definition['metadata']['signingName']
|
||||
?: $this->definition['metadata']['endpointPrefix'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the service name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getServiceName()
|
||||
{
|
||||
return $this->definition['metadata']['serviceIdentifier'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default signature version of the service.
|
||||
*
|
||||
* Note: this method assumes "v4" when not specified in the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSignatureVersion()
|
||||
{
|
||||
return $this->definition['metadata']['signatureVersion'] ?: 'v4';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the protocol used by the service.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtocol()
|
||||
{
|
||||
return $this->definition['metadata']['protocol'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the uid string used by the service
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUid()
|
||||
{
|
||||
return $this->definition['metadata']['uid'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the description has a specific operation by name.
|
||||
*
|
||||
* @param string $name Operation to check by name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasOperation($name)
|
||||
{
|
||||
return isset($this['operations'][$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an operation by name.
|
||||
*
|
||||
* @param string $name Operation to retrieve by name
|
||||
*
|
||||
* @return Operation
|
||||
* @throws \InvalidArgumentException If the operation is not found
|
||||
*/
|
||||
public function getOperation($name)
|
||||
{
|
||||
if (!isset($this->operations[$name])) {
|
||||
if (!isset($this->definition['operations'][$name])) {
|
||||
throw new \InvalidArgumentException("Unknown operation: $name");
|
||||
}
|
||||
$this->operations[$name] = new Operation(
|
||||
$this->definition['operations'][$name],
|
||||
$this->shapeMap
|
||||
);
|
||||
}
|
||||
|
||||
return $this->operations[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the operations of the description.
|
||||
*
|
||||
* @return Operation[]
|
||||
*/
|
||||
public function getOperations()
|
||||
{
|
||||
$result = [];
|
||||
foreach ($this->definition['operations'] as $name => $definition) {
|
||||
$result[$name] = $this->getOperation($name);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the service metadata or a specific metadata key value.
|
||||
*
|
||||
* @param string|null $key Key to retrieve or null to retrieve all metadata
|
||||
*
|
||||
* @return mixed Returns the result or null if the key is not found
|
||||
*/
|
||||
public function getMetadata($key = null)
|
||||
{
|
||||
if (!$key) {
|
||||
return $this['metadata'];
|
||||
} elseif (isset($this->definition['metadata'][$key])) {
|
||||
return $this->definition['metadata'][$key];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an associative array of available paginator configurations where
|
||||
* the key is the name of the paginator, and the value is the paginator
|
||||
* configuration.
|
||||
*
|
||||
* @return array
|
||||
* @unstable The configuration format of paginators may change in the future
|
||||
*/
|
||||
public function getPaginators()
|
||||
{
|
||||
if (!isset($this->paginators)) {
|
||||
$res = call_user_func(
|
||||
$this->apiProvider,
|
||||
'paginator',
|
||||
$this->serviceName,
|
||||
$this->apiVersion
|
||||
);
|
||||
$this->paginators = isset($res['pagination'])
|
||||
? $res['pagination']
|
||||
: [];
|
||||
}
|
||||
|
||||
return $this->paginators;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the service has a paginator by name.
|
||||
*
|
||||
* @param string $name Name of the paginator.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasPaginator($name)
|
||||
{
|
||||
return isset($this->getPaginators()[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a paginator by name.
|
||||
*
|
||||
* @param string $name Paginator to retrieve by name. This argument is
|
||||
* typically the operation name.
|
||||
* @return array
|
||||
* @throws \UnexpectedValueException if the paginator does not exist.
|
||||
* @unstable The configuration format of paginators may change in the future
|
||||
*/
|
||||
public function getPaginatorConfig($name)
|
||||
{
|
||||
static $defaults = [
|
||||
'input_token' => null,
|
||||
'output_token' => null,
|
||||
'limit_key' => null,
|
||||
'result_key' => null,
|
||||
'more_results' => null,
|
||||
];
|
||||
|
||||
if ($this->hasPaginator($name)) {
|
||||
return $this->paginators[$name] + $defaults;
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException("There is no {$name} "
|
||||
. "paginator defined for the {$this->serviceName} service.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an associative array of available waiter configurations where the
|
||||
* key is the name of the waiter, and the value is the waiter
|
||||
* configuration.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getWaiters()
|
||||
{
|
||||
if (!isset($this->waiters)) {
|
||||
$res = call_user_func(
|
||||
$this->apiProvider,
|
||||
'waiter',
|
||||
$this->serviceName,
|
||||
$this->apiVersion
|
||||
);
|
||||
$this->waiters = isset($res['waiters'])
|
||||
? $res['waiters']
|
||||
: [];
|
||||
}
|
||||
|
||||
return $this->waiters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the service has a waiter by name.
|
||||
*
|
||||
* @param string $name Name of the waiter.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasWaiter($name)
|
||||
{
|
||||
return isset($this->getWaiters()[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a waiter configuration by name.
|
||||
*
|
||||
* @param string $name Name of the waiter by name.
|
||||
*
|
||||
* @return array
|
||||
* @throws \UnexpectedValueException if the waiter does not exist.
|
||||
*/
|
||||
public function getWaiterConfig($name)
|
||||
{
|
||||
// Error if the waiter is not defined
|
||||
if ($this->hasWaiter($name)) {
|
||||
return $this->waiters[$name];
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException("There is no {$name} waiter "
|
||||
. "defined for the {$this->serviceName} service.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the shape map used by the API.
|
||||
*
|
||||
* @return ShapeMap
|
||||
*/
|
||||
public function getShapeMap()
|
||||
{
|
||||
return $this->shapeMap;
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* Base class representing a modeled shape.
|
||||
*/
|
||||
class Shape extends AbstractModel
|
||||
{
|
||||
/**
|
||||
* Get a concrete shape for the given definition.
|
||||
*
|
||||
* @param array $definition
|
||||
* @param ShapeMap $shapeMap
|
||||
*
|
||||
* @return mixed
|
||||
* @throws \RuntimeException if the type is invalid
|
||||
*/
|
||||
public static function create(array $definition, ShapeMap $shapeMap)
|
||||
{
|
||||
static $map = [
|
||||
'structure' => 'Aws\Api\StructureShape',
|
||||
'map' => 'Aws\Api\MapShape',
|
||||
'list' => 'Aws\Api\ListShape',
|
||||
'timestamp' => 'Aws\Api\TimestampShape',
|
||||
'integer' => 'Aws\Api\Shape',
|
||||
'double' => 'Aws\Api\Shape',
|
||||
'float' => 'Aws\Api\Shape',
|
||||
'long' => 'Aws\Api\Shape',
|
||||
'string' => 'Aws\Api\Shape',
|
||||
'byte' => 'Aws\Api\Shape',
|
||||
'character' => 'Aws\Api\Shape',
|
||||
'blob' => 'Aws\Api\Shape',
|
||||
'boolean' => 'Aws\Api\Shape'
|
||||
];
|
||||
|
||||
if (isset($definition['shape'])) {
|
||||
return $shapeMap->resolve($definition);
|
||||
}
|
||||
|
||||
if (!isset($map[$definition['type']])) {
|
||||
throw new \RuntimeException('Invalid type: '
|
||||
. print_r($definition, true));
|
||||
}
|
||||
|
||||
$type = $map[$definition['type']];
|
||||
|
||||
return new $type($definition, $shapeMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type of the shape
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->definition['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the shape
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->definition['name'];
|
||||
}
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* Builds shape based on shape references.
|
||||
*/
|
||||
class ShapeMap
|
||||
{
|
||||
/** @var array */
|
||||
private $definitions;
|
||||
|
||||
/** @var Shape[] */
|
||||
private $simple;
|
||||
|
||||
/**
|
||||
* @param array $shapeModels Associative array of shape definitions.
|
||||
*/
|
||||
public function __construct(array $shapeModels)
|
||||
{
|
||||
$this->definitions = $shapeModels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of shape names.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getShapeNames()
|
||||
{
|
||||
return array_keys($this->definitions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a shape reference
|
||||
*
|
||||
* @param array $shapeRef Shape reference shape
|
||||
*
|
||||
* @return Shape
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function resolve(array $shapeRef)
|
||||
{
|
||||
$shape = $shapeRef['shape'];
|
||||
|
||||
if (!isset($this->definitions[$shape])) {
|
||||
throw new \InvalidArgumentException('Shape not found: ' . $shape);
|
||||
}
|
||||
|
||||
$isSimple = count($shapeRef) == 1;
|
||||
if ($isSimple && isset($this->simple[$shape])) {
|
||||
return $this->simple[$shape];
|
||||
}
|
||||
|
||||
$definition = $shapeRef + $this->definitions[$shape];
|
||||
$definition['name'] = $definition['shape'];
|
||||
unset($definition['shape']);
|
||||
|
||||
$result = Shape::create($definition, $this);
|
||||
|
||||
if ($isSimple) {
|
||||
$this->simple[$shape] = $result;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* Represents a structure shape and resolve member shape references.
|
||||
*/
|
||||
class StructureShape extends Shape
|
||||
{
|
||||
/**
|
||||
* @var Shape[]
|
||||
*/
|
||||
private $members;
|
||||
|
||||
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||
{
|
||||
$definition['type'] = 'structure';
|
||||
|
||||
if (!isset($definition['members'])) {
|
||||
$definition['members'] = [];
|
||||
}
|
||||
|
||||
parent::__construct($definition, $shapeMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of all members
|
||||
*
|
||||
* @return Shape[]
|
||||
*/
|
||||
public function getMembers()
|
||||
{
|
||||
if (empty($this->members)) {
|
||||
$this->generateMembersHash();
|
||||
}
|
||||
|
||||
return $this->members;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a specific member exists by name.
|
||||
*
|
||||
* @param string $name Name of the member to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasMember($name)
|
||||
{
|
||||
return isset($this->definition['members'][$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a member by name.
|
||||
*
|
||||
* @param string $name Name of the member to retrieve
|
||||
*
|
||||
* @return Shape
|
||||
* @throws \InvalidArgumentException if the member is not found.
|
||||
*/
|
||||
public function getMember($name)
|
||||
{
|
||||
$members = $this->getMembers();
|
||||
|
||||
if (!isset($members[$name])) {
|
||||
throw new \InvalidArgumentException('Unknown member ' . $name);
|
||||
}
|
||||
|
||||
return $members[$name];
|
||||
}
|
||||
|
||||
|
||||
private function generateMembersHash()
|
||||
{
|
||||
$this->members = [];
|
||||
|
||||
foreach ($this->definition['members'] as $name => $definition) {
|
||||
$this->members[$name] = $this->shapeFor($definition);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
/**
|
||||
* Represents a timestamp shape.
|
||||
*/
|
||||
class TimestampShape extends Shape
|
||||
{
|
||||
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||
{
|
||||
$definition['type'] = 'timestamp';
|
||||
parent::__construct($definition, $shapeMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a timestamp value for a service.
|
||||
*
|
||||
* @param mixed $value Value to format
|
||||
* @param string $format Format used to serialize the value
|
||||
*
|
||||
* @return int|string
|
||||
* @throws \UnexpectedValueException if the format is unknown.
|
||||
* @throws \InvalidArgumentException if the value is an unsupported type.
|
||||
*/
|
||||
public static function format($value, $format)
|
||||
{
|
||||
if ($value instanceof \DateTime) {
|
||||
$value = $value->getTimestamp();
|
||||
} elseif (is_string($value)) {
|
||||
$value = strtotime($value);
|
||||
} elseif (!is_int($value)) {
|
||||
throw new \InvalidArgumentException('Unable to handle the provided'
|
||||
. ' timestamp type: ' . gettype($value));
|
||||
}
|
||||
|
||||
switch ($format) {
|
||||
case 'iso8601':
|
||||
return gmdate('Y-m-d\TH:i:s\Z', $value);
|
||||
case 'rfc822':
|
||||
return gmdate('D, d M Y H:i:s \G\M\T', $value);
|
||||
case 'unixTimestamp':
|
||||
return $value;
|
||||
default:
|
||||
throw new \UnexpectedValueException('Unknown timestamp format: '
|
||||
. $format);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,273 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Api;
|
||||
|
||||
use Aws;
|
||||
|
||||
/**
|
||||
* Validates a schema against a hash of input.
|
||||
*/
|
||||
class Validator
|
||||
{
|
||||
private $path = [];
|
||||
private $errors = [];
|
||||
private $constraints = [];
|
||||
|
||||
private static $defaultConstraints = [
|
||||
'required' => true,
|
||||
'min' => true,
|
||||
'max' => false,
|
||||
'pattern' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* @param array $constraints Associative array of constraints to enforce.
|
||||
* Accepts the following keys: "required", "min",
|
||||
* "max", and "pattern". If a key is not
|
||||
* provided, the constraint will assume false.
|
||||
*/
|
||||
public function __construct(array $constraints = null)
|
||||
{
|
||||
static $assumedFalseValues = [
|
||||
'required' => false,
|
||||
'min' => false,
|
||||
'max' => false,
|
||||
'pattern' => false
|
||||
];
|
||||
$this->constraints = empty($constraints)
|
||||
? self::$defaultConstraints
|
||||
: $constraints + $assumedFalseValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the given input against the schema.
|
||||
*
|
||||
* @param string $name Operation name
|
||||
* @param Shape $shape Shape to validate
|
||||
* @param array $input Input to validate
|
||||
*
|
||||
* @throws \InvalidArgumentException if the input is invalid.
|
||||
*/
|
||||
public function validate($name, Shape $shape, array $input)
|
||||
{
|
||||
$this->dispatch($shape, $input);
|
||||
|
||||
if ($this->errors) {
|
||||
$message = sprintf(
|
||||
"Found %d error%s while validating the input provided for the "
|
||||
. "%s operation:\n%s",
|
||||
count($this->errors),
|
||||
count($this->errors) > 1 ? 's' : '',
|
||||
$name,
|
||||
implode("\n", $this->errors)
|
||||
);
|
||||
$this->errors = [];
|
||||
|
||||
throw new \InvalidArgumentException($message);
|
||||
}
|
||||
}
|
||||
|
||||
private function dispatch(Shape $shape, $value)
|
||||
{
|
||||
static $methods = [
|
||||
'structure' => 'check_structure',
|
||||
'list' => 'check_list',
|
||||
'map' => 'check_map',
|
||||
'blob' => 'check_blob',
|
||||
'boolean' => 'check_boolean',
|
||||
'integer' => 'check_numeric',
|
||||
'float' => 'check_numeric',
|
||||
'long' => 'check_numeric',
|
||||
'string' => 'check_string',
|
||||
'byte' => 'check_string',
|
||||
'char' => 'check_string'
|
||||
];
|
||||
|
||||
$type = $shape->getType();
|
||||
if (isset($methods[$type])) {
|
||||
$this->{$methods[$type]}($shape, $value);
|
||||
}
|
||||
}
|
||||
|
||||
private function check_structure(StructureShape $shape, $value)
|
||||
{
|
||||
if (!$this->checkAssociativeArray($value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->constraints['required'] && $shape['required']) {
|
||||
foreach ($shape['required'] as $req) {
|
||||
if (!isset($value[$req])) {
|
||||
$this->path[] = $req;
|
||||
$this->addError('is missing and is a required parameter');
|
||||
array_pop($this->path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($value as $name => $v) {
|
||||
if ($shape->hasMember($name)) {
|
||||
$this->path[] = $name;
|
||||
$this->dispatch(
|
||||
$shape->getMember($name),
|
||||
isset($value[$name]) ? $value[$name] : null
|
||||
);
|
||||
array_pop($this->path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function check_list(ListShape $shape, $value)
|
||||
{
|
||||
if (!is_array($value)) {
|
||||
$this->addError('must be an array. Found '
|
||||
. Aws\describe_type($value));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->validateRange($shape, count($value), "list element count");
|
||||
|
||||
$items = $shape->getMember();
|
||||
foreach ($value as $index => $v) {
|
||||
$this->path[] = $index;
|
||||
$this->dispatch($items, $v);
|
||||
array_pop($this->path);
|
||||
}
|
||||
}
|
||||
|
||||
private function check_map(MapShape $shape, $value)
|
||||
{
|
||||
if (!$this->checkAssociativeArray($value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$values = $shape->getValue();
|
||||
foreach ($value as $key => $v) {
|
||||
$this->path[] = $key;
|
||||
$this->dispatch($values, $v);
|
||||
array_pop($this->path);
|
||||
}
|
||||
}
|
||||
|
||||
private function check_blob(Shape $shape, $value)
|
||||
{
|
||||
static $valid = [
|
||||
'string' => true,
|
||||
'integer' => true,
|
||||
'double' => true,
|
||||
'resource' => true
|
||||
];
|
||||
|
||||
$type = gettype($value);
|
||||
if (!isset($valid[$type])) {
|
||||
if ($type != 'object' || !method_exists($value, '__toString')) {
|
||||
$this->addError('must be an fopen resource, a '
|
||||
. 'GuzzleHttp\Stream\StreamInterface object, or something '
|
||||
. 'that can be cast to a string. Found '
|
||||
. Aws\describe_type($value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function check_numeric(Shape $shape, $value)
|
||||
{
|
||||
if (!is_numeric($value)) {
|
||||
$this->addError('must be numeric. Found '
|
||||
. Aws\describe_type($value));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->validateRange($shape, $value, "numeric value");
|
||||
}
|
||||
|
||||
private function check_boolean(Shape $shape, $value)
|
||||
{
|
||||
if (!is_bool($value)) {
|
||||
$this->addError('must be a boolean. Found '
|
||||
. Aws\describe_type($value));
|
||||
}
|
||||
}
|
||||
|
||||
private function check_string(Shape $shape, $value)
|
||||
{
|
||||
if ($shape['jsonvalue']) {
|
||||
if (!self::canJsonEncode($value)) {
|
||||
$this->addError('must be a value encodable with \'json_encode\'.'
|
||||
. ' Found ' . Aws\describe_type($value));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$this->checkCanString($value)) {
|
||||
$this->addError('must be a string or an object that implements '
|
||||
. '__toString(). Found ' . Aws\describe_type($value));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->validateRange($shape, strlen($value), "string length");
|
||||
|
||||
if ($this->constraints['pattern']) {
|
||||
$pattern = $shape['pattern'];
|
||||
if ($pattern && !preg_match("/$pattern/", $value)) {
|
||||
$this->addError("Pattern /$pattern/ failed to match '$value'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function validateRange(Shape $shape, $length, $descriptor)
|
||||
{
|
||||
if ($this->constraints['min']) {
|
||||
$min = $shape['min'];
|
||||
if ($min && $length < $min) {
|
||||
$this->addError("expected $descriptor to be >= $min, but "
|
||||
. "found $descriptor of $length");
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->constraints['max']) {
|
||||
$max = $shape['max'];
|
||||
if ($max && $length > $max) {
|
||||
$this->addError("expected $descriptor to be <= $max, but "
|
||||
. "found $descriptor of $length");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function checkCanString($value)
|
||||
{
|
||||
static $valid = [
|
||||
'string' => true,
|
||||
'integer' => true,
|
||||
'double' => true,
|
||||
'NULL' => true,
|
||||
];
|
||||
|
||||
$type = gettype($value);
|
||||
|
||||
return isset($valid[$type]) ||
|
||||
($type == 'object' && method_exists($value, '__toString'));
|
||||
}
|
||||
|
||||
private function checkAssociativeArray($value)
|
||||
{
|
||||
if (!is_array($value) || isset($value[0])) {
|
||||
$this->addError('must be an associative array. Found '
|
||||
. Aws\describe_type($value));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function addError($message)
|
||||
{
|
||||
$this->errors[] =
|
||||
implode('', array_map(function ($s) { return "[{$s}]"; }, $this->path))
|
||||
. ' '
|
||||
. $message;
|
||||
}
|
||||
|
||||
private function canJsonEncode($data)
|
||||
{
|
||||
return !is_resource($data);
|
||||
}
|
||||
}
|
|
@ -1,266 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\ApiGateway;
|
||||
|
||||
use Aws\AwsClient;
|
||||
use Aws\CommandInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **AWS API Gateway** service.
|
||||
*
|
||||
* @method \Aws\Result createApiKey(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createApiKeyAsync(array $args = [])
|
||||
* @method \Aws\Result createAuthorizer(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createAuthorizerAsync(array $args = [])
|
||||
* @method \Aws\Result createBasePathMapping(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createBasePathMappingAsync(array $args = [])
|
||||
* @method \Aws\Result createDeployment(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createDeploymentAsync(array $args = [])
|
||||
* @method \Aws\Result createDocumentationPart(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createDocumentationPartAsync(array $args = [])
|
||||
* @method \Aws\Result createDocumentationVersion(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createDocumentationVersionAsync(array $args = [])
|
||||
* @method \Aws\Result createDomainName(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createDomainNameAsync(array $args = [])
|
||||
* @method \Aws\Result createModel(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createModelAsync(array $args = [])
|
||||
* @method \Aws\Result createRequestValidator(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createRequestValidatorAsync(array $args = [])
|
||||
* @method \Aws\Result createResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createResourceAsync(array $args = [])
|
||||
* @method \Aws\Result createRestApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createRestApiAsync(array $args = [])
|
||||
* @method \Aws\Result createStage(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createStageAsync(array $args = [])
|
||||
* @method \Aws\Result createUsagePlan(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createUsagePlanAsync(array $args = [])
|
||||
* @method \Aws\Result createUsagePlanKey(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createUsagePlanKeyAsync(array $args = [])
|
||||
* @method \Aws\Result createVpcLink(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createVpcLinkAsync(array $args = [])
|
||||
* @method \Aws\Result deleteApiKey(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteApiKeyAsync(array $args = [])
|
||||
* @method \Aws\Result deleteAuthorizer(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteAuthorizerAsync(array $args = [])
|
||||
* @method \Aws\Result deleteBasePathMapping(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteBasePathMappingAsync(array $args = [])
|
||||
* @method \Aws\Result deleteClientCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteClientCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result deleteDeployment(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteDeploymentAsync(array $args = [])
|
||||
* @method \Aws\Result deleteDocumentationPart(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteDocumentationPartAsync(array $args = [])
|
||||
* @method \Aws\Result deleteDocumentationVersion(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteDocumentationVersionAsync(array $args = [])
|
||||
* @method \Aws\Result deleteDomainName(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteDomainNameAsync(array $args = [])
|
||||
* @method \Aws\Result deleteGatewayResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteGatewayResponseAsync(array $args = [])
|
||||
* @method \Aws\Result deleteIntegration(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteIntegrationAsync(array $args = [])
|
||||
* @method \Aws\Result deleteIntegrationResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteIntegrationResponseAsync(array $args = [])
|
||||
* @method \Aws\Result deleteMethod(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteMethodAsync(array $args = [])
|
||||
* @method \Aws\Result deleteMethodResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteMethodResponseAsync(array $args = [])
|
||||
* @method \Aws\Result deleteModel(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteModelAsync(array $args = [])
|
||||
* @method \Aws\Result deleteRequestValidator(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteRequestValidatorAsync(array $args = [])
|
||||
* @method \Aws\Result deleteResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteResourceAsync(array $args = [])
|
||||
* @method \Aws\Result deleteRestApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteRestApiAsync(array $args = [])
|
||||
* @method \Aws\Result deleteStage(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteStageAsync(array $args = [])
|
||||
* @method \Aws\Result deleteUsagePlan(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteUsagePlanAsync(array $args = [])
|
||||
* @method \Aws\Result deleteUsagePlanKey(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteUsagePlanKeyAsync(array $args = [])
|
||||
* @method \Aws\Result deleteVpcLink(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteVpcLinkAsync(array $args = [])
|
||||
* @method \Aws\Result flushStageAuthorizersCache(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise flushStageAuthorizersCacheAsync(array $args = [])
|
||||
* @method \Aws\Result flushStageCache(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise flushStageCacheAsync(array $args = [])
|
||||
* @method \Aws\Result generateClientCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise generateClientCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result getAccount(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getAccountAsync(array $args = [])
|
||||
* @method \Aws\Result getApiKey(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getApiKeyAsync(array $args = [])
|
||||
* @method \Aws\Result getApiKeys(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getApiKeysAsync(array $args = [])
|
||||
* @method \Aws\Result getAuthorizer(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getAuthorizerAsync(array $args = [])
|
||||
* @method \Aws\Result getAuthorizers(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getAuthorizersAsync(array $args = [])
|
||||
* @method \Aws\Result getBasePathMapping(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getBasePathMappingAsync(array $args = [])
|
||||
* @method \Aws\Result getBasePathMappings(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getBasePathMappingsAsync(array $args = [])
|
||||
* @method \Aws\Result getClientCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getClientCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result getClientCertificates(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getClientCertificatesAsync(array $args = [])
|
||||
* @method \Aws\Result getDeployment(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDeploymentAsync(array $args = [])
|
||||
* @method \Aws\Result getDeployments(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDeploymentsAsync(array $args = [])
|
||||
* @method \Aws\Result getDocumentationPart(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDocumentationPartAsync(array $args = [])
|
||||
* @method \Aws\Result getDocumentationParts(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDocumentationPartsAsync(array $args = [])
|
||||
* @method \Aws\Result getDocumentationVersion(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDocumentationVersionAsync(array $args = [])
|
||||
* @method \Aws\Result getDocumentationVersions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDocumentationVersionsAsync(array $args = [])
|
||||
* @method \Aws\Result getDomainName(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDomainNameAsync(array $args = [])
|
||||
* @method \Aws\Result getDomainNames(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDomainNamesAsync(array $args = [])
|
||||
* @method \Aws\Result getExport(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getExportAsync(array $args = [])
|
||||
* @method \Aws\Result getGatewayResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getGatewayResponseAsync(array $args = [])
|
||||
* @method \Aws\Result getGatewayResponses(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getGatewayResponsesAsync(array $args = [])
|
||||
* @method \Aws\Result getIntegration(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getIntegrationAsync(array $args = [])
|
||||
* @method \Aws\Result getIntegrationResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getIntegrationResponseAsync(array $args = [])
|
||||
* @method \Aws\Result getMethod(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getMethodAsync(array $args = [])
|
||||
* @method \Aws\Result getMethodResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getMethodResponseAsync(array $args = [])
|
||||
* @method \Aws\Result getModel(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getModelAsync(array $args = [])
|
||||
* @method \Aws\Result getModelTemplate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getModelTemplateAsync(array $args = [])
|
||||
* @method \Aws\Result getModels(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getModelsAsync(array $args = [])
|
||||
* @method \Aws\Result getRequestValidator(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getRequestValidatorAsync(array $args = [])
|
||||
* @method \Aws\Result getRequestValidators(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getRequestValidatorsAsync(array $args = [])
|
||||
* @method \Aws\Result getResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getResourceAsync(array $args = [])
|
||||
* @method \Aws\Result getResources(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getResourcesAsync(array $args = [])
|
||||
* @method \Aws\Result getRestApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getRestApiAsync(array $args = [])
|
||||
* @method \Aws\Result getRestApis(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getRestApisAsync(array $args = [])
|
||||
* @method \Aws\Result getSdk(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getSdkAsync(array $args = [])
|
||||
* @method \Aws\Result getSdkType(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getSdkTypeAsync(array $args = [])
|
||||
* @method \Aws\Result getSdkTypes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getSdkTypesAsync(array $args = [])
|
||||
* @method \Aws\Result getStage(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getStageAsync(array $args = [])
|
||||
* @method \Aws\Result getStages(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getStagesAsync(array $args = [])
|
||||
* @method \Aws\Result getUsage(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getUsageAsync(array $args = [])
|
||||
* @method \Aws\Result getUsagePlan(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getUsagePlanAsync(array $args = [])
|
||||
* @method \Aws\Result getUsagePlanKey(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getUsagePlanKeyAsync(array $args = [])
|
||||
* @method \Aws\Result getUsagePlanKeys(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getUsagePlanKeysAsync(array $args = [])
|
||||
* @method \Aws\Result getUsagePlans(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getUsagePlansAsync(array $args = [])
|
||||
* @method \Aws\Result getVpcLink(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getVpcLinkAsync(array $args = [])
|
||||
* @method \Aws\Result getVpcLinks(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getVpcLinksAsync(array $args = [])
|
||||
* @method \Aws\Result importApiKeys(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise importApiKeysAsync(array $args = [])
|
||||
* @method \Aws\Result importDocumentationParts(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise importDocumentationPartsAsync(array $args = [])
|
||||
* @method \Aws\Result importRestApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise importRestApiAsync(array $args = [])
|
||||
* @method \Aws\Result putGatewayResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putGatewayResponseAsync(array $args = [])
|
||||
* @method \Aws\Result putIntegration(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putIntegrationAsync(array $args = [])
|
||||
* @method \Aws\Result putIntegrationResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putIntegrationResponseAsync(array $args = [])
|
||||
* @method \Aws\Result putMethod(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putMethodAsync(array $args = [])
|
||||
* @method \Aws\Result putMethodResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putMethodResponseAsync(array $args = [])
|
||||
* @method \Aws\Result putRestApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putRestApiAsync(array $args = [])
|
||||
* @method \Aws\Result testInvokeAuthorizer(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise testInvokeAuthorizerAsync(array $args = [])
|
||||
* @method \Aws\Result testInvokeMethod(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise testInvokeMethodAsync(array $args = [])
|
||||
* @method \Aws\Result updateAccount(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateAccountAsync(array $args = [])
|
||||
* @method \Aws\Result updateApiKey(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateApiKeyAsync(array $args = [])
|
||||
* @method \Aws\Result updateAuthorizer(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateAuthorizerAsync(array $args = [])
|
||||
* @method \Aws\Result updateBasePathMapping(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateBasePathMappingAsync(array $args = [])
|
||||
* @method \Aws\Result updateClientCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateClientCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result updateDeployment(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateDeploymentAsync(array $args = [])
|
||||
* @method \Aws\Result updateDocumentationPart(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateDocumentationPartAsync(array $args = [])
|
||||
* @method \Aws\Result updateDocumentationVersion(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateDocumentationVersionAsync(array $args = [])
|
||||
* @method \Aws\Result updateDomainName(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateDomainNameAsync(array $args = [])
|
||||
* @method \Aws\Result updateGatewayResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateGatewayResponseAsync(array $args = [])
|
||||
* @method \Aws\Result updateIntegration(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateIntegrationAsync(array $args = [])
|
||||
* @method \Aws\Result updateIntegrationResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateIntegrationResponseAsync(array $args = [])
|
||||
* @method \Aws\Result updateMethod(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateMethodAsync(array $args = [])
|
||||
* @method \Aws\Result updateMethodResponse(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateMethodResponseAsync(array $args = [])
|
||||
* @method \Aws\Result updateModel(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateModelAsync(array $args = [])
|
||||
* @method \Aws\Result updateRequestValidator(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateRequestValidatorAsync(array $args = [])
|
||||
* @method \Aws\Result updateResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateResourceAsync(array $args = [])
|
||||
* @method \Aws\Result updateRestApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateRestApiAsync(array $args = [])
|
||||
* @method \Aws\Result updateStage(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateStageAsync(array $args = [])
|
||||
* @method \Aws\Result updateUsage(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateUsageAsync(array $args = [])
|
||||
* @method \Aws\Result updateUsagePlan(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateUsagePlanAsync(array $args = [])
|
||||
* @method \Aws\Result updateVpcLink(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateVpcLinkAsync(array $args = [])
|
||||
*/
|
||||
class ApiGatewayClient extends AwsClient
|
||||
{
|
||||
public function __construct(array $args)
|
||||
{
|
||||
parent::__construct($args);
|
||||
$stack = $this->getHandlerList();
|
||||
$stack->appendBuild([__CLASS__, '_add_accept_header']);
|
||||
}
|
||||
|
||||
public static function _add_accept_header(callable $handler)
|
||||
{
|
||||
return function (
|
||||
CommandInterface $command,
|
||||
RequestInterface $request
|
||||
) use ($handler) {
|
||||
$request = $request->withHeader('Accept', 'application/json');
|
||||
|
||||
return $handler($command, $request);
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\ApiGateway\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **AWS API Gateway** service.
|
||||
*/
|
||||
class ApiGatewayException extends AwsException {}
|
|
@ -1,61 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\AppSync;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **AWS AppSync** service.
|
||||
* @method \Aws\Result createApiKey(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createApiKeyAsync(array $args = [])
|
||||
* @method \Aws\Result createDataSource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createDataSourceAsync(array $args = [])
|
||||
* @method \Aws\Result createGraphqlApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createGraphqlApiAsync(array $args = [])
|
||||
* @method \Aws\Result createResolver(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createResolverAsync(array $args = [])
|
||||
* @method \Aws\Result createType(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createTypeAsync(array $args = [])
|
||||
* @method \Aws\Result deleteApiKey(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteApiKeyAsync(array $args = [])
|
||||
* @method \Aws\Result deleteDataSource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteDataSourceAsync(array $args = [])
|
||||
* @method \Aws\Result deleteGraphqlApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteGraphqlApiAsync(array $args = [])
|
||||
* @method \Aws\Result deleteResolver(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteResolverAsync(array $args = [])
|
||||
* @method \Aws\Result deleteType(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteTypeAsync(array $args = [])
|
||||
* @method \Aws\Result getDataSource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDataSourceAsync(array $args = [])
|
||||
* @method \Aws\Result getGraphqlApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getGraphqlApiAsync(array $args = [])
|
||||
* @method \Aws\Result getIntrospectionSchema(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getIntrospectionSchemaAsync(array $args = [])
|
||||
* @method \Aws\Result getResolver(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getResolverAsync(array $args = [])
|
||||
* @method \Aws\Result getSchemaCreationStatus(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getSchemaCreationStatusAsync(array $args = [])
|
||||
* @method \Aws\Result getType(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getTypeAsync(array $args = [])
|
||||
* @method \Aws\Result listApiKeys(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listApiKeysAsync(array $args = [])
|
||||
* @method \Aws\Result listDataSources(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listDataSourcesAsync(array $args = [])
|
||||
* @method \Aws\Result listGraphqlApis(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listGraphqlApisAsync(array $args = [])
|
||||
* @method \Aws\Result listResolvers(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listResolversAsync(array $args = [])
|
||||
* @method \Aws\Result listTypes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listTypesAsync(array $args = [])
|
||||
* @method \Aws\Result startSchemaCreation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise startSchemaCreationAsync(array $args = [])
|
||||
* @method \Aws\Result updateDataSource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateDataSourceAsync(array $args = [])
|
||||
* @method \Aws\Result updateGraphqlApi(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateGraphqlApiAsync(array $args = [])
|
||||
* @method \Aws\Result updateResolver(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateResolverAsync(array $args = [])
|
||||
* @method \Aws\Result updateType(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateTypeAsync(array $args = [])
|
||||
*/
|
||||
class AppSyncClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\AppSync\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **AWS AppSync** service.
|
||||
*/
|
||||
class AppSyncException extends AwsException {}
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\ApplicationAutoScaling;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **Application Auto Scaling** service.
|
||||
* @method \Aws\Result deleteScalingPolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteScalingPolicyAsync(array $args = [])
|
||||
* @method \Aws\Result deleteScheduledAction(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteScheduledActionAsync(array $args = [])
|
||||
* @method \Aws\Result deregisterScalableTarget(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deregisterScalableTargetAsync(array $args = [])
|
||||
* @method \Aws\Result describeScalableTargets(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeScalableTargetsAsync(array $args = [])
|
||||
* @method \Aws\Result describeScalingActivities(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeScalingActivitiesAsync(array $args = [])
|
||||
* @method \Aws\Result describeScalingPolicies(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeScalingPoliciesAsync(array $args = [])
|
||||
* @method \Aws\Result describeScheduledActions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeScheduledActionsAsync(array $args = [])
|
||||
* @method \Aws\Result putScalingPolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putScalingPolicyAsync(array $args = [])
|
||||
* @method \Aws\Result putScheduledAction(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putScheduledActionAsync(array $args = [])
|
||||
* @method \Aws\Result registerScalableTarget(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise registerScalableTargetAsync(array $args = [])
|
||||
*/
|
||||
class ApplicationAutoScalingClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\ApplicationAutoScaling\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **Application Auto Scaling** service.
|
||||
*/
|
||||
class ApplicationAutoScalingException extends AwsException {}
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\ApplicationDiscoveryService;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **AWS Application Discovery Service** service.
|
||||
* @method \Aws\Result associateConfigurationItemsToApplication(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise associateConfigurationItemsToApplicationAsync(array $args = [])
|
||||
* @method \Aws\Result createApplication(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
|
||||
* @method \Aws\Result createTags(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createTagsAsync(array $args = [])
|
||||
* @method \Aws\Result deleteApplications(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteApplicationsAsync(array $args = [])
|
||||
* @method \Aws\Result deleteTags(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteTagsAsync(array $args = [])
|
||||
* @method \Aws\Result describeAgents(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeAgentsAsync(array $args = [])
|
||||
* @method \Aws\Result describeConfigurations(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeConfigurationsAsync(array $args = [])
|
||||
* @method \Aws\Result describeExportConfigurations(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeExportConfigurationsAsync(array $args = [])
|
||||
* @method \Aws\Result describeExportTasks(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeExportTasksAsync(array $args = [])
|
||||
* @method \Aws\Result describeTags(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeTagsAsync(array $args = [])
|
||||
* @method \Aws\Result disassociateConfigurationItemsFromApplication(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise disassociateConfigurationItemsFromApplicationAsync(array $args = [])
|
||||
* @method \Aws\Result exportConfigurations(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise exportConfigurationsAsync(array $args = [])
|
||||
* @method \Aws\Result getDiscoverySummary(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDiscoverySummaryAsync(array $args = [])
|
||||
* @method \Aws\Result listConfigurations(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listConfigurationsAsync(array $args = [])
|
||||
* @method \Aws\Result listServerNeighbors(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listServerNeighborsAsync(array $args = [])
|
||||
* @method \Aws\Result startDataCollectionByAgentIds(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise startDataCollectionByAgentIdsAsync(array $args = [])
|
||||
* @method \Aws\Result startExportTask(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise startExportTaskAsync(array $args = [])
|
||||
* @method \Aws\Result stopDataCollectionByAgentIds(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise stopDataCollectionByAgentIdsAsync(array $args = [])
|
||||
* @method \Aws\Result updateApplication(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateApplicationAsync(array $args = [])
|
||||
*/
|
||||
class ApplicationDiscoveryServiceClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\ApplicationDiscoveryService\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **AWS Application Discovery Service** service.
|
||||
*/
|
||||
class ApplicationDiscoveryServiceException extends AwsException {}
|
|
@ -1,67 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Appstream;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **Amazon AppStream** service.
|
||||
* @method \Aws\Result associateFleet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise associateFleetAsync(array $args = [])
|
||||
* @method \Aws\Result createDirectoryConfig(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createDirectoryConfigAsync(array $args = [])
|
||||
* @method \Aws\Result createFleet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createFleetAsync(array $args = [])
|
||||
* @method \Aws\Result createImageBuilder(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createImageBuilderAsync(array $args = [])
|
||||
* @method \Aws\Result createImageBuilderStreamingURL(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createImageBuilderStreamingURLAsync(array $args = [])
|
||||
* @method \Aws\Result createStack(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createStackAsync(array $args = [])
|
||||
* @method \Aws\Result createStreamingURL(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createStreamingURLAsync(array $args = [])
|
||||
* @method \Aws\Result deleteDirectoryConfig(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteDirectoryConfigAsync(array $args = [])
|
||||
* @method \Aws\Result deleteFleet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteFleetAsync(array $args = [])
|
||||
* @method \Aws\Result deleteImage(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteImageAsync(array $args = [])
|
||||
* @method \Aws\Result deleteImageBuilder(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteImageBuilderAsync(array $args = [])
|
||||
* @method \Aws\Result deleteStack(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteStackAsync(array $args = [])
|
||||
* @method \Aws\Result describeDirectoryConfigs(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeDirectoryConfigsAsync(array $args = [])
|
||||
* @method \Aws\Result describeFleets(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeFleetsAsync(array $args = [])
|
||||
* @method \Aws\Result describeImageBuilders(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeImageBuildersAsync(array $args = [])
|
||||
* @method \Aws\Result describeImages(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeImagesAsync(array $args = [])
|
||||
* @method \Aws\Result describeSessions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeSessionsAsync(array $args = [])
|
||||
* @method \Aws\Result describeStacks(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeStacksAsync(array $args = [])
|
||||
* @method \Aws\Result disassociateFleet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise disassociateFleetAsync(array $args = [])
|
||||
* @method \Aws\Result expireSession(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise expireSessionAsync(array $args = [])
|
||||
* @method \Aws\Result listAssociatedFleets(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listAssociatedFleetsAsync(array $args = [])
|
||||
* @method \Aws\Result listAssociatedStacks(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listAssociatedStacksAsync(array $args = [])
|
||||
* @method \Aws\Result startFleet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise startFleetAsync(array $args = [])
|
||||
* @method \Aws\Result startImageBuilder(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise startImageBuilderAsync(array $args = [])
|
||||
* @method \Aws\Result stopFleet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise stopFleetAsync(array $args = [])
|
||||
* @method \Aws\Result stopImageBuilder(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise stopImageBuilderAsync(array $args = [])
|
||||
* @method \Aws\Result updateDirectoryConfig(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateDirectoryConfigAsync(array $args = [])
|
||||
* @method \Aws\Result updateFleet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateFleetAsync(array $args = [])
|
||||
* @method \Aws\Result updateStack(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateStackAsync(array $args = [])
|
||||
*/
|
||||
class AppstreamClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Appstream\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **Amazon AppStream** service.
|
||||
*/
|
||||
class AppstreamException extends AwsException {}
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Athena;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **Amazon Athena** service.
|
||||
* @method \Aws\Result batchGetNamedQuery(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise batchGetNamedQueryAsync(array $args = [])
|
||||
* @method \Aws\Result batchGetQueryExecution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise batchGetQueryExecutionAsync(array $args = [])
|
||||
* @method \Aws\Result createNamedQuery(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createNamedQueryAsync(array $args = [])
|
||||
* @method \Aws\Result deleteNamedQuery(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteNamedQueryAsync(array $args = [])
|
||||
* @method \Aws\Result getNamedQuery(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getNamedQueryAsync(array $args = [])
|
||||
* @method \Aws\Result getQueryExecution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getQueryExecutionAsync(array $args = [])
|
||||
* @method \Aws\Result getQueryResults(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getQueryResultsAsync(array $args = [])
|
||||
* @method \Aws\Result listNamedQueries(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listNamedQueriesAsync(array $args = [])
|
||||
* @method \Aws\Result listQueryExecutions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listQueryExecutionsAsync(array $args = [])
|
||||
* @method \Aws\Result startQueryExecution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise startQueryExecutionAsync(array $args = [])
|
||||
* @method \Aws\Result stopQueryExecution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise stopQueryExecutionAsync(array $args = [])
|
||||
*/
|
||||
class AthenaClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Athena\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **Amazon Athena** service.
|
||||
*/
|
||||
class AthenaException extends AwsException {}
|
|
@ -1,114 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\AutoScaling;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* Auto Scaling client.
|
||||
*
|
||||
* @method \Aws\Result attachInstances(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise attachInstancesAsync(array $args = [])
|
||||
* @method \Aws\Result attachLoadBalancerTargetGroups(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise attachLoadBalancerTargetGroupsAsync(array $args = [])
|
||||
* @method \Aws\Result attachLoadBalancers(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise attachLoadBalancersAsync(array $args = [])
|
||||
* @method \Aws\Result completeLifecycleAction(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise completeLifecycleActionAsync(array $args = [])
|
||||
* @method \Aws\Result createAutoScalingGroup(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createAutoScalingGroupAsync(array $args = [])
|
||||
* @method \Aws\Result createLaunchConfiguration(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createLaunchConfigurationAsync(array $args = [])
|
||||
* @method \Aws\Result createOrUpdateTags(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createOrUpdateTagsAsync(array $args = [])
|
||||
* @method \Aws\Result deleteAutoScalingGroup(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteAutoScalingGroupAsync(array $args = [])
|
||||
* @method \Aws\Result deleteLaunchConfiguration(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteLaunchConfigurationAsync(array $args = [])
|
||||
* @method \Aws\Result deleteLifecycleHook(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteLifecycleHookAsync(array $args = [])
|
||||
* @method \Aws\Result deleteNotificationConfiguration(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteNotificationConfigurationAsync(array $args = [])
|
||||
* @method \Aws\Result deletePolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deletePolicyAsync(array $args = [])
|
||||
* @method \Aws\Result deleteScheduledAction(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteScheduledActionAsync(array $args = [])
|
||||
* @method \Aws\Result deleteTags(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteTagsAsync(array $args = [])
|
||||
* @method \Aws\Result describeAccountLimits(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeAccountLimitsAsync(array $args = [])
|
||||
* @method \Aws\Result describeAdjustmentTypes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeAdjustmentTypesAsync(array $args = [])
|
||||
* @method \Aws\Result describeAutoScalingGroups(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeAutoScalingGroupsAsync(array $args = [])
|
||||
* @method \Aws\Result describeAutoScalingInstances(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeAutoScalingInstancesAsync(array $args = [])
|
||||
* @method \Aws\Result describeAutoScalingNotificationTypes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeAutoScalingNotificationTypesAsync(array $args = [])
|
||||
* @method \Aws\Result describeLaunchConfigurations(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeLaunchConfigurationsAsync(array $args = [])
|
||||
* @method \Aws\Result describeLifecycleHookTypes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeLifecycleHookTypesAsync(array $args = [])
|
||||
* @method \Aws\Result describeLifecycleHooks(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeLifecycleHooksAsync(array $args = [])
|
||||
* @method \Aws\Result describeLoadBalancerTargetGroups(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeLoadBalancerTargetGroupsAsync(array $args = [])
|
||||
* @method \Aws\Result describeLoadBalancers(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeLoadBalancersAsync(array $args = [])
|
||||
* @method \Aws\Result describeMetricCollectionTypes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeMetricCollectionTypesAsync(array $args = [])
|
||||
* @method \Aws\Result describeNotificationConfigurations(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeNotificationConfigurationsAsync(array $args = [])
|
||||
* @method \Aws\Result describePolicies(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describePoliciesAsync(array $args = [])
|
||||
* @method \Aws\Result describeScalingActivities(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeScalingActivitiesAsync(array $args = [])
|
||||
* @method \Aws\Result describeScalingProcessTypes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeScalingProcessTypesAsync(array $args = [])
|
||||
* @method \Aws\Result describeScheduledActions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeScheduledActionsAsync(array $args = [])
|
||||
* @method \Aws\Result describeTags(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeTagsAsync(array $args = [])
|
||||
* @method \Aws\Result describeTerminationPolicyTypes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeTerminationPolicyTypesAsync(array $args = [])
|
||||
* @method \Aws\Result detachInstances(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise detachInstancesAsync(array $args = [])
|
||||
* @method \Aws\Result detachLoadBalancerTargetGroups(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise detachLoadBalancerTargetGroupsAsync(array $args = [])
|
||||
* @method \Aws\Result detachLoadBalancers(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise detachLoadBalancersAsync(array $args = [])
|
||||
* @method \Aws\Result disableMetricsCollection(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise disableMetricsCollectionAsync(array $args = [])
|
||||
* @method \Aws\Result enableMetricsCollection(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise enableMetricsCollectionAsync(array $args = [])
|
||||
* @method \Aws\Result enterStandby(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise enterStandbyAsync(array $args = [])
|
||||
* @method \Aws\Result executePolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise executePolicyAsync(array $args = [])
|
||||
* @method \Aws\Result exitStandby(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise exitStandbyAsync(array $args = [])
|
||||
* @method \Aws\Result putLifecycleHook(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putLifecycleHookAsync(array $args = [])
|
||||
* @method \Aws\Result putNotificationConfiguration(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putNotificationConfigurationAsync(array $args = [])
|
||||
* @method \Aws\Result putScalingPolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putScalingPolicyAsync(array $args = [])
|
||||
* @method \Aws\Result putScheduledUpdateGroupAction(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putScheduledUpdateGroupActionAsync(array $args = [])
|
||||
* @method \Aws\Result recordLifecycleActionHeartbeat(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise recordLifecycleActionHeartbeatAsync(array $args = [])
|
||||
* @method \Aws\Result resumeProcesses(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise resumeProcessesAsync(array $args = [])
|
||||
* @method \Aws\Result setDesiredCapacity(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise setDesiredCapacityAsync(array $args = [])
|
||||
* @method \Aws\Result setInstanceHealth(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise setInstanceHealthAsync(array $args = [])
|
||||
* @method \Aws\Result setInstanceProtection(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise setInstanceProtectionAsync(array $args = [])
|
||||
* @method \Aws\Result suspendProcesses(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise suspendProcessesAsync(array $args = [])
|
||||
* @method \Aws\Result terminateInstanceInAutoScalingGroup(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise terminateInstanceInAutoScalingGroupAsync(array $args = [])
|
||||
* @method \Aws\Result updateAutoScalingGroup(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateAutoScalingGroupAsync(array $args = [])
|
||||
*/
|
||||
class AutoScalingClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\AutoScaling\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error while interacting with the Auto Scaling service.
|
||||
*/
|
||||
class AutoScalingException extends AwsException {}
|
|
@ -1,328 +0,0 @@
|
|||
<?php
|
||||
namespace Aws;
|
||||
|
||||
use Aws\Api\ApiProvider;
|
||||
use Aws\Api\DocModel;
|
||||
use Aws\Api\Service;
|
||||
use Aws\Signature\SignatureProvider;
|
||||
use GuzzleHttp\Psr7\Uri;
|
||||
|
||||
/**
|
||||
* Default AWS client implementation
|
||||
*/
|
||||
class AwsClient implements AwsClientInterface
|
||||
{
|
||||
use AwsClientTrait;
|
||||
|
||||
/** @var array */
|
||||
private $config;
|
||||
|
||||
/** @var string */
|
||||
private $region;
|
||||
|
||||
/** @var string */
|
||||
private $endpoint;
|
||||
|
||||
/** @var Service */
|
||||
private $api;
|
||||
|
||||
/** @var callable */
|
||||
private $signatureProvider;
|
||||
|
||||
/** @var callable */
|
||||
private $credentialProvider;
|
||||
|
||||
/** @var HandlerList */
|
||||
private $handlerList;
|
||||
|
||||
/** @var array*/
|
||||
private $defaultRequestOptions;
|
||||
|
||||
/**
|
||||
* Get an array of client constructor arguments used by the client.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getArguments()
|
||||
{
|
||||
return ClientResolver::getDefaultArguments();
|
||||
}
|
||||
|
||||
/**
|
||||
* The client constructor accepts the following options:
|
||||
*
|
||||
* - api_provider: (callable) An optional PHP callable that accepts a
|
||||
* type, service, and version argument, and returns an array of
|
||||
* corresponding configuration data. The type value can be one of api,
|
||||
* waiter, or paginator.
|
||||
* - credentials:
|
||||
* (Aws\Credentials\CredentialsInterface|array|bool|callable) Specifies
|
||||
* the credentials used to sign requests. Provide an
|
||||
* Aws\Credentials\CredentialsInterface object, an associative array of
|
||||
* "key", "secret", and an optional "token" key, `false` to use null
|
||||
* credentials, or a callable credentials provider used to create
|
||||
* credentials or return null. See Aws\Credentials\CredentialProvider for
|
||||
* a list of built-in credentials providers. If no credentials are
|
||||
* provided, the SDK will attempt to load them from the environment.
|
||||
* - debug: (bool|array) Set to true to display debug information when
|
||||
* sending requests. Alternatively, you can provide an associative array
|
||||
* with the following keys: logfn: (callable) Function that is invoked
|
||||
* with log messages; stream_size: (int) When the size of a stream is
|
||||
* greater than this number, the stream data will not be logged (set to
|
||||
* "0" to not log any stream data); scrub_auth: (bool) Set to false to
|
||||
* disable the scrubbing of auth data from the logged messages; http:
|
||||
* (bool) Set to false to disable the "debug" feature of lower level HTTP
|
||||
* adapters (e.g., verbose curl output).
|
||||
* - stats: (bool|array) Set to true to gather transfer statistics on
|
||||
* requests sent. Alternatively, you can provide an associative array with
|
||||
* the following keys: retries: (bool) Set to false to disable reporting
|
||||
* on retries attempted; http: (bool) Set to true to enable collecting
|
||||
* statistics from lower level HTTP adapters (e.g., values returned in
|
||||
* GuzzleHttp\TransferStats). HTTP handlers must support an
|
||||
* `http_stats_receiver` option for this to have an effect; timer: (bool)
|
||||
* Set to true to enable a command timer that reports the total wall clock
|
||||
* time spent on an operation in seconds.
|
||||
* - endpoint: (string) The full URI of the webservice. This is only
|
||||
* required when connecting to a custom endpoint (e.g., a local version
|
||||
* of S3).
|
||||
* - endpoint_provider: (callable) An optional PHP callable that
|
||||
* accepts a hash of options including a "service" and "region" key and
|
||||
* returns NULL or a hash of endpoint data, of which the "endpoint" key
|
||||
* is required. See Aws\Endpoint\EndpointProvider for a list of built-in
|
||||
* providers.
|
||||
* - handler: (callable) A handler that accepts a command object,
|
||||
* request object and returns a promise that is fulfilled with an
|
||||
* Aws\ResultInterface object or rejected with an
|
||||
* Aws\Exception\AwsException. A handler does not accept a next handler
|
||||
* as it is terminal and expected to fulfill a command. If no handler is
|
||||
* provided, a default Guzzle handler will be utilized.
|
||||
* - http: (array, default=array(0)) Set to an array of SDK request
|
||||
* options to apply to each request (e.g., proxy, verify, etc.).
|
||||
* - http_handler: (callable) An HTTP handler is a function that
|
||||
* accepts a PSR-7 request object and returns a promise that is fulfilled
|
||||
* with a PSR-7 response object or rejected with an array of exception
|
||||
* data. NOTE: This option supersedes any provided "handler" option.
|
||||
* - idempotency_auto_fill: (bool|callable) Set to false to disable SDK to
|
||||
* populate parameters that enabled 'idempotencyToken' trait with a random
|
||||
* UUID v4 value on your behalf. Using default value 'true' still allows
|
||||
* parameter value to be overwritten when provided. Note: auto-fill only
|
||||
* works when cryptographically secure random bytes generator functions
|
||||
* (random_bytes, openssl_random_pseudo_bytes or mcrypt_create_iv) can be
|
||||
* found. You may also provide a callable source of random bytes.
|
||||
* - profile: (string) Allows you to specify which profile to use when
|
||||
* credentials are created from the AWS credentials file in your HOME
|
||||
* directory. This setting overrides the AWS_PROFILE environment
|
||||
* variable. Note: Specifying "profile" will cause the "credentials" key
|
||||
* to be ignored.
|
||||
* - region: (string, required) Region to connect to. See
|
||||
* http://docs.aws.amazon.com/general/latest/gr/rande.html for a list of
|
||||
* available regions.
|
||||
* - retries: (int, default=int(3)) Configures the maximum number of
|
||||
* allowed retries for a client (pass 0 to disable retries).
|
||||
* - scheme: (string, default=string(5) "https") URI scheme to use when
|
||||
* connecting connect. The SDK will utilize "https" endpoints (i.e.,
|
||||
* utilize SSL/TLS connections) by default. You can attempt to connect to
|
||||
* a service over an unencrypted "http" endpoint by setting ``scheme`` to
|
||||
* "http".
|
||||
* - signature_provider: (callable) A callable that accepts a signature
|
||||
* version name (e.g., "v4"), a service name, and region, and
|
||||
* returns a SignatureInterface object or null. This provider is used to
|
||||
* create signers utilized by the client. See
|
||||
* Aws\Signature\SignatureProvider for a list of built-in providers
|
||||
* - signature_version: (string) A string representing a custom
|
||||
* signature version to use with a service (e.g., v4). Note that
|
||||
* per/operation signature version MAY override this requested signature
|
||||
* version.
|
||||
* - validate: (bool, default=bool(true)) Set to false to disable
|
||||
* client-side parameter validation.
|
||||
* - version: (string, required) The version of the webservice to
|
||||
* utilize (e.g., 2006-03-01).
|
||||
*
|
||||
* @param array $args Client configuration arguments.
|
||||
*
|
||||
* @throws \InvalidArgumentException if any required options are missing or
|
||||
* the service is not supported.
|
||||
*/
|
||||
public function __construct(array $args)
|
||||
{
|
||||
list($service, $exceptionClass) = $this->parseClass();
|
||||
if (!isset($args['service'])) {
|
||||
$args['service'] = manifest($service)['endpoint'];
|
||||
}
|
||||
if (!isset($args['exception_class'])) {
|
||||
$args['exception_class'] = $exceptionClass;
|
||||
}
|
||||
|
||||
$this->handlerList = new HandlerList();
|
||||
$resolver = new ClientResolver(static::getArguments());
|
||||
$config = $resolver->resolve($args, $this->handlerList);
|
||||
$this->api = $config['api'];
|
||||
$this->signatureProvider = $config['signature_provider'];
|
||||
$this->endpoint = new Uri($config['endpoint']);
|
||||
$this->credentialProvider = $config['credentials'];
|
||||
$this->region = isset($config['region']) ? $config['region'] : null;
|
||||
$this->config = $config['config'];
|
||||
$this->defaultRequestOptions = $config['http'];
|
||||
$this->addSignatureMiddleware();
|
||||
$this->addInvocationId();
|
||||
|
||||
if (isset($args['with_resolved'])) {
|
||||
$args['with_resolved']($config);
|
||||
}
|
||||
}
|
||||
|
||||
public function getHandlerList()
|
||||
{
|
||||
return $this->handlerList;
|
||||
}
|
||||
|
||||
public function getConfig($option = null)
|
||||
{
|
||||
return $option === null
|
||||
? $this->config
|
||||
: (isset($this->config[$option])
|
||||
? $this->config[$option]
|
||||
: null);
|
||||
}
|
||||
|
||||
public function getCredentials()
|
||||
{
|
||||
$fn = $this->credentialProvider;
|
||||
return $fn();
|
||||
}
|
||||
|
||||
public function getEndpoint()
|
||||
{
|
||||
return $this->endpoint;
|
||||
}
|
||||
|
||||
public function getRegion()
|
||||
{
|
||||
return $this->region;
|
||||
}
|
||||
|
||||
public function getApi()
|
||||
{
|
||||
return $this->api;
|
||||
}
|
||||
|
||||
public function getCommand($name, array $args = [])
|
||||
{
|
||||
// Fail fast if the command cannot be found in the description.
|
||||
if (!isset($this->getApi()['operations'][$name])) {
|
||||
$name = ucfirst($name);
|
||||
if (!isset($this->getApi()['operations'][$name])) {
|
||||
throw new \InvalidArgumentException("Operation not found: $name");
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($args['@http'])) {
|
||||
$args['@http'] = $this->defaultRequestOptions;
|
||||
} else {
|
||||
$args['@http'] += $this->defaultRequestOptions;
|
||||
}
|
||||
|
||||
return new Command($name, $args, clone $this->getHandlerList());
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
throw new \RuntimeException('Instances of ' . static::class
|
||||
. ' cannot be serialized');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the signature_provider function of the client.
|
||||
*
|
||||
* @return callable
|
||||
*/
|
||||
final protected function getSignatureProvider()
|
||||
{
|
||||
return $this->signatureProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the class name and setup the custom exception class of the client
|
||||
* and return the "service" name of the client and "exception_class".
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function parseClass()
|
||||
{
|
||||
$klass = get_class($this);
|
||||
|
||||
if ($klass === __CLASS__) {
|
||||
return ['', 'Aws\Exception\AwsException'];
|
||||
}
|
||||
|
||||
$service = substr($klass, strrpos($klass, '\\') + 1, -6);
|
||||
|
||||
return [
|
||||
strtolower($service),
|
||||
"Aws\\{$service}\\Exception\\{$service}Exception"
|
||||
];
|
||||
}
|
||||
|
||||
private function addSignatureMiddleware()
|
||||
{
|
||||
$api = $this->getApi();
|
||||
$provider = $this->signatureProvider;
|
||||
$version = $this->config['signature_version'];
|
||||
$name = $this->config['signing_name'];
|
||||
$region = $this->config['signing_region'];
|
||||
|
||||
$resolver = static function (
|
||||
CommandInterface $c
|
||||
) use ($api, $provider, $name, $region, $version) {
|
||||
$authType = $api->getOperation($c->getName())['authtype'];
|
||||
switch ($authType){
|
||||
case 'none':
|
||||
$version = 'anonymous';
|
||||
break;
|
||||
case 'v4-unsigned-body':
|
||||
$version = 'v4-unsigned-body';
|
||||
break;
|
||||
}
|
||||
return SignatureProvider::resolve($provider, $version, $name, $region);
|
||||
};
|
||||
$this->handlerList->appendSign(
|
||||
Middleware::signer($this->credentialProvider, $resolver),
|
||||
'signer'
|
||||
);
|
||||
}
|
||||
|
||||
private function addInvocationId()
|
||||
{
|
||||
// Add invocation id to each request
|
||||
$this->handlerList->prependSign(Middleware::invocationId(), 'invocation-id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a service model and doc model with any necessary changes
|
||||
* applied.
|
||||
*
|
||||
* @param array $api Array of service data being documented.
|
||||
* @param array $docs Array of doc model data.
|
||||
*
|
||||
* @return array Tuple containing a [Service, DocModel]
|
||||
*
|
||||
* @internal This should only used to document the service API.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public static function applyDocFilters(array $api, array $docs)
|
||||
{
|
||||
return [
|
||||
new Service($api, ApiProvider::defaultProvider()),
|
||||
new DocModel($docs)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @return static
|
||||
*/
|
||||
public static function factory(array $config = [])
|
||||
{
|
||||
return new static($config);
|
||||
}
|
||||
}
|
|
@ -1,169 +0,0 @@
|
|||
<?php
|
||||
namespace Aws;
|
||||
|
||||
use Psr\Http\Message\UriInterface;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
|
||||
/**
|
||||
* Represents an AWS client.
|
||||
*/
|
||||
interface AwsClientInterface
|
||||
{
|
||||
/**
|
||||
* Creates and executes a command for an operation by name.
|
||||
*
|
||||
* Suffixing an operation name with "Async" will return a
|
||||
* promise that can be used to execute commands asynchronously.
|
||||
*
|
||||
* @param string $name Name of the command to execute.
|
||||
* @param array $arguments Arguments to pass to the getCommand method.
|
||||
*
|
||||
* @return ResultInterface
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __call($name, array $arguments);
|
||||
|
||||
/**
|
||||
* Create a command for an operation name.
|
||||
*
|
||||
* Special keys may be set on the command to control how it behaves,
|
||||
* including:
|
||||
*
|
||||
* - @http: Associative array of transfer specific options to apply to the
|
||||
* request that is serialized for this command. Available keys include
|
||||
* "proxy", "verify", "timeout", "connect_timeout", "debug", "delay", and
|
||||
* "headers".
|
||||
*
|
||||
* @param string $name Name of the operation to use in the command
|
||||
* @param array $args Arguments to pass to the command
|
||||
*
|
||||
* @return CommandInterface
|
||||
* @throws \InvalidArgumentException if no command can be found by name
|
||||
*/
|
||||
public function getCommand($name, array $args = []);
|
||||
|
||||
/**
|
||||
* Execute a single command.
|
||||
*
|
||||
* @param CommandInterface $command Command to execute
|
||||
*
|
||||
* @return ResultInterface
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function execute(CommandInterface $command);
|
||||
|
||||
/**
|
||||
* Execute a command asynchronously.
|
||||
*
|
||||
* @param CommandInterface $command Command to execute
|
||||
*
|
||||
* @return \GuzzleHttp\Promise\PromiseInterface
|
||||
*/
|
||||
public function executeAsync(CommandInterface $command);
|
||||
|
||||
/**
|
||||
* Returns a promise that is fulfilled with an
|
||||
* {@see \Aws\Credentials\CredentialsInterface} object.
|
||||
*
|
||||
* If you need the credentials synchronously, then call the wait() method
|
||||
* on the returned promise.
|
||||
*
|
||||
* @return PromiseInterface
|
||||
*/
|
||||
public function getCredentials();
|
||||
|
||||
/**
|
||||
* Get the region to which the client is configured to send requests.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRegion();
|
||||
|
||||
/**
|
||||
* Gets the default endpoint, or base URL, used by the client.
|
||||
*
|
||||
* @return UriInterface
|
||||
*/
|
||||
public function getEndpoint();
|
||||
|
||||
/**
|
||||
* Get the service description associated with the client.
|
||||
*
|
||||
* @return \Aws\Api\Service
|
||||
*/
|
||||
public function getApi();
|
||||
|
||||
/**
|
||||
* Get a client configuration value.
|
||||
*
|
||||
* @param string|null $option The option to retrieve. Pass null to retrieve
|
||||
* all options.
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function getConfig($option = null);
|
||||
|
||||
/**
|
||||
* Get the handler list used to transfer commands.
|
||||
*
|
||||
* This list can be modified to add middleware or to change the underlying
|
||||
* handler used to send HTTP requests.
|
||||
*
|
||||
* @return HandlerList
|
||||
*/
|
||||
public function getHandlerList();
|
||||
|
||||
/**
|
||||
* Get a resource iterator for the specified operation.
|
||||
*
|
||||
* @param string $name Name of the iterator to retrieve.
|
||||
* @param array $args Command arguments to use with each command.
|
||||
*
|
||||
* @return \Iterator
|
||||
* @throws \UnexpectedValueException if the iterator config is invalid.
|
||||
*/
|
||||
public function getIterator($name, array $args = []);
|
||||
|
||||
/**
|
||||
* Get a result paginator for the specified operation.
|
||||
*
|
||||
* @param string $name Name of the operation used for iterator
|
||||
* @param array $args Command args to be used with each command
|
||||
*
|
||||
* @return \Aws\ResultPaginator
|
||||
* @throws \UnexpectedValueException if the iterator config is invalid.
|
||||
*/
|
||||
public function getPaginator($name, array $args = []);
|
||||
|
||||
/**
|
||||
* Wait until a resource is in a particular state.
|
||||
*
|
||||
* @param string|callable $name Name of the waiter that defines the wait
|
||||
* configuration and conditions.
|
||||
* @param array $args Args to be used with each command executed
|
||||
* by the waiter. Waiter configuration options
|
||||
* can be provided in an associative array in
|
||||
* the @waiter key.
|
||||
* @return void
|
||||
* @throws \UnexpectedValueException if the waiter is invalid.
|
||||
*/
|
||||
public function waitUntil($name, array $args = []);
|
||||
|
||||
/**
|
||||
* Get a waiter that waits until a resource is in a particular state.
|
||||
*
|
||||
* Retrieving a waiter can be useful when you wish to wait asynchronously:
|
||||
*
|
||||
* $waiter = $client->getWaiter('foo', ['bar' => 'baz']);
|
||||
* $waiter->promise()->then(function () { echo 'Done!'; });
|
||||
*
|
||||
* @param string|callable $name Name of the waiter that defines the wait
|
||||
* configuration and conditions.
|
||||
* @param array $args Args to be used with each command executed
|
||||
* by the waiter. Waiter configuration options
|
||||
* can be provided in an associative array in
|
||||
* the @waiter key.
|
||||
* @return \Aws\Waiter
|
||||
* @throws \UnexpectedValueException if the waiter is invalid.
|
||||
*/
|
||||
public function getWaiter($name, array $args = []);
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
<?php
|
||||
namespace Aws;
|
||||
|
||||
use Aws\Api\Service;
|
||||
use GuzzleHttp\Promise\Promise;
|
||||
|
||||
/**
|
||||
* A trait providing generic functionality for interacting with Amazon Web
|
||||
* Services. This is meant to be used in classes implementing
|
||||
* \Aws\AwsClientInterface
|
||||
*/
|
||||
trait AwsClientTrait
|
||||
{
|
||||
public function getPaginator($name, array $args = [])
|
||||
{
|
||||
$config = $this->getApi()->getPaginatorConfig($name);
|
||||
|
||||
return new ResultPaginator($this, $name, $args, $config);
|
||||
}
|
||||
|
||||
public function getIterator($name, array $args = [])
|
||||
{
|
||||
$config = $this->getApi()->getPaginatorConfig($name);
|
||||
if (!$config['result_key']) {
|
||||
throw new \UnexpectedValueException(sprintf(
|
||||
'There are no resources to iterate for the %s operation of %s',
|
||||
$name, $this->getApi()['serviceFullName']
|
||||
));
|
||||
}
|
||||
|
||||
$key = is_array($config['result_key'])
|
||||
? $config['result_key'][0]
|
||||
: $config['result_key'];
|
||||
|
||||
if ($config['output_token'] && $config['input_token']) {
|
||||
return $this->getPaginator($name, $args)->search($key);
|
||||
}
|
||||
|
||||
$result = $this->execute($this->getCommand($name, $args))->search($key);
|
||||
|
||||
return new \ArrayIterator((array) $result);
|
||||
}
|
||||
|
||||
public function waitUntil($name, array $args = [])
|
||||
{
|
||||
return $this->getWaiter($name, $args)->promise()->wait();
|
||||
}
|
||||
|
||||
public function getWaiter($name, array $args = [])
|
||||
{
|
||||
$config = isset($args['@waiter']) ? $args['@waiter'] : [];
|
||||
$config += $this->getApi()->getWaiterConfig($name);
|
||||
|
||||
return new Waiter($this, $name, $args, $config);
|
||||
}
|
||||
|
||||
public function execute(CommandInterface $command)
|
||||
{
|
||||
return $this->executeAsync($command)->wait();
|
||||
}
|
||||
|
||||
public function executeAsync(CommandInterface $command)
|
||||
{
|
||||
$handler = $command->getHandlerList()->resolve();
|
||||
return $handler($command);
|
||||
}
|
||||
|
||||
public function __call($name, array $args)
|
||||
{
|
||||
$params = isset($args[0]) ? $args[0] : [];
|
||||
|
||||
if (substr($name, -5) === 'Async') {
|
||||
return $this->executeAsync(
|
||||
$this->getCommand(substr($name, 0, -5), $params)
|
||||
);
|
||||
}
|
||||
|
||||
return $this->execute($this->getCommand($name, $params));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param array $args
|
||||
*
|
||||
* @return CommandInterface
|
||||
*/
|
||||
abstract public function getCommand($name, array $args = []);
|
||||
|
||||
/**
|
||||
* @return Service
|
||||
*/
|
||||
abstract public function getApi();
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Batch;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **AWS Batch** service.
|
||||
* @method \Aws\Result cancelJob(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise cancelJobAsync(array $args = [])
|
||||
* @method \Aws\Result createComputeEnvironment(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createComputeEnvironmentAsync(array $args = [])
|
||||
* @method \Aws\Result createJobQueue(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createJobQueueAsync(array $args = [])
|
||||
* @method \Aws\Result deleteComputeEnvironment(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteComputeEnvironmentAsync(array $args = [])
|
||||
* @method \Aws\Result deleteJobQueue(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteJobQueueAsync(array $args = [])
|
||||
* @method \Aws\Result deregisterJobDefinition(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deregisterJobDefinitionAsync(array $args = [])
|
||||
* @method \Aws\Result describeComputeEnvironments(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeComputeEnvironmentsAsync(array $args = [])
|
||||
* @method \Aws\Result describeJobDefinitions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeJobDefinitionsAsync(array $args = [])
|
||||
* @method \Aws\Result describeJobQueues(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeJobQueuesAsync(array $args = [])
|
||||
* @method \Aws\Result describeJobs(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeJobsAsync(array $args = [])
|
||||
* @method \Aws\Result listJobs(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listJobsAsync(array $args = [])
|
||||
* @method \Aws\Result registerJobDefinition(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise registerJobDefinitionAsync(array $args = [])
|
||||
* @method \Aws\Result submitJob(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise submitJobAsync(array $args = [])
|
||||
* @method \Aws\Result terminateJob(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise terminateJobAsync(array $args = [])
|
||||
* @method \Aws\Result updateComputeEnvironment(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateComputeEnvironmentAsync(array $args = [])
|
||||
* @method \Aws\Result updateJobQueue(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateJobQueueAsync(array $args = [])
|
||||
*/
|
||||
class BatchClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Batch\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **AWS Batch** service.
|
||||
*/
|
||||
class BatchException extends AwsException {}
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Budgets;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **AWS Budgets** service.
|
||||
* @method \Aws\Result createBudget(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createBudgetAsync(array $args = [])
|
||||
* @method \Aws\Result createNotification(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createNotificationAsync(array $args = [])
|
||||
* @method \Aws\Result createSubscriber(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createSubscriberAsync(array $args = [])
|
||||
* @method \Aws\Result deleteBudget(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteBudgetAsync(array $args = [])
|
||||
* @method \Aws\Result deleteNotification(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteNotificationAsync(array $args = [])
|
||||
* @method \Aws\Result deleteSubscriber(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteSubscriberAsync(array $args = [])
|
||||
* @method \Aws\Result describeBudget(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeBudgetAsync(array $args = [])
|
||||
* @method \Aws\Result describeBudgets(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeBudgetsAsync(array $args = [])
|
||||
* @method \Aws\Result describeNotificationsForBudget(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeNotificationsForBudgetAsync(array $args = [])
|
||||
* @method \Aws\Result describeSubscribersForNotification(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeSubscribersForNotificationAsync(array $args = [])
|
||||
* @method \Aws\Result updateBudget(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateBudgetAsync(array $args = [])
|
||||
* @method \Aws\Result updateNotification(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateNotificationAsync(array $args = [])
|
||||
* @method \Aws\Result updateSubscriber(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateSubscriberAsync(array $args = [])
|
||||
*/
|
||||
class BudgetsClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Budgets\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **AWS Budgets** service.
|
||||
*/
|
||||
class BudgetsException extends AwsException {}
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
namespace Aws;
|
||||
|
||||
/**
|
||||
* Represents a simple cache interface.
|
||||
*/
|
||||
interface CacheInterface
|
||||
{
|
||||
/**
|
||||
* Get a cache item by key.
|
||||
*
|
||||
* @param string $key Key to retrieve.
|
||||
*
|
||||
* @return mixed|null Returns the value or null if not found.
|
||||
*/
|
||||
public function get($key);
|
||||
|
||||
/**
|
||||
* Set a cache key value.
|
||||
*
|
||||
* @param string $key Key to set
|
||||
* @param mixed $value Value to set.
|
||||
* @param int $ttl Number of seconds the item is allowed to live. Set
|
||||
* to 0 to allow an unlimited lifetime.
|
||||
*/
|
||||
public function set($key, $value, $ttl = 0);
|
||||
|
||||
/**
|
||||
* Remove a cache key.
|
||||
*
|
||||
* @param string $key Key to remove.
|
||||
*/
|
||||
public function remove($key);
|
||||
}
|
|
@ -1,744 +0,0 @@
|
|||
<?php
|
||||
namespace Aws;
|
||||
|
||||
use Aws\Api\Validator;
|
||||
use Aws\Api\ApiProvider;
|
||||
use Aws\Api\Service;
|
||||
use Aws\Credentials\Credentials;
|
||||
use Aws\Credentials\CredentialsInterface;
|
||||
use Aws\Endpoint\Partition;
|
||||
use Aws\Endpoint\PartitionEndpointProvider;
|
||||
use Aws\Endpoint\PartitionProviderInterface;
|
||||
use Aws\Signature\SignatureProvider;
|
||||
use Aws\Endpoint\EndpointProvider;
|
||||
use Aws\Credentials\CredentialProvider;
|
||||
use GuzzleHttp\Promise;
|
||||
use InvalidArgumentException as IAE;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
|
||||
/**
|
||||
* @internal Resolves a hash of client arguments to construct a client.
|
||||
*/
|
||||
class ClientResolver
|
||||
{
|
||||
/** @var array */
|
||||
private $argDefinitions;
|
||||
|
||||
/** @var array Map of types to a corresponding function */
|
||||
private static $typeMap = [
|
||||
'resource' => 'is_resource',
|
||||
'callable' => 'is_callable',
|
||||
'int' => 'is_int',
|
||||
'bool' => 'is_bool',
|
||||
'string' => 'is_string',
|
||||
'object' => 'is_object',
|
||||
'array' => 'is_array',
|
||||
];
|
||||
|
||||
private static $defaultArgs = [
|
||||
'service' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['string'],
|
||||
'doc' => 'Name of the service to utilize. This value will be supplied by default when using one of the SDK clients (e.g., Aws\\S3\\S3Client).',
|
||||
'required' => true,
|
||||
'internal' => true
|
||||
],
|
||||
'exception_class' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['string'],
|
||||
'doc' => 'Exception class to create when an error occurs.',
|
||||
'default' => 'Aws\Exception\AwsException',
|
||||
'internal' => true
|
||||
],
|
||||
'scheme' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['string'],
|
||||
'default' => 'https',
|
||||
'doc' => 'URI scheme to use when connecting connect. The SDK will utilize "https" endpoints (i.e., utilize SSL/TLS connections) by default. You can attempt to connect to a service over an unencrypted "http" endpoint by setting ``scheme`` to "http".',
|
||||
],
|
||||
'endpoint' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['string'],
|
||||
'doc' => 'The full URI of the webservice. This is only required when connecting to a custom endpoint (e.g., a local version of S3).',
|
||||
'fn' => [__CLASS__, '_apply_endpoint'],
|
||||
],
|
||||
'region' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['string'],
|
||||
'required' => [__CLASS__, '_missing_region'],
|
||||
'doc' => 'Region to connect to. See http://docs.aws.amazon.com/general/latest/gr/rande.html for a list of available regions.',
|
||||
],
|
||||
'version' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['string'],
|
||||
'required' => [__CLASS__, '_missing_version'],
|
||||
'doc' => 'The version of the webservice to utilize (e.g., 2006-03-01).',
|
||||
],
|
||||
'signature_provider' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['callable'],
|
||||
'doc' => 'A callable that accepts a signature version name (e.g., "v4"), a service name, and region, and returns a SignatureInterface object or null. This provider is used to create signers utilized by the client. See Aws\\Signature\\SignatureProvider for a list of built-in providers',
|
||||
'default' => [__CLASS__, '_default_signature_provider'],
|
||||
],
|
||||
'api_provider' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['callable'],
|
||||
'doc' => 'An optional PHP callable that accepts a type, service, and version argument, and returns an array of corresponding configuration data. The type value can be one of api, waiter, or paginator.',
|
||||
'fn' => [__CLASS__, '_apply_api_provider'],
|
||||
'default' => [ApiProvider::class, 'defaultProvider'],
|
||||
],
|
||||
'endpoint_provider' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['callable'],
|
||||
'fn' => [__CLASS__, '_apply_endpoint_provider'],
|
||||
'doc' => 'An optional PHP callable that accepts a hash of options including a "service" and "region" key and returns NULL or a hash of endpoint data, of which the "endpoint" key is required. See Aws\\Endpoint\\EndpointProvider for a list of built-in providers.',
|
||||
'default' => [__CLASS__, '_default_endpoint_provider'],
|
||||
],
|
||||
'serializer' => [
|
||||
'default' => [__CLASS__, '_default_serializer'],
|
||||
'fn' => [__CLASS__, '_apply_serializer'],
|
||||
'internal' => true,
|
||||
'type' => 'value',
|
||||
'valid' => ['callable'],
|
||||
],
|
||||
'signature_version' => [
|
||||
'type' => 'config',
|
||||
'valid' => ['string'],
|
||||
'doc' => 'A string representing a custom signature version to use with a service (e.g., v4). Note that per/operation signature version MAY override this requested signature version.',
|
||||
'default' => [__CLASS__, '_default_signature_version'],
|
||||
],
|
||||
'signing_name' => [
|
||||
'type' => 'config',
|
||||
'valid' => ['string'],
|
||||
'doc' => 'A string representing a custom service name to be used when calculating a request signature.',
|
||||
'default' => [__CLASS__, '_default_signing_name'],
|
||||
],
|
||||
'signing_region' => [
|
||||
'type' => 'config',
|
||||
'valid' => ['string'],
|
||||
'doc' => 'A string representing a custom region name to be used when calculating a request signature.',
|
||||
'default' => [__CLASS__, '_default_signing_region'],
|
||||
],
|
||||
'profile' => [
|
||||
'type' => 'config',
|
||||
'valid' => ['string'],
|
||||
'doc' => 'Allows you to specify which profile to use when credentials are created from the AWS credentials file in your HOME directory. This setting overrides the AWS_PROFILE environment variable. Note: Specifying "profile" will cause the "credentials" key to be ignored.',
|
||||
'fn' => [__CLASS__, '_apply_profile'],
|
||||
],
|
||||
'credentials' => [
|
||||
'type' => 'value',
|
||||
'valid' => [CredentialsInterface::class, CacheInterface::class, 'array', 'bool', 'callable'],
|
||||
'doc' => 'Specifies the credentials used to sign requests. Provide an Aws\Credentials\CredentialsInterface object, an associative array of "key", "secret", and an optional "token" key, `false` to use null credentials, or a callable credentials provider used to create credentials or return null. See Aws\\Credentials\\CredentialProvider for a list of built-in credentials providers. If no credentials are provided, the SDK will attempt to load them from the environment.',
|
||||
'fn' => [__CLASS__, '_apply_credentials'],
|
||||
'default' => [CredentialProvider::class, 'defaultProvider'],
|
||||
],
|
||||
'stats' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['bool', 'array'],
|
||||
'default' => false,
|
||||
'doc' => 'Set to true to gather transfer statistics on requests sent. Alternatively, you can provide an associative array with the following keys: retries: (bool) Set to false to disable reporting on retries attempted; http: (bool) Set to true to enable collecting statistics from lower level HTTP adapters (e.g., values returned in GuzzleHttp\TransferStats). HTTP handlers must support an http_stats_receiver option for this to have an effect; timer: (bool) Set to true to enable a command timer that reports the total wall clock time spent on an operation in seconds.',
|
||||
'fn' => [__CLASS__, '_apply_stats'],
|
||||
],
|
||||
'retries' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['int'],
|
||||
'doc' => 'Configures the maximum number of allowed retries for a client (pass 0 to disable retries). ',
|
||||
'fn' => [__CLASS__, '_apply_retries'],
|
||||
'default' => 3,
|
||||
],
|
||||
'validate' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['bool', 'array'],
|
||||
'default' => true,
|
||||
'doc' => 'Set to false to disable client-side parameter validation. Set to true to utilize default validation constraints. Set to an associative array of validation options to enable specific validation constraints.',
|
||||
'fn' => [__CLASS__, '_apply_validate'],
|
||||
],
|
||||
'debug' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['bool', 'array'],
|
||||
'doc' => 'Set to true to display debug information when sending requests. Alternatively, you can provide an associative array with the following keys: logfn: (callable) Function that is invoked with log messages; stream_size: (int) When the size of a stream is greater than this number, the stream data will not be logged (set to "0" to not log any stream data); scrub_auth: (bool) Set to false to disable the scrubbing of auth data from the logged messages; http: (bool) Set to false to disable the "debug" feature of lower level HTTP adapters (e.g., verbose curl output).',
|
||||
'fn' => [__CLASS__, '_apply_debug'],
|
||||
],
|
||||
'http' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['array'],
|
||||
'default' => [],
|
||||
'doc' => 'Set to an array of SDK request options to apply to each request (e.g., proxy, verify, etc.).',
|
||||
],
|
||||
'http_handler' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['callable'],
|
||||
'doc' => 'An HTTP handler is a function that accepts a PSR-7 request object and returns a promise that is fulfilled with a PSR-7 response object or rejected with an array of exception data. NOTE: This option supersedes any provided "handler" option.',
|
||||
'fn' => [__CLASS__, '_apply_http_handler']
|
||||
],
|
||||
'handler' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['callable'],
|
||||
'doc' => 'A handler that accepts a command object, request object and returns a promise that is fulfilled with an Aws\ResultInterface object or rejected with an Aws\Exception\AwsException. A handler does not accept a next handler as it is terminal and expected to fulfill a command. If no handler is provided, a default Guzzle handler will be utilized.',
|
||||
'fn' => [__CLASS__, '_apply_handler'],
|
||||
'default' => [__CLASS__, '_default_handler']
|
||||
],
|
||||
'ua_append' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['string', 'array'],
|
||||
'doc' => 'Provide a string or array of strings to send in the User-Agent header.',
|
||||
'fn' => [__CLASS__, '_apply_user_agent'],
|
||||
'default' => [],
|
||||
],
|
||||
'idempotency_auto_fill' => [
|
||||
'type' => 'value',
|
||||
'valid' => ['bool', 'callable'],
|
||||
'doc' => 'Set to false to disable SDK to populate parameters that enabled \'idempotencyToken\' trait with a random UUID v4 value on your behalf. Using default value \'true\' still allows parameter value to be overwritten when provided. Note: auto-fill only works when cryptographically secure random bytes generator functions(random_bytes, openssl_random_pseudo_bytes or mcrypt_create_iv) can be found. You may also provide a callable source of random bytes.',
|
||||
'default' => true,
|
||||
'fn' => [__CLASS__, '_apply_idempotency_auto_fill']
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Gets an array of default client arguments, each argument containing a
|
||||
* hash of the following:
|
||||
*
|
||||
* - type: (string, required) option type described as follows:
|
||||
* - value: The default option type.
|
||||
* - config: The provided value is made available in the client's
|
||||
* getConfig() method.
|
||||
* - valid: (array, required) Valid PHP types or class names. Note: null
|
||||
* is not an allowed type.
|
||||
* - required: (bool, callable) Whether or not the argument is required.
|
||||
* Provide a function that accepts an array of arguments and returns a
|
||||
* string to provide a custom error message.
|
||||
* - default: (mixed) The default value of the argument if not provided. If
|
||||
* a function is provided, then it will be invoked to provide a default
|
||||
* value. The function is provided the array of options and is expected
|
||||
* to return the default value of the option. The default value can be a
|
||||
* closure and can not be a callable string that is not part of the
|
||||
* defaultArgs array.
|
||||
* - doc: (string) The argument documentation string.
|
||||
* - fn: (callable) Function used to apply the argument. The function
|
||||
* accepts the provided value, array of arguments by reference, and an
|
||||
* event emitter.
|
||||
*
|
||||
* Note: Order is honored and important when applying arguments.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getDefaultArguments()
|
||||
{
|
||||
return self::$defaultArgs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $argDefinitions Client arguments.
|
||||
*/
|
||||
public function __construct(array $argDefinitions)
|
||||
{
|
||||
$this->argDefinitions = $argDefinitions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves client configuration options and attached event listeners.
|
||||
* Check for missing keys in passed arguments
|
||||
*
|
||||
* @param array $args Provided constructor arguments.
|
||||
* @param HandlerList $list Handler list to augment.
|
||||
*
|
||||
* @return array Returns the array of provided options.
|
||||
* @throws \InvalidArgumentException
|
||||
* @see Aws\AwsClient::__construct for a list of available options.
|
||||
*/
|
||||
public function resolve(array $args, HandlerList $list)
|
||||
{
|
||||
$args['config'] = [];
|
||||
foreach ($this->argDefinitions as $key => $a) {
|
||||
// Add defaults, validate required values, and skip if not set.
|
||||
if (!isset($args[$key])) {
|
||||
if (isset($a['default'])) {
|
||||
// Merge defaults in when not present.
|
||||
if (is_callable($a['default'])
|
||||
&& (
|
||||
is_array($a['default'])
|
||||
|| $a['default'] instanceof \Closure
|
||||
)
|
||||
) {
|
||||
$args[$key] = $a['default']($args);
|
||||
} else {
|
||||
$args[$key] = $a['default'];
|
||||
}
|
||||
} elseif (empty($a['required'])) {
|
||||
continue;
|
||||
} else {
|
||||
$this->throwRequired($args);
|
||||
}
|
||||
}
|
||||
|
||||
// Validate the types against the provided value.
|
||||
foreach ($a['valid'] as $check) {
|
||||
if (isset(self::$typeMap[$check])) {
|
||||
$fn = self::$typeMap[$check];
|
||||
if ($fn($args[$key])) {
|
||||
goto is_valid;
|
||||
}
|
||||
} elseif ($args[$key] instanceof $check) {
|
||||
goto is_valid;
|
||||
}
|
||||
}
|
||||
|
||||
$this->invalidType($key, $args[$key]);
|
||||
|
||||
// Apply the value
|
||||
is_valid:
|
||||
if (isset($a['fn'])) {
|
||||
$a['fn']($args[$key], $args, $list);
|
||||
}
|
||||
|
||||
if ($a['type'] === 'config') {
|
||||
$args['config'][$key] = $args[$key];
|
||||
}
|
||||
}
|
||||
|
||||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a verbose error message for an invalid argument.
|
||||
*
|
||||
* @param string $name Name of the argument that is missing.
|
||||
* @param array $args Provided arguments
|
||||
* @param bool $useRequired Set to true to show the required fn text if
|
||||
* available instead of the documentation.
|
||||
* @return string
|
||||
*/
|
||||
private function getArgMessage($name, $args = [], $useRequired = false)
|
||||
{
|
||||
$arg = $this->argDefinitions[$name];
|
||||
$msg = '';
|
||||
$modifiers = [];
|
||||
if (isset($arg['valid'])) {
|
||||
$modifiers[] = implode('|', $arg['valid']);
|
||||
}
|
||||
if (isset($arg['choice'])) {
|
||||
$modifiers[] = 'One of ' . implode(', ', $arg['choice']);
|
||||
}
|
||||
if ($modifiers) {
|
||||
$msg .= '(' . implode('; ', $modifiers) . ')';
|
||||
}
|
||||
$msg = wordwrap("{$name}: {$msg}", 75, "\n ");
|
||||
|
||||
if ($useRequired && is_callable($arg['required'])) {
|
||||
$msg .= "\n\n ";
|
||||
$msg .= str_replace("\n", "\n ", call_user_func($arg['required'], $args));
|
||||
} elseif (isset($arg['doc'])) {
|
||||
$msg .= wordwrap("\n\n {$arg['doc']}", 75, "\n ");
|
||||
}
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw when an invalid type is encountered.
|
||||
*
|
||||
* @param string $name Name of the value being validated.
|
||||
* @param mixed $provided The provided value.
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
private function invalidType($name, $provided)
|
||||
{
|
||||
$expected = implode('|', $this->argDefinitions[$name]['valid']);
|
||||
$msg = "Invalid configuration value "
|
||||
. "provided for \"{$name}\". Expected {$expected}, but got "
|
||||
. describe_type($provided) . "\n\n"
|
||||
. $this->getArgMessage($name);
|
||||
throw new IAE($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an exception for missing required arguments.
|
||||
*
|
||||
* @param array $args Passed in arguments.
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
private function throwRequired(array $args)
|
||||
{
|
||||
$missing = [];
|
||||
foreach ($this->argDefinitions as $k => $a) {
|
||||
if (empty($a['required'])
|
||||
|| isset($a['default'])
|
||||
|| isset($args[$k])
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$missing[] = $this->getArgMessage($k, $args, true);
|
||||
}
|
||||
$msg = "Missing required client configuration options: \n\n";
|
||||
$msg .= implode("\n\n", $missing);
|
||||
throw new IAE($msg);
|
||||
}
|
||||
|
||||
public static function _apply_retries($value, array &$args, HandlerList $list)
|
||||
{
|
||||
if ($value) {
|
||||
$decider = RetryMiddleware::createDefaultDecider($value);
|
||||
$list->appendSign(
|
||||
Middleware::retry($decider, null, $args['stats']['retries']),
|
||||
'retry'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static function _apply_credentials($value, array &$args)
|
||||
{
|
||||
if (is_callable($value)) {
|
||||
return;
|
||||
} elseif ($value instanceof CredentialsInterface) {
|
||||
$args['credentials'] = CredentialProvider::fromCredentials($value);
|
||||
} elseif (is_array($value)
|
||||
&& isset($value['key'])
|
||||
&& isset($value['secret'])
|
||||
) {
|
||||
$args['credentials'] = CredentialProvider::fromCredentials(
|
||||
new Credentials(
|
||||
$value['key'],
|
||||
$value['secret'],
|
||||
isset($value['token']) ? $value['token'] : null,
|
||||
isset($value['expires']) ? $value['expires'] : null
|
||||
)
|
||||
);
|
||||
} elseif ($value === false) {
|
||||
$args['credentials'] = CredentialProvider::fromCredentials(
|
||||
new Credentials('', '')
|
||||
);
|
||||
$args['config']['signature_version'] = 'anonymous';
|
||||
} elseif ($value instanceof CacheInterface) {
|
||||
$args['credentials'] = CredentialProvider::defaultProvider($args);
|
||||
} else {
|
||||
throw new IAE('Credentials must be an instance of '
|
||||
. 'Aws\Credentials\CredentialsInterface, an associative '
|
||||
. 'array that contains "key", "secret", and an optional "token" '
|
||||
. 'key-value pairs, a credentials provider function, or false.');
|
||||
}
|
||||
}
|
||||
|
||||
public static function _apply_api_provider(callable $value, array &$args)
|
||||
{
|
||||
$api = new Service(
|
||||
ApiProvider::resolve(
|
||||
$value,
|
||||
'api',
|
||||
$args['service'],
|
||||
$args['version']
|
||||
),
|
||||
$value
|
||||
);
|
||||
|
||||
if (
|
||||
empty($args['config']['signing_name'])
|
||||
&& isset($api['metadata']['signingName'])
|
||||
) {
|
||||
$args['config']['signing_name'] = $api['metadata']['signingName'];
|
||||
}
|
||||
|
||||
$args['api'] = $api;
|
||||
$args['parser'] = Service::createParser($api);
|
||||
$args['error_parser'] = Service::createErrorParser($api->getProtocol());
|
||||
}
|
||||
|
||||
public static function _apply_endpoint_provider(callable $value, array &$args)
|
||||
{
|
||||
if (!isset($args['endpoint'])) {
|
||||
$endpointPrefix = isset($args['api']['metadata']['endpointPrefix'])
|
||||
? $args['api']['metadata']['endpointPrefix']
|
||||
: $args['service'];
|
||||
|
||||
// Invoke the endpoint provider and throw if it does not resolve.
|
||||
$result = EndpointProvider::resolve($value, [
|
||||
'service' => $endpointPrefix,
|
||||
'region' => $args['region'],
|
||||
'scheme' => $args['scheme']
|
||||
]);
|
||||
|
||||
$args['endpoint'] = $result['endpoint'];
|
||||
|
||||
if (
|
||||
empty($args['config']['signature_version'])
|
||||
&& isset($result['signatureVersion'])
|
||||
) {
|
||||
$args['config']['signature_version']
|
||||
= $result['signatureVersion'];
|
||||
}
|
||||
|
||||
if (
|
||||
empty($args['config']['signing_region'])
|
||||
&& isset($result['signingRegion'])
|
||||
) {
|
||||
$args['config']['signing_region'] = $result['signingRegion'];
|
||||
}
|
||||
|
||||
if (
|
||||
empty($args['config']['signing_name'])
|
||||
&& isset($result['signingName'])
|
||||
) {
|
||||
$args['config']['signing_name'] = $result['signingName'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function _apply_serializer($value, array &$args, HandlerList $list)
|
||||
{
|
||||
$list->prependBuild(Middleware::requestBuilder($value), 'builder');
|
||||
}
|
||||
|
||||
public static function _apply_debug($value, array &$args, HandlerList $list)
|
||||
{
|
||||
if ($value !== false) {
|
||||
$list->interpose(new TraceMiddleware($value === true ? [] : $value));
|
||||
}
|
||||
}
|
||||
|
||||
public static function _apply_stats($value, array &$args, HandlerList $list)
|
||||
{
|
||||
// Create an array of stat collectors that are disabled (set to false)
|
||||
// by default. If the user has passed in true, enable all stat
|
||||
// collectors.
|
||||
$defaults = array_fill_keys(
|
||||
['http', 'retries', 'timer'],
|
||||
$value === true
|
||||
);
|
||||
$args['stats'] = is_array($value)
|
||||
? array_replace($defaults, $value)
|
||||
: $defaults;
|
||||
|
||||
if ($args['stats']['timer']) {
|
||||
$list->prependInit(Middleware::timer(), 'timer');
|
||||
}
|
||||
}
|
||||
|
||||
public static function _apply_profile($_, array &$args)
|
||||
{
|
||||
$args['credentials'] = CredentialProvider::ini($args['profile']);
|
||||
}
|
||||
|
||||
public static function _apply_validate($value, array &$args, HandlerList $list)
|
||||
{
|
||||
if ($value === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
$validator = $value === true
|
||||
? new Validator()
|
||||
: new Validator($value);
|
||||
$list->appendValidate(
|
||||
Middleware::validation($args['api'], $validator),
|
||||
'validation'
|
||||
);
|
||||
}
|
||||
|
||||
public static function _apply_handler($value, array &$args, HandlerList $list)
|
||||
{
|
||||
$list->setHandler($value);
|
||||
}
|
||||
|
||||
public static function _default_handler(array &$args)
|
||||
{
|
||||
return new WrappedHttpHandler(
|
||||
default_http_handler(),
|
||||
$args['parser'],
|
||||
$args['error_parser'],
|
||||
$args['exception_class'],
|
||||
$args['stats']['http']
|
||||
);
|
||||
}
|
||||
|
||||
public static function _apply_http_handler($value, array &$args, HandlerList $list)
|
||||
{
|
||||
$args['handler'] = new WrappedHttpHandler(
|
||||
$value,
|
||||
$args['parser'],
|
||||
$args['error_parser'],
|
||||
$args['exception_class'],
|
||||
$args['stats']['http']
|
||||
);
|
||||
}
|
||||
|
||||
public static function _apply_user_agent($value, array &$args, HandlerList $list)
|
||||
{
|
||||
if (!is_array($value)) {
|
||||
$value = [$value];
|
||||
}
|
||||
|
||||
$value = array_map('strval', $value);
|
||||
|
||||
if (defined('HHVM_VERSION')) {
|
||||
array_unshift($value, 'HHVM/' . HHVM_VERSION);
|
||||
}
|
||||
array_unshift($value, 'aws-sdk-php/' . Sdk::VERSION);
|
||||
$args['ua_append'] = $value;
|
||||
|
||||
$list->appendBuild(static function (callable $handler) use ($value) {
|
||||
return function (
|
||||
CommandInterface $command,
|
||||
RequestInterface $request
|
||||
) use ($handler, $value) {
|
||||
return $handler($command, $request->withHeader(
|
||||
'User-Agent',
|
||||
implode(' ', array_merge(
|
||||
$value,
|
||||
$request->getHeader('User-Agent')
|
||||
))
|
||||
));
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public static function _apply_endpoint($value, array &$args, HandlerList $list)
|
||||
{
|
||||
$parts = parse_url($value);
|
||||
if (empty($parts['scheme']) || empty($parts['host'])) {
|
||||
throw new IAE(
|
||||
'Endpoints must be full URIs and include a scheme and host'
|
||||
);
|
||||
}
|
||||
|
||||
$args['endpoint'] = $value;
|
||||
}
|
||||
|
||||
public static function _apply_idempotency_auto_fill(
|
||||
$value,
|
||||
array &$args,
|
||||
HandlerList $list
|
||||
) {
|
||||
$enabled = false;
|
||||
$generator = null;
|
||||
|
||||
|
||||
if (is_bool($value)) {
|
||||
$enabled = $value;
|
||||
} elseif (is_callable($value)) {
|
||||
$enabled = true;
|
||||
$generator = $value;
|
||||
}
|
||||
|
||||
if ($enabled) {
|
||||
$list->prependInit(
|
||||
IdempotencyTokenMiddleware::wrap($args['api'], $generator),
|
||||
'idempotency_auto_fill'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static function _default_endpoint_provider(array $args)
|
||||
{
|
||||
return PartitionEndpointProvider::defaultProvider()
|
||||
->getPartition($args['region'], $args['service']);
|
||||
}
|
||||
|
||||
public static function _default_serializer(array $args)
|
||||
{
|
||||
return Service::createSerializer(
|
||||
$args['api'],
|
||||
$args['endpoint']
|
||||
);
|
||||
}
|
||||
|
||||
public static function _default_signature_provider()
|
||||
{
|
||||
return SignatureProvider::defaultProvider();
|
||||
}
|
||||
|
||||
public static function _default_signature_version(array &$args)
|
||||
{
|
||||
if (isset($args['config']['signature_version'])) {
|
||||
return $args['config']['signature_version'];
|
||||
}
|
||||
|
||||
$args['__partition_result'] = isset($args['__partition_result'])
|
||||
? isset($args['__partition_result'])
|
||||
: call_user_func(PartitionEndpointProvider::defaultProvider(), [
|
||||
'service' => $args['service'],
|
||||
'region' => $args['region'],
|
||||
]);
|
||||
|
||||
return isset($args['__partition_result']['signatureVersion'])
|
||||
? $args['__partition_result']['signatureVersion']
|
||||
: $args['api']->getSignatureVersion();
|
||||
}
|
||||
|
||||
public static function _default_signing_name(array &$args)
|
||||
{
|
||||
if (isset($args['config']['signing_name'])) {
|
||||
return $args['config']['signing_name'];
|
||||
}
|
||||
|
||||
$args['__partition_result'] = isset($args['__partition_result'])
|
||||
? isset($args['__partition_result'])
|
||||
: call_user_func(PartitionEndpointProvider::defaultProvider(), [
|
||||
'service' => $args['service'],
|
||||
'region' => $args['region'],
|
||||
]);
|
||||
|
||||
if (isset($args['__partition_result']['signingName'])) {
|
||||
return $args['__partition_result']['signingName'];
|
||||
}
|
||||
|
||||
if ($signingName = $args['api']->getSigningName()) {
|
||||
return $signingName;
|
||||
}
|
||||
|
||||
return $args['service'];
|
||||
}
|
||||
|
||||
public static function _default_signing_region(array &$args)
|
||||
{
|
||||
if (isset($args['config']['signing_region'])) {
|
||||
return $args['config']['signing_region'];
|
||||
}
|
||||
|
||||
$args['__partition_result'] = isset($args['__partition_result'])
|
||||
? isset($args['__partition_result'])
|
||||
: call_user_func(PartitionEndpointProvider::defaultProvider(), [
|
||||
'service' => $args['service'],
|
||||
'region' => $args['region'],
|
||||
]);
|
||||
|
||||
return isset($args['__partition_result']['signingRegion'])
|
||||
? $args['__partition_result']['signingRegion']
|
||||
: $args['region'];
|
||||
}
|
||||
|
||||
public static function _missing_version(array $args)
|
||||
{
|
||||
$service = isset($args['service']) ? $args['service'] : '';
|
||||
$versions = ApiProvider::defaultProvider()->getVersions($service);
|
||||
$versions = implode("\n", array_map(function ($v) {
|
||||
return "* \"$v\"";
|
||||
}, $versions)) ?: '* (none found)';
|
||||
|
||||
return <<<EOT
|
||||
A "version" configuration value is required. Specifying a version constraint
|
||||
ensures that your code will not be affected by a breaking change made to the
|
||||
service. For example, when using Amazon S3, you can lock your API version to
|
||||
"2006-03-01".
|
||||
|
||||
Your build of the SDK has the following version(s) of "{$service}": {$versions}
|
||||
|
||||
You may provide "latest" to the "version" configuration value to utilize the
|
||||
most recent available API version that your client's API provider can find.
|
||||
Note: Using 'latest' in a production application is not recommended.
|
||||
|
||||
A list of available API versions can be found on each client's API documentation
|
||||
page: http://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html. If you are
|
||||
unable to load a specific API version, then you may need to update your copy of
|
||||
the SDK.
|
||||
EOT;
|
||||
}
|
||||
|
||||
public static function _missing_region(array $args)
|
||||
{
|
||||
$service = isset($args['service']) ? $args['service'] : '';
|
||||
|
||||
return <<<EOT
|
||||
A "region" configuration value is required for the "{$service}" service
|
||||
(e.g., "us-west-2"). A list of available public regions and endpoints can be
|
||||
found at http://docs.aws.amazon.com/general/latest/gr/rande.html.
|
||||
EOT;
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Cloud9;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **AWS Cloud9** service.
|
||||
* @method \Aws\Result createEnvironmentEC2(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createEnvironmentEC2Async(array $args = [])
|
||||
* @method \Aws\Result createEnvironmentMembership(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createEnvironmentMembershipAsync(array $args = [])
|
||||
* @method \Aws\Result deleteEnvironment(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteEnvironmentAsync(array $args = [])
|
||||
* @method \Aws\Result deleteEnvironmentMembership(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteEnvironmentMembershipAsync(array $args = [])
|
||||
* @method \Aws\Result describeEnvironmentMemberships(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeEnvironmentMembershipsAsync(array $args = [])
|
||||
* @method \Aws\Result describeEnvironmentStatus(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeEnvironmentStatusAsync(array $args = [])
|
||||
* @method \Aws\Result describeEnvironments(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeEnvironmentsAsync(array $args = [])
|
||||
* @method \Aws\Result listEnvironments(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listEnvironmentsAsync(array $args = [])
|
||||
* @method \Aws\Result updateEnvironment(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateEnvironmentAsync(array $args = [])
|
||||
* @method \Aws\Result updateEnvironmentMembership(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateEnvironmentMembershipAsync(array $args = [])
|
||||
*/
|
||||
class Cloud9Client extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\Cloud9\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **AWS Cloud9** service.
|
||||
*/
|
||||
class Cloud9Exception extends AwsException {}
|
|
@ -1,133 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudDirectory;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **Amazon CloudDirectory** service.
|
||||
* @method \Aws\Result addFacetToObject(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise addFacetToObjectAsync(array $args = [])
|
||||
* @method \Aws\Result applySchema(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise applySchemaAsync(array $args = [])
|
||||
* @method \Aws\Result attachObject(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise attachObjectAsync(array $args = [])
|
||||
* @method \Aws\Result attachPolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise attachPolicyAsync(array $args = [])
|
||||
* @method \Aws\Result attachToIndex(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise attachToIndexAsync(array $args = [])
|
||||
* @method \Aws\Result attachTypedLink(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise attachTypedLinkAsync(array $args = [])
|
||||
* @method \Aws\Result batchRead(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise batchReadAsync(array $args = [])
|
||||
* @method \Aws\Result batchWrite(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise batchWriteAsync(array $args = [])
|
||||
* @method \Aws\Result createDirectory(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createDirectoryAsync(array $args = [])
|
||||
* @method \Aws\Result createFacet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createFacetAsync(array $args = [])
|
||||
* @method \Aws\Result createIndex(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createIndexAsync(array $args = [])
|
||||
* @method \Aws\Result createObject(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createObjectAsync(array $args = [])
|
||||
* @method \Aws\Result createSchema(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createSchemaAsync(array $args = [])
|
||||
* @method \Aws\Result createTypedLinkFacet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createTypedLinkFacetAsync(array $args = [])
|
||||
* @method \Aws\Result deleteDirectory(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteDirectoryAsync(array $args = [])
|
||||
* @method \Aws\Result deleteFacet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteFacetAsync(array $args = [])
|
||||
* @method \Aws\Result deleteObject(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteObjectAsync(array $args = [])
|
||||
* @method \Aws\Result deleteSchema(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteSchemaAsync(array $args = [])
|
||||
* @method \Aws\Result deleteTypedLinkFacet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteTypedLinkFacetAsync(array $args = [])
|
||||
* @method \Aws\Result detachFromIndex(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise detachFromIndexAsync(array $args = [])
|
||||
* @method \Aws\Result detachObject(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise detachObjectAsync(array $args = [])
|
||||
* @method \Aws\Result detachPolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise detachPolicyAsync(array $args = [])
|
||||
* @method \Aws\Result detachTypedLink(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise detachTypedLinkAsync(array $args = [])
|
||||
* @method \Aws\Result disableDirectory(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise disableDirectoryAsync(array $args = [])
|
||||
* @method \Aws\Result enableDirectory(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise enableDirectoryAsync(array $args = [])
|
||||
* @method \Aws\Result getAppliedSchemaVersion(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getAppliedSchemaVersionAsync(array $args = [])
|
||||
* @method \Aws\Result getDirectory(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDirectoryAsync(array $args = [])
|
||||
* @method \Aws\Result getFacet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getFacetAsync(array $args = [])
|
||||
* @method \Aws\Result getObjectInformation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getObjectInformationAsync(array $args = [])
|
||||
* @method \Aws\Result getSchemaAsJson(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getSchemaAsJsonAsync(array $args = [])
|
||||
* @method \Aws\Result getTypedLinkFacetInformation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getTypedLinkFacetInformationAsync(array $args = [])
|
||||
* @method \Aws\Result listAppliedSchemaArns(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listAppliedSchemaArnsAsync(array $args = [])
|
||||
* @method \Aws\Result listAttachedIndices(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listAttachedIndicesAsync(array $args = [])
|
||||
* @method \Aws\Result listDevelopmentSchemaArns(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listDevelopmentSchemaArnsAsync(array $args = [])
|
||||
* @method \Aws\Result listDirectories(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listDirectoriesAsync(array $args = [])
|
||||
* @method \Aws\Result listFacetAttributes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listFacetAttributesAsync(array $args = [])
|
||||
* @method \Aws\Result listFacetNames(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listFacetNamesAsync(array $args = [])
|
||||
* @method \Aws\Result listIncomingTypedLinks(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listIncomingTypedLinksAsync(array $args = [])
|
||||
* @method \Aws\Result listIndex(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listIndexAsync(array $args = [])
|
||||
* @method \Aws\Result listObjectAttributes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listObjectAttributesAsync(array $args = [])
|
||||
* @method \Aws\Result listObjectChildren(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listObjectChildrenAsync(array $args = [])
|
||||
* @method \Aws\Result listObjectParentPaths(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listObjectParentPathsAsync(array $args = [])
|
||||
* @method \Aws\Result listObjectParents(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listObjectParentsAsync(array $args = [])
|
||||
* @method \Aws\Result listObjectPolicies(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listObjectPoliciesAsync(array $args = [])
|
||||
* @method \Aws\Result listOutgoingTypedLinks(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listOutgoingTypedLinksAsync(array $args = [])
|
||||
* @method \Aws\Result listPolicyAttachments(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listPolicyAttachmentsAsync(array $args = [])
|
||||
* @method \Aws\Result listPublishedSchemaArns(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listPublishedSchemaArnsAsync(array $args = [])
|
||||
* @method \Aws\Result listTagsForResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
|
||||
* @method \Aws\Result listTypedLinkFacetAttributes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listTypedLinkFacetAttributesAsync(array $args = [])
|
||||
* @method \Aws\Result listTypedLinkFacetNames(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listTypedLinkFacetNamesAsync(array $args = [])
|
||||
* @method \Aws\Result lookupPolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise lookupPolicyAsync(array $args = [])
|
||||
* @method \Aws\Result publishSchema(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise publishSchemaAsync(array $args = [])
|
||||
* @method \Aws\Result putSchemaFromJson(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise putSchemaFromJsonAsync(array $args = [])
|
||||
* @method \Aws\Result removeFacetFromObject(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise removeFacetFromObjectAsync(array $args = [])
|
||||
* @method \Aws\Result tagResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
|
||||
* @method \Aws\Result untagResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
|
||||
* @method \Aws\Result updateFacet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateFacetAsync(array $args = [])
|
||||
* @method \Aws\Result updateObjectAttributes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateObjectAttributesAsync(array $args = [])
|
||||
* @method \Aws\Result updateSchema(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateSchemaAsync(array $args = [])
|
||||
* @method \Aws\Result updateTypedLinkFacet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateTypedLinkFacetAsync(array $args = [])
|
||||
* @method \Aws\Result upgradeAppliedSchema(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise upgradeAppliedSchemaAsync(array $args = [])
|
||||
* @method \Aws\Result upgradePublishedSchema(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise upgradePublishedSchemaAsync(array $args = [])
|
||||
*/
|
||||
class CloudDirectoryClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudDirectory\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **Amazon CloudDirectory** service.
|
||||
*/
|
||||
class CloudDirectoryException extends AwsException {}
|
|
@ -1,92 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudFormation;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **AWS CloudFormation** service.
|
||||
*
|
||||
* @method \Aws\Result cancelUpdateStack(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise cancelUpdateStackAsync(array $args = [])
|
||||
* @method \Aws\Result continueUpdateRollback(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise continueUpdateRollbackAsync(array $args = [])
|
||||
* @method \Aws\Result createChangeSet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createChangeSetAsync(array $args = [])
|
||||
* @method \Aws\Result createStack(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createStackAsync(array $args = [])
|
||||
* @method \Aws\Result createStackInstances(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createStackInstancesAsync(array $args = [])
|
||||
* @method \Aws\Result createStackSet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createStackSetAsync(array $args = [])
|
||||
* @method \Aws\Result deleteChangeSet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteChangeSetAsync(array $args = [])
|
||||
* @method \Aws\Result deleteStack(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteStackAsync(array $args = [])
|
||||
* @method \Aws\Result deleteStackInstances(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteStackInstancesAsync(array $args = [])
|
||||
* @method \Aws\Result deleteStackSet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteStackSetAsync(array $args = [])
|
||||
* @method \Aws\Result describeAccountLimits(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeAccountLimitsAsync(array $args = [])
|
||||
* @method \Aws\Result describeChangeSet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeChangeSetAsync(array $args = [])
|
||||
* @method \Aws\Result describeStackEvents(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeStackEventsAsync(array $args = [])
|
||||
* @method \Aws\Result describeStackInstance(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeStackInstanceAsync(array $args = [])
|
||||
* @method \Aws\Result describeStackResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeStackResourceAsync(array $args = [])
|
||||
* @method \Aws\Result describeStackResources(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeStackResourcesAsync(array $args = [])
|
||||
* @method \Aws\Result describeStackSet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeStackSetAsync(array $args = [])
|
||||
* @method \Aws\Result describeStackSetOperation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeStackSetOperationAsync(array $args = [])
|
||||
* @method \Aws\Result describeStacks(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeStacksAsync(array $args = [])
|
||||
* @method \Aws\Result estimateTemplateCost(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise estimateTemplateCostAsync(array $args = [])
|
||||
* @method \Aws\Result executeChangeSet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise executeChangeSetAsync(array $args = [])
|
||||
* @method \Aws\Result getStackPolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getStackPolicyAsync(array $args = [])
|
||||
* @method \Aws\Result getTemplate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getTemplateAsync(array $args = [])
|
||||
* @method \Aws\Result getTemplateSummary(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getTemplateSummaryAsync(array $args = [])
|
||||
* @method \Aws\Result listChangeSets(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listChangeSetsAsync(array $args = [])
|
||||
* @method \Aws\Result listExports(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listExportsAsync(array $args = [])
|
||||
* @method \Aws\Result listImports(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listImportsAsync(array $args = [])
|
||||
* @method \Aws\Result listStackInstances(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listStackInstancesAsync(array $args = [])
|
||||
* @method \Aws\Result listStackResources(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listStackResourcesAsync(array $args = [])
|
||||
* @method \Aws\Result listStackSetOperationResults(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listStackSetOperationResultsAsync(array $args = [])
|
||||
* @method \Aws\Result listStackSetOperations(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listStackSetOperationsAsync(array $args = [])
|
||||
* @method \Aws\Result listStackSets(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listStackSetsAsync(array $args = [])
|
||||
* @method \Aws\Result listStacks(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listStacksAsync(array $args = [])
|
||||
* @method \Aws\Result setStackPolicy(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise setStackPolicyAsync(array $args = [])
|
||||
* @method \Aws\Result signalResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise signalResourceAsync(array $args = [])
|
||||
* @method \Aws\Result stopStackSetOperation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise stopStackSetOperationAsync(array $args = [])
|
||||
* @method \Aws\Result updateStack(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateStackAsync(array $args = [])
|
||||
* @method \Aws\Result updateStackInstances(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateStackInstancesAsync(array $args = [])
|
||||
* @method \Aws\Result updateStackSet(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateStackSetAsync(array $args = [])
|
||||
* @method \Aws\Result updateTerminationProtection(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateTerminationProtectionAsync(array $args = [])
|
||||
* @method \Aws\Result validateTemplate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise validateTemplateAsync(array $args = [])
|
||||
*/
|
||||
class CloudFormationClient extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudFormation\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the AWS CloudFormation service.
|
||||
*/
|
||||
class CloudFormationException extends AwsException {}
|
|
@ -1,154 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudFront;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **Amazon CloudFront** service.
|
||||
*
|
||||
* @method \Aws\Result createCloudFrontOriginAccessIdentity(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createCloudFrontOriginAccessIdentityAsync(array $args = [])
|
||||
* @method \Aws\Result createDistribution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createDistributionAsync(array $args = [])
|
||||
* @method \Aws\Result createInvalidation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createInvalidationAsync(array $args = [])
|
||||
* @method \Aws\Result createStreamingDistribution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createStreamingDistributionAsync(array $args = [])
|
||||
* @method \Aws\Result deleteCloudFrontOriginAccessIdentity(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteCloudFrontOriginAccessIdentityAsync(array $args = [])
|
||||
* @method \Aws\Result deleteDistribution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteDistributionAsync(array $args = [])
|
||||
* @method \Aws\Result deleteStreamingDistribution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteStreamingDistributionAsync(array $args = [])
|
||||
* @method \Aws\Result getCloudFrontOriginAccessIdentity(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getCloudFrontOriginAccessIdentityAsync(array $args = [])
|
||||
* @method \Aws\Result getCloudFrontOriginAccessIdentityConfig(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getCloudFrontOriginAccessIdentityConfigAsync(array $args = [])
|
||||
* @method \Aws\Result getDistribution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDistributionAsync(array $args = [])
|
||||
* @method \Aws\Result getDistributionConfig(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getDistributionConfigAsync(array $args = [])
|
||||
* @method \Aws\Result getInvalidation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getInvalidationAsync(array $args = [])
|
||||
* @method \Aws\Result getStreamingDistribution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getStreamingDistributionAsync(array $args = [])
|
||||
* @method \Aws\Result getStreamingDistributionConfig(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getStreamingDistributionConfigAsync(array $args = [])
|
||||
* @method \Aws\Result listCloudFrontOriginAccessIdentities(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listCloudFrontOriginAccessIdentitiesAsync(array $args = [])
|
||||
* @method \Aws\Result listDistributions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listDistributionsAsync(array $args = [])
|
||||
* @method \Aws\Result listDistributionsByWebACLId(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listDistributionsByWebACLIdAsync(array $args = [])
|
||||
* @method \Aws\Result listInvalidations(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listInvalidationsAsync(array $args = [])
|
||||
* @method \Aws\Result listStreamingDistributions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listStreamingDistributionsAsync(array $args = [])
|
||||
* @method \Aws\Result updateCloudFrontOriginAccessIdentity(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateCloudFrontOriginAccessIdentityAsync(array $args = [])
|
||||
* @method \Aws\Result updateDistribution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateDistributionAsync(array $args = [])
|
||||
* @method \Aws\Result updateStreamingDistribution(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateStreamingDistributionAsync(array $args = [])
|
||||
* @method \Aws\Result createDistributionWithTags(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \GuzzleHttp\Promise\Promise createDistributionWithTagsAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \Aws\Result createStreamingDistributionWithTags(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \GuzzleHttp\Promise\Promise createStreamingDistributionWithTagsAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \Aws\Result listTagsForResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \Aws\Result tagResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \Aws\Result untagResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
|
||||
* @method \Aws\Result deleteServiceLinkedRole(array $args = []) (supported in versions 2017-03-25)
|
||||
* @method \GuzzleHttp\Promise\Promise deleteServiceLinkedRoleAsync(array $args = []) (supported in versions 2017-03-25)
|
||||
*/
|
||||
class CloudFrontClient extends AwsClient
|
||||
{
|
||||
/**
|
||||
* Create a signed Amazon CloudFront URL.
|
||||
*
|
||||
* This method accepts an array of configuration options:
|
||||
*
|
||||
* - url: (string) URL of the resource being signed (can include query
|
||||
* string and wildcards). For example: rtmp://s5c39gqb8ow64r.cloudfront.net/videos/mp3_name.mp3
|
||||
* http://d111111abcdef8.cloudfront.net/images/horizon.jpg?size=large&license=yes
|
||||
* - policy: (string) JSON policy. Use this option when creating a signed
|
||||
* URL for a custom policy.
|
||||
* - expires: (int) UTC Unix timestamp used when signing with a canned
|
||||
* policy. Not required when passing a custom 'policy' option.
|
||||
* - key_pair_id: (string) The ID of the key pair used to sign CloudFront
|
||||
* URLs for private distributions.
|
||||
* - private_key: (string) The filepath ot the private key used to sign
|
||||
* CloudFront URLs for private distributions.
|
||||
*
|
||||
* @param array $options Array of configuration options used when signing
|
||||
*
|
||||
* @return string Signed URL with authentication parameters
|
||||
* @throws \InvalidArgumentException if url, key_pair_id, or private_key
|
||||
* were not specified.
|
||||
* @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WorkingWithStreamingDistributions.html
|
||||
*/
|
||||
public function getSignedUrl(array $options)
|
||||
{
|
||||
foreach (['url', 'key_pair_id', 'private_key'] as $required) {
|
||||
if (!isset($options[$required])) {
|
||||
throw new \InvalidArgumentException("$required is required");
|
||||
}
|
||||
}
|
||||
|
||||
$urlSigner = new UrlSigner(
|
||||
$options['key_pair_id'],
|
||||
$options['private_key']
|
||||
);
|
||||
|
||||
return $urlSigner->getSignedUrl(
|
||||
$options['url'],
|
||||
isset($options['expires']) ? $options['expires'] : null,
|
||||
isset($options['policy']) ? $options['policy'] : null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a signed Amazon CloudFront cookie.
|
||||
*
|
||||
* This method accepts an array of configuration options:
|
||||
*
|
||||
* - url: (string) URL of the resource being signed (can include query
|
||||
* string and wildcards). For example: http://d111111abcdef8.cloudfront.net/images/horizon.jpg?size=large&license=yes
|
||||
* - policy: (string) JSON policy. Use this option when creating a signed
|
||||
* URL for a custom policy.
|
||||
* - expires: (int) UTC Unix timestamp used when signing with a canned
|
||||
* policy. Not required when passing a custom 'policy' option.
|
||||
* - key_pair_id: (string) The ID of the key pair used to sign CloudFront
|
||||
* URLs for private distributions.
|
||||
* - private_key: (string) The filepath ot the private key used to sign
|
||||
* CloudFront URLs for private distributions.
|
||||
*
|
||||
* @param array $options Array of configuration options used when signing
|
||||
*
|
||||
* @return array Key => value pairs of signed cookies to set
|
||||
* @throws \InvalidArgumentException if url, key_pair_id, or private_key
|
||||
* were not specified.
|
||||
* @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WorkingWithStreamingDistributions.html
|
||||
*/
|
||||
public function getSignedCookie(array $options)
|
||||
{
|
||||
foreach (['key_pair_id', 'private_key'] as $required) {
|
||||
if (!isset($options[$required])) {
|
||||
throw new \InvalidArgumentException("$required is required");
|
||||
}
|
||||
}
|
||||
|
||||
$cookieSigner = new CookieSigner(
|
||||
$options['key_pair_id'],
|
||||
$options['private_key']
|
||||
);
|
||||
|
||||
return $cookieSigner->getSignedCookie(
|
||||
isset($options['url']) ? $options['url'] : null,
|
||||
isset($options['expires']) ? $options['expires'] : null,
|
||||
isset($options['policy']) ? $options['policy'] : null
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudFront;
|
||||
|
||||
class CookieSigner
|
||||
{
|
||||
/** @var Signer */
|
||||
private $signer;
|
||||
|
||||
private static $schemes = [
|
||||
'http' => true,
|
||||
'https' => true,
|
||||
];
|
||||
|
||||
/**
|
||||
* @param $keyPairId string ID of the key pair
|
||||
* @param $privateKey string Path to the private key used for signing
|
||||
*
|
||||
* @throws \RuntimeException if the openssl extension is missing
|
||||
* @throws \InvalidArgumentException if the private key cannot be found.
|
||||
*/
|
||||
public function __construct($keyPairId, $privateKey)
|
||||
{
|
||||
$this->signer = new Signer($keyPairId, $privateKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a signed Amazon CloudFront Cookie.
|
||||
*
|
||||
* @param string $url URL to sign (can include query string
|
||||
* and wildcards). Not required
|
||||
* when passing a custom $policy.
|
||||
* @param string|integer|null $expires UTC Unix timestamp used when signing
|
||||
* with a canned policy. Not required
|
||||
* when passing a custom $policy.
|
||||
* @param string $policy JSON policy. Use this option when
|
||||
* creating a signed cookie for a custom
|
||||
* policy.
|
||||
*
|
||||
* @return array The authenticated cookie parameters
|
||||
* @throws \InvalidArgumentException if the URL provided is invalid
|
||||
* @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html
|
||||
*/
|
||||
public function getSignedCookie($url = null, $expires = null, $policy = null)
|
||||
{
|
||||
if ($url) {
|
||||
$this->validateUrl($url);
|
||||
}
|
||||
|
||||
$cookieParameters = [];
|
||||
$signature = $this->signer->getSignature($url, $expires, $policy);
|
||||
foreach ($signature as $key => $value) {
|
||||
$cookieParameters["CloudFront-$key"] = $value;
|
||||
}
|
||||
|
||||
return $cookieParameters;
|
||||
}
|
||||
|
||||
private function validateUrl($url)
|
||||
{
|
||||
$scheme = str_replace('*', '', explode('://', $url)[0]);
|
||||
if (empty(self::$schemes[strtolower($scheme)])) {
|
||||
throw new \InvalidArgumentException('Invalid or missing URI scheme');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the Amazon CloudFront service.
|
||||
*/
|
||||
class CloudFrontException extends AwsException {}
|
|
@ -1,108 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudFront;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class Signer
|
||||
{
|
||||
private $keyPairId;
|
||||
private $pk;
|
||||
|
||||
/**
|
||||
* A signer for creating the signature values used in CloudFront signed URLs
|
||||
* and signed cookies.
|
||||
*
|
||||
* @param $keyPairId string ID of the key pair
|
||||
* @param $privateKey string Path to the private key used for signing
|
||||
*
|
||||
* @throws \RuntimeException if the openssl extension is missing
|
||||
* @throws \InvalidArgumentException if the private key cannot be found.
|
||||
*/
|
||||
public function __construct($keyPairId, $privateKey)
|
||||
{
|
||||
if (!extension_loaded('openssl')) {
|
||||
//@codeCoverageIgnoreStart
|
||||
throw new \RuntimeException('The openssl extension is required to '
|
||||
. 'sign CloudFront urls.');
|
||||
//@codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
$this->keyPairId = $keyPairId;
|
||||
|
||||
if (!file_exists($privateKey)) {
|
||||
throw new \InvalidArgumentException("PK file not found: $privateKey");
|
||||
}
|
||||
|
||||
$this->pk = file_get_contents($privateKey);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create the values used to construct signed URLs and cookies.
|
||||
*
|
||||
* @param string $resource The CloudFront resource to which
|
||||
* this signature will grant access.
|
||||
* Not used when a custom policy is
|
||||
* provided.
|
||||
* @param string|integer|null $expires UTC Unix timestamp used when
|
||||
* signing with a canned policy.
|
||||
* Not required when passing a
|
||||
* custom $policy.
|
||||
* @param string $policy JSON policy. Use this option when
|
||||
* creating a signature for a custom
|
||||
* policy.
|
||||
*
|
||||
* @return array The values needed to construct a signed URL or cookie
|
||||
* @throws \InvalidArgumentException when not provided either a policy or a
|
||||
* resource and a expires
|
||||
*
|
||||
* @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html
|
||||
*/
|
||||
public function getSignature($resource = null, $expires = null, $policy = null)
|
||||
{
|
||||
$signatureHash = [];
|
||||
if ($policy) {
|
||||
$policy = preg_replace('/\s/s', '', $policy);
|
||||
$signatureHash['Policy'] = $this->encode($policy);
|
||||
} elseif ($resource && $expires) {
|
||||
$policy = $this->createCannedPolicy($resource, $expires);
|
||||
$signatureHash['Expires'] = $expires;
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Either a policy or a resource'
|
||||
. ' and an expiration time must be provided.');
|
||||
}
|
||||
|
||||
$signatureHash['Signature'] = $this->encode($this->sign($policy));
|
||||
$signatureHash['Key-Pair-Id'] = $this->keyPairId;
|
||||
|
||||
return $signatureHash;
|
||||
}
|
||||
|
||||
private function createCannedPolicy($resource, $expiration)
|
||||
{
|
||||
return json_encode([
|
||||
'Statement' => [
|
||||
[
|
||||
'Resource' => $resource,
|
||||
'Condition' => [
|
||||
'DateLessThan' => ['AWS:EpochTime' => $expiration],
|
||||
],
|
||||
],
|
||||
],
|
||||
], JSON_UNESCAPED_SLASHES);
|
||||
}
|
||||
|
||||
private function sign($policy)
|
||||
{
|
||||
$signature = '';
|
||||
openssl_sign($policy, $signature, $this->pk);
|
||||
|
||||
return $signature;
|
||||
}
|
||||
|
||||
private function encode($policy)
|
||||
{
|
||||
return strtr(base64_encode($policy), '+=/', '-_~');
|
||||
}
|
||||
}
|
|
@ -1,119 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudFront;
|
||||
|
||||
use GuzzleHttp\Psr7;
|
||||
use GuzzleHttp\Psr7\Uri;
|
||||
use Psr\Http\Message\UriInterface;
|
||||
|
||||
/**
|
||||
* Creates signed URLs for Amazon CloudFront resources.
|
||||
*/
|
||||
class UrlSigner
|
||||
{
|
||||
private $signer;
|
||||
|
||||
/**
|
||||
* @param $keyPairId string ID of the key pair
|
||||
* @param $privateKey string Path to the private key used for signing
|
||||
*
|
||||
* @throws \RuntimeException if the openssl extension is missing
|
||||
* @throws \InvalidArgumentException if the private key cannot be found.
|
||||
*/
|
||||
public function __construct($keyPairId, $privateKey)
|
||||
{
|
||||
$this->signer = new Signer($keyPairId, $privateKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a signed Amazon CloudFront URL.
|
||||
*
|
||||
* Keep in mind that URLs meant for use in media/flash players may have
|
||||
* different requirements for URL formats (e.g. some require that the
|
||||
* extension be removed, some require the file name to be prefixed
|
||||
* - mp4:<path>, some require you to add "/cfx/st" into your URL).
|
||||
*
|
||||
* @param string $url URL to sign (can include query
|
||||
* string string and wildcards)
|
||||
* @param string|integer|null $expires UTC Unix timestamp used when signing
|
||||
* with a canned policy. Not required
|
||||
* when passing a custom $policy.
|
||||
* @param string $policy JSON policy. Use this option when
|
||||
* creating a signed URL for a custom
|
||||
* policy.
|
||||
*
|
||||
* @return string The file URL with authentication parameters
|
||||
* @throws \InvalidArgumentException if the URL provided is invalid
|
||||
* @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WorkingWithStreamingDistributions.html
|
||||
*/
|
||||
public function getSignedUrl($url, $expires = null, $policy = null)
|
||||
{
|
||||
// Determine the scheme of the url
|
||||
$urlSections = explode('://', $url);
|
||||
|
||||
if (count($urlSections) < 2) {
|
||||
throw new \InvalidArgumentException("Invalid URL: {$url}");
|
||||
}
|
||||
|
||||
// Get the real scheme by removing wildcards from the scheme
|
||||
$scheme = str_replace('*', '', $urlSections[0]);
|
||||
$uri = new Uri($scheme . '://' . $urlSections[1]);
|
||||
$query = Psr7\parse_query($uri->getQuery(), PHP_QUERY_RFC3986);
|
||||
$signature = $this->signer->getSignature(
|
||||
$this->createResource($scheme, (string) $uri),
|
||||
$expires,
|
||||
$policy
|
||||
);
|
||||
$uri = $uri->withQuery(
|
||||
http_build_query($query + $signature, null, '&', PHP_QUERY_RFC3986)
|
||||
);
|
||||
|
||||
return $scheme === 'rtmp'
|
||||
? $this->createRtmpUrl($uri)
|
||||
: (string) $uri;
|
||||
}
|
||||
|
||||
private function createRtmpUrl(UriInterface $uri)
|
||||
{
|
||||
// Use a relative URL when creating Flash player URLs
|
||||
$result = ltrim($uri->getPath(), '/');
|
||||
|
||||
if ($query = $uri->getQuery()) {
|
||||
$result .= '?' . $query;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $scheme
|
||||
* @param $url
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function createResource($scheme, $url)
|
||||
{
|
||||
switch ($scheme) {
|
||||
case 'http':
|
||||
case 'http*':
|
||||
case 'https':
|
||||
return $url;
|
||||
case 'rtmp':
|
||||
$parts = parse_url($url);
|
||||
$pathParts = pathinfo($parts['path']);
|
||||
$resource = ltrim(
|
||||
$pathParts['dirname'] . '/' . $pathParts['basename'],
|
||||
'/'
|
||||
);
|
||||
|
||||
// Add a query string if present.
|
||||
if (isset($parts['query'])) {
|
||||
$resource .= "?{$parts['query']}";
|
||||
}
|
||||
|
||||
return $resource;
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException("Invalid URI scheme: {$scheme}. "
|
||||
. "Scheme must be one of: http, https, or rtmp");
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudHSMV2;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **AWS CloudHSM V2** service.
|
||||
* @method \Aws\Result createCluster(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createClusterAsync(array $args = [])
|
||||
* @method \Aws\Result createHsm(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createHsmAsync(array $args = [])
|
||||
* @method \Aws\Result deleteCluster(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteClusterAsync(array $args = [])
|
||||
* @method \Aws\Result deleteHsm(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteHsmAsync(array $args = [])
|
||||
* @method \Aws\Result describeBackups(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeBackupsAsync(array $args = [])
|
||||
* @method \Aws\Result describeClusters(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeClustersAsync(array $args = [])
|
||||
* @method \Aws\Result initializeCluster(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise initializeClusterAsync(array $args = [])
|
||||
* @method \Aws\Result listTags(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = [])
|
||||
* @method \Aws\Result tagResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
|
||||
* @method \Aws\Result untagResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
|
||||
*/
|
||||
class CloudHSMV2Client extends AwsClient {}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudHSMV2\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* Represents an error interacting with the **AWS CloudHSM V2** service.
|
||||
*/
|
||||
class CloudHSMV2Exception extends AwsException {}
|
|
@ -1,84 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudHsm;
|
||||
|
||||
use Aws\Api\ApiProvider;
|
||||
use Aws\Api\DocModel;
|
||||
use Aws\Api\Service;
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with **AWS CloudHSM**.
|
||||
*
|
||||
* @method \Aws\Result addTagsToResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise addTagsToResourceAsync(array $args = [])
|
||||
* @method \Aws\Result createHapg(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createHapgAsync(array $args = [])
|
||||
* @method \Aws\Result createHsm(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createHsmAsync(array $args = [])
|
||||
* @method \Aws\Result createLunaClient(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createLunaClientAsync(array $args = [])
|
||||
* @method \Aws\Result deleteHapg(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteHapgAsync(array $args = [])
|
||||
* @method \Aws\Result deleteHsm(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteHsmAsync(array $args = [])
|
||||
* @method \Aws\Result deleteLunaClient(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteLunaClientAsync(array $args = [])
|
||||
* @method \Aws\Result describeHapg(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeHapgAsync(array $args = [])
|
||||
* @method \Aws\Result describeHsm(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeHsmAsync(array $args = [])
|
||||
* @method \Aws\Result describeLunaClient(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeLunaClientAsync(array $args = [])
|
||||
* @method \Aws\Result getConfig(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise getConfigAsync(array $args = [])
|
||||
* @method \Aws\Result listAvailableZones(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listAvailableZonesAsync(array $args = [])
|
||||
* @method \Aws\Result listHapgs(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listHapgsAsync(array $args = [])
|
||||
* @method \Aws\Result listHsms(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listHsmsAsync(array $args = [])
|
||||
* @method \Aws\Result listLunaClients(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listLunaClientsAsync(array $args = [])
|
||||
* @method \Aws\Result listTagsForResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
|
||||
* @method \Aws\Result modifyHapg(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise modifyHapgAsync(array $args = [])
|
||||
* @method \Aws\Result modifyHsm(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise modifyHsmAsync(array $args = [])
|
||||
* @method \Aws\Result modifyLunaClient(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise modifyLunaClientAsync(array $args = [])
|
||||
* @method \Aws\Result removeTagsFromResource(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise removeTagsFromResourceAsync(array $args = [])
|
||||
*/
|
||||
class CloudHsmClient extends AwsClient
|
||||
{
|
||||
public function __call($name, array $args)
|
||||
{
|
||||
// Overcomes a naming collision with `AwsClient::getConfig`.
|
||||
if (lcfirst($name) === 'getConfigFiles') {
|
||||
$name = 'GetConfig';
|
||||
} elseif (lcfirst($name) === 'getConfigFilesAsync') {
|
||||
$name = 'GetConfigAsync';
|
||||
}
|
||||
|
||||
return parent::__call($name, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public static function applyDocFilters(array $api, array $docs)
|
||||
{
|
||||
// Overcomes a naming collision with `AwsClient::getConfig`.
|
||||
$api['operations']['GetConfigFiles'] = $api['operations']['GetConfig'];
|
||||
$docs['operations']['GetConfigFiles'] = $docs['operations']['GetConfig'];
|
||||
unset($api['operations']['GetConfig'], $docs['operations']['GetConfig']);
|
||||
ksort($api['operations']);
|
||||
|
||||
return [
|
||||
new Service($api, ApiProvider::defaultProvider()),
|
||||
new DocModel($docs)
|
||||
];
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudHsm\Exception;
|
||||
|
||||
use Aws\Exception\AwsException;
|
||||
|
||||
/**
|
||||
* AWS CloudHSM exception.
|
||||
*/
|
||||
class CloudHsmException extends AwsException {}
|
|
@ -1,58 +0,0 @@
|
|||
<?php
|
||||
namespace Aws\CloudSearch;
|
||||
|
||||
use Aws\AwsClient;
|
||||
|
||||
/**
|
||||
* This client is used to interact with the **Amazon CloudSearch** service.
|
||||
*
|
||||
* @method \Aws\Result buildSuggesters(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise buildSuggestersAsync(array $args = [])
|
||||
* @method \Aws\Result createDomain(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createDomainAsync(array $args = [])
|
||||
* @method \Aws\Result defineAnalysisScheme(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise defineAnalysisSchemeAsync(array $args = [])
|
||||
* @method \Aws\Result defineExpression(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise defineExpressionAsync(array $args = [])
|
||||
* @method \Aws\Result defineIndexField(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise defineIndexFieldAsync(array $args = [])
|
||||
* @method \Aws\Result defineSuggester(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise defineSuggesterAsync(array $args = [])
|
||||
* @method \Aws\Result deleteAnalysisScheme(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteAnalysisSchemeAsync(array $args = [])
|
||||
* @method \Aws\Result deleteDomain(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteDomainAsync(array $args = [])
|
||||
* @method \Aws\Result deleteExpression(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteExpressionAsync(array $args = [])
|
||||
* @method \Aws\Result deleteIndexField(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteIndexFieldAsync(array $args = [])
|
||||
* @method \Aws\Result deleteSuggester(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteSuggesterAsync(array $args = [])
|
||||
* @method \Aws\Result describeAnalysisSchemes(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeAnalysisSchemesAsync(array $args = [])
|
||||
* @method \Aws\Result describeAvailabilityOptions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeAvailabilityOptionsAsync(array $args = [])
|
||||
* @method \Aws\Result describeDomains(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeDomainsAsync(array $args = [])
|
||||
* @method \Aws\Result describeExpressions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeExpressionsAsync(array $args = [])
|
||||
* @method \Aws\Result describeIndexFields(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeIndexFieldsAsync(array $args = [])
|
||||
* @method \Aws\Result describeScalingParameters(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeScalingParametersAsync(array $args = [])
|
||||
* @method \Aws\Result describeServiceAccessPolicies(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeServiceAccessPoliciesAsync(array $args = [])
|
||||
* @method \Aws\Result describeSuggesters(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise describeSuggestersAsync(array $args = [])
|
||||
* @method \Aws\Result indexDocuments(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise indexDocumentsAsync(array $args = [])
|
||||
* @method \Aws\Result listDomainNames(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise listDomainNamesAsync(array $args = [])
|
||||
* @method \Aws\Result updateAvailabilityOptions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateAvailabilityOptionsAsync(array $args = [])
|
||||
* @method \Aws\Result updateScalingParameters(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateScalingParametersAsync(array $args = [])
|
||||
* @method \Aws\Result updateServiceAccessPolicies(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateServiceAccessPoliciesAsync(array $args = [])
|
||||
*/
|
||||
class CloudSearchClient extends AwsClient {}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue