Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

fix-parameter-conflict-issue-for-msgraph #791

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/generate/CodeModelAzImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,9 @@ export class CodeModelCliImpl implements CodeModelAz {
}
if (
nameParamReference.has(paramFlattenedName) &&
nameParamReference.get(paramFlattenedName).schema !==
param.schema
nameParamReference.get(paramFlattenedName)[
'targetProperty'
] !== param['targetPropert']
) {
let tmpName = paramFlattenedName;
const preParam = nameParamReference.get(
Expand Down
6 changes: 5 additions & 1 deletion test/scenarios/msgraphuser/input/Users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4120,6 +4120,10 @@ components:
$ref: '#/components/schemas/microsoft.graph.userSettings'
onenote:
$ref: '#/components/schemas/microsoft.graph.onenote'
conditions:
$ref: '#/components/schemas/microsoft.graph.messageRulePredicates'
exceptions:
$ref: '#/components/schemas/microsoft.graph.messageRulePredicates'
activities:
type: array
items:
Expand All @@ -4135,7 +4139,7 @@ components:
$ref: '#/components/schemas/microsoft.graph.team'
additionalProperties:
type: object
description: Represents an Azure Active Directory user object.
description: Represents an Azure Active Directory user object
microsoft.graph.directoryObject:
allOf:
- $ref: '#/components/schemas/microsoft.graph.entity'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,24 @@

Multiple actions can be specified by using more than one --device-management-troubleshooting-events \
argument.
- name: --within-size-range
short-summary: "sizeRange"
long-summary: |
Usage: --within-size-range maximum-size=XX minimum-size=XX

maximum-size: The maximum size (in kilobytes) that an incoming message must have in order for a condition \
or exception to apply.
minimum-size: The minimum size (in kilobytes) that an incoming message must have in order for a condition \
or exception to apply.
- name: --microsoft-graph-size-range-within-size-range
short-summary: "sizeRange"
long-summary: |
Usage: --microsoft-graph-size-range-within-size-range maximum-size=XX minimum-size=XX

maximum-size: The maximum size (in kilobytes) that an incoming message must have in order for a condition \
or exception to apply.
minimum-size: The minimum size (in kilobytes) that an incoming message must have in order for a condition \
or exception to apply.
- name: --resources
short-summary: "The image and other file resources in OneNote pages. Getting a resources collection is not \
supported, but you can get the binary content of a specific resource. Read-only. Nullable."
Expand Down Expand Up @@ -621,6 +639,24 @@

Multiple actions can be specified by using more than one --device-management-troubleshooting-events \
argument.
- name: --within-size-range
short-summary: "sizeRange"
long-summary: |
Usage: --within-size-range maximum-size=XX minimum-size=XX

maximum-size: The maximum size (in kilobytes) that an incoming message must have in order for a condition \
or exception to apply.
minimum-size: The minimum size (in kilobytes) that an incoming message must have in order for a condition \
or exception to apply.
- name: --microsoft-graph-size-range-within-size-range
short-summary: "sizeRange"
long-summary: |
Usage: --microsoft-graph-size-range-within-size-range maximum-size=XX minimum-size=XX

maximum-size: The maximum size (in kilobytes) that an incoming message must have in order for a condition \
or exception to apply.
minimum-size: The minimum size (in kilobytes) that an incoming message must have in order for a condition \
or exception to apply.
- name: --resources
short-summary: "The image and other file resources in OneNote pages. Getting a resources collection is not \
supported, but you can get the binary content of a specific resource. Read-only. Nullable."
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,33 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use
return d


class AddWithinSizeRange(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.within_size_range = action

def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'maximum-size':
d['maximum_size'] = v[0]
elif kl == 'minimum-size':
d['minimum_size'] = v[0]
else:
raise CLIError('Unsupported Key {} is provided for parameter within_size_range. All possible keys are: '
'maximum-size, minimum-size'.format(k))
return d


class AddResources(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
Expand Down
Loading