Merge pull request #9 from Microsoft/gijeyaku/MicrosoftGraphGroupsSample

Added sample Microsoft Graph - Office365Groups connector
This commit is contained in:
gijeyaku 2019-04-01 17:10:49 -07:00 коммит произвёл GitHub
Родитель 8c00907e1c c0f289d0a8
Коммит bd74702491
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 473 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,439 @@
{
"basePath": "/",
"host": "graph.microsoft.com",
"info": {
"description": "A sample Office 365 Groups connector for using with the CLI.",
"title": "Office 365 Groups",
"version": "1.0.0"
},
"consumes": [],
"definitions": {
"CreateGroupRequest": {
"properties": {
"displayName": {
"description": "O365 group name.",
"type": "string",
"x-ms-summary": "Name"
},
"groupTypes": {
"description": "Choose Unified for Office 365 and DynamicMembership for Dynamic group. Leave blank for other types. ",
"items": {
"enum": [
"Unified",
"DynamicMembership"
],
"type": "string"
},
"type": "array",
"x-ms-summary": "Group Type",
"x-ms-visibility": "advanced"
},
"mailEnabled": {
"description": "True if mail is enabled for the group.",
"type": "boolean",
"x-ms-summary": "Mail Enabled"
},
"mailNickname": {
"description": "Group nickname.",
"type": "string",
"x-ms-summary": "Nickname"
},
"securityEnabled": {
"description": "True if the owner is security enabled.",
"type": "boolean",
"x-ms-summary": "Security Enabled"
}
},
"required": [
"displayName",
"mailEnabled",
"mailNickname",
"securityEnabled"
],
"type": "object"
},
"Group": {
"properties": {
"classification": {
"description": "O365 group classification.",
"type": "string",
"x-ms-summary": "Classification",
"x-ms-visibility": "advanced"
},
"createdDateTime": {
"description": "yyyy-MM-ddTHH:mm:ss.fffZ (UTC format)",
"format": "date-time",
"type": "string",
"x-ms-summary": "Created Date-Time",
"x-ms-visibility": "advanced"
},
"description": {
"description": "More information about the group.",
"type": "string",
"x-ms-summary": "Description"
},
"displayName": {
"description": "O365 group name.",
"type": "string",
"x-ms-summary": "Name"
},
"id": {
"description": "Unique identifier of the group.",
"type": "string",
"x-ms-summary": "Group Id",
"x-ms-visibility": "advanced"
},
"mail": {
"description": "Email address of the group.",
"type": "string",
"x-ms-summary": "Email"
},
"mailEnabled": {
"description": "True if mail is enabled for the group.",
"type": "boolean",
"x-ms-summary": "Mail Enabled",
"x-ms-visibility": "advanced"
},
"mailNickname": {
"description": "Group nickname.",
"type": "string",
"x-ms-summary": "Nickname",
"x-ms-visibility": "advanced"
},
"onPremisesLastSyncDateTime": {
"description": "yyyy-MM-ddTHH:mm:ss.fffZ (UTC format)",
"format": "date-time",
"type": "string",
"x-ms-summary": "On-Premises Last Sync Date-Time",
"x-ms-visibility": "advanced"
},
"onPremisesSecurityIdentifier": {
"description": "The on-premises security identifier.",
"type": "string",
"x-ms-summary": "On-Premises Security Identifier",
"x-ms-visibility": "advanced"
},
"onPremisesSyncEnabled": {
"description": "True if on-premises sync is enabled for the group.",
"type": "boolean",
"x-ms-summary": "On-Premises Sync Enabled",
"x-ms-visibility": "advanced"
},
"renewedDateTime": {
"description": "yyyy-MM-ddTHH:mm:ss.fffZ (UTC format)",
"format": "date-time",
"type": "string",
"x-ms-summary": "Renewed Date-Time",
"x-ms-visibility": "advanced"
},
"securityEnabled": {
"description": "True if the owner is security enabled.",
"type": "boolean",
"x-ms-summary": "Security Enabled",
"x-ms-visibility": "advanced"
},
"visibility": {
"description": "The owner's visibility.",
"type": "string",
"x-ms-summary": "Visibility",
"x-ms-visibility": "advanced"
}
},
"type": "object"
},
"ListGroupMembersResponse": {
"properties": {
"value": {
"description": "value",
"items": {
"properties": {
"displayName": {
"description": "User's display name.",
"type": "string",
"x-ms-summary": "Display Name"
},
"givenName": {
"description": "User's first name.",
"type": "string",
"x-ms-summary": "Given Name"
},
"id": {
"description": "Unique id of the user.",
"type": "string",
"x-ms-summary": "User Id",
"x-ms-visibility": "advanced"
},
"jobTitle": {
"description": "User's job title.",
"type": "string",
"x-ms-summary": "Job Title"
},
"mail": {
"description": "User's email address.",
"type": "string",
"x-ms-summary": "Mail"
},
"mobilePhone": {
"description": "User's mobile number.",
"type": "string",
"x-ms-summary": "Mobile Phone",
"x-ms-visibility": "advanced"
},
"officeLocation": {
"description": "User's office address.",
"type": "string",
"x-ms-summary": "Office Location",
"x-ms-visibility": "advanced"
},
"surname": {
"description": "User's last name.",
"type": "string",
"x-ms-summary": "Surname"
},
"userPrincipalName": {
"description": "UPN id of the user.",
"type": "string",
"x-ms-summary": "User Principal Name",
"x-ms-visibility": "advanced"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"ListGroupsResponse": {
"properties": {
"@odata.context": {
"description": "The OData context.",
"type": "string",
"x-ms-summary": "OData context",
"x-ms-visibility": "internal"
},
"value": {
"description": "value",
"items": {
"$ref": "#/definitions/Group"
},
"type": "array"
}
},
"type": "object"
}
},
"parameters": {
"groupId__in_path": {
"description": "Enter group id.",
"format": "guid",
"in": "path",
"name": "groupId",
"required": true,
"type": "string",
"x-ms-summary": "Group Id",
"x-ms-visibility": "important"
},
"userId__in_path": {
"description": "Enter user id.",
"format": "guid",
"in": "path",
"name": "userId",
"required": true,
"type": "string",
"x-ms-summary": "User Id",
"x-ms-visibility": "important"
}
},
"paths": {
"/v1.0/groups": {
"get": {
"description": "This operation returns a list all the groups available in an organization, including but not limited to Office 365 Groups.",
"operationId": "ListGroups",
"parameters": [],
"responses": {
"200": {
"description": "Operation Successful",
"schema": {
"$ref": "#/definitions/ListGroupsResponse"
}
}
},
"summary": "List all groups",
"x-ms-visibility": "important"
},
"post": {
"description": "This operation creates a new group.",
"operationId": "CreateGroup",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CreateGroupRequest"
}
}
],
"responses": {
"201": {
"description": "Operation Successful",
"schema": {
"$ref": "#/definitions/Group"
}
}
},
"summary": "Create group",
"x-ms-visibility": "important"
}
},
"/v1.0/groups/{groupId}": {
"delete": {
"description": "This operation deletes a group.",
"operationId": "DeleteGroup",
"parameters": [
{
"$ref": "#/parameters/groupId__in_path"
}
],
"responses": {
"204": {
"description": "Operation Successful",
"schema": {}
}
},
"summary": "Delete group",
"x-ms-visibility": "important"
}
},
"/v1.0/groups/{groupId}/members": {
"get": {
"description": "This operation returns a list of all members in the given group and their details such as name, title, email, etc.",
"operationId": "ListGroupMembers",
"parameters": [
{
"$ref": "#/parameters/groupId__in_path"
}
],
"responses": {
"200": {
"description": "Operation Successful",
"schema": {
"$ref": "#/definitions/ListGroupMembersResponse"
}
}
},
"summary": "List group members",
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
},
"x-ms-visibility": "important"
}
},
"/v1.0/groups/{groupId}/members/$ref": {
"post": {
"description": "This operation adds you as a member to a group",
"operationId": "JoinGroup",
"parameters": [
{
"$ref": "#/parameters/groupId__in_path"
},
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"@odata.id": {
"default": "https://graph.microsoft.com/v1.0/me",
"description": "JSON representation of user object to be added.",
"type": "string",
"x-ms-summary": "User object",
"x-ms-visibility": "internal"
}
},
"required": [
"@odata.id"
],
"type": "object"
}
}
],
"responses": {
"204": {
"description": "Operation Successful",
"schema": {}
}
},
"summary": "Join group",
"x-ms-visibility": "important"
}
},
"/v1.0/groups/{groupId}/members/{userId}/$ref": {
"delete": {
"description": "This operation removes a member from a group.",
"operationId": "RemoveMemberFromGroup",
"parameters": [
{
"$ref": "#/parameters/groupId__in_path"
},
{
"$ref": "#/parameters/userId__in_path"
}
],
"responses": {
"204": {
"description": "Operation Successful",
"schema": {}
}
},
"summary": "Remove member from group",
"x-ms-visibility": "important"
}
},
"/v1.0/me/memberOf": {
"get": {
"description": "This operation returns a list of all groups that you are a member of.",
"operationId": "ListJoinedGroups",
"parameters": [],
"responses": {
"200": {
"description": "Operation Successful",
"schema": {
"$ref": "#/definitions/ListGroupsResponse"
}
}
},
"summary": "List groups that I am a member of",
"x-ms-visibility": "important"
}
}
},
"produces": [
"application/json"
],
"responses": {},
"schemes": [
"https"
],
"security": [
{
"oauth2_auth": [
"Group.ReadWrite.All offline_access"
]
}
],
"securityDefinitions": {
"oauth2_auth": {
"authorizationUrl": "https://login.windows.net/common/oauth2/authorize",
"flow": "accessCode",
"scopes": {
"Group.ReadWrite.All offline_access": "Group.ReadWrite.All offline_access"
},
"tokenUrl": "https://login.windows.net/common/oauth2/authorize",
"type": "oauth2"
}
},
"swagger": "2.0",
"tags": []
}

Просмотреть файл

@ -0,0 +1,34 @@
{
"properties": {
"capabilities": [],
"connectionParameters": {
"token": {
"oAuthSettings": {
"clientId": "{AAD App ClientId}",
"customParameters": {
"loginUri": {
"value": "https://login.windows.net"
},
"resourceUri": {
"value": "https://graph.microsoft.com"
},
"tenantId": {
"value": "common"
}
},
"identityProvider": "aad",
"properties": {
"IsFirstParty": "False"
},
"redirectMode": "Global",
"redirectUrl": "https://global.consent.azure-apim.net/redirect",
"scopes": [
"Group.ReadWrite.All offline_access"
]
},
"type": "oauthSetting"
}
},
"iconBrandColor": "#007ee6"
}
}