|
74 | 74 | RESERVED_WORDS = ['and', 'assert', 'break', 'class', 'continue', 'def', 'del', |
75 | 75 | 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', |
76 | 76 | 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', |
77 | | - 'pass', 'print', 'raise', 'return', 'try', 'while' ] |
| 77 | + 'pass', 'print', 'raise', 'return', 'try', 'while', 'body'] |
78 | 78 |
|
79 | 79 |
|
80 | 80 | def fix_method_name(name): |
@@ -396,7 +396,9 @@ def createMethod(theclass, methodName, methodDesc, rootDesc): |
396 | 396 | methodDesc['parameters']['body']['type'] = 'object' |
397 | 397 | if 'mediaUpload' in methodDesc: |
398 | 398 | methodDesc['parameters']['media_body'] = { |
399 | | - 'description': 'The filename of the media request body.', |
| 399 | + 'description': |
| 400 | + 'The filename of the media request body, or an instance of a ' |
| 401 | + 'MediaUpload object.', |
400 | 402 | 'type': 'string', |
401 | 403 | 'required': False, |
402 | 404 | } |
@@ -596,9 +598,20 @@ def method(self, **kwargs): |
596 | 598 |
|
597 | 599 | # Skip undocumented params and params common to all methods. |
598 | 600 | skip_parameters = rootDesc.get('parameters', {}).keys() |
599 | | - skip_parameters.append(STACK_QUERY_PARAMETERS) |
| 601 | + skip_parameters.extend(STACK_QUERY_PARAMETERS) |
600 | 602 |
|
601 | | - for arg in argmap.iterkeys(): |
| 603 | + all_args = argmap.keys() |
| 604 | + args_ordered = [key2param(s) for s in methodDesc.get('parameterOrder', [])] |
| 605 | + |
| 606 | + # Move body to the front of the line. |
| 607 | + if 'body' in all_args: |
| 608 | + args_ordered.append('body') |
| 609 | + |
| 610 | + for name in all_args: |
| 611 | + if name not in args_ordered: |
| 612 | + args_ordered.append(name) |
| 613 | + |
| 614 | + for arg in args_ordered: |
602 | 615 | if arg in skip_parameters: |
603 | 616 | continue |
604 | 617 |
|
@@ -653,13 +666,13 @@ def createNextMethod(theclass, methodName, methodDesc, rootDesc): |
653 | 666 | def methodNext(self, previous_request, previous_response): |
654 | 667 | """Retrieves the next page of results. |
655 | 668 |
|
656 | | - Args: |
657 | | - previous_request: The request for the previous page. |
658 | | - previous_response: The response from the request for the previous page. |
| 669 | +Args: |
| 670 | + previous_request: The request for the previous page. (required) |
| 671 | + previous_response: The response from the request for the previous page. (required) |
659 | 672 |
|
660 | | - Returns: |
661 | | - A request object that you can call 'execute()' on to request the next |
662 | | - page. Returns None if there are no more items in the collection. |
| 673 | +Returns: |
| 674 | + A request object that you can call 'execute()' on to request the next |
| 675 | + page. Returns None if there are no more items in the collection. |
663 | 676 | """ |
664 | 677 | # Retrieve nextPageToken from previous_response |
665 | 678 | # Use as pageToken in previous_request to create new request. |
|
0 commit comments