private ServiceOperationManifest GetServiceOperationManifest()

in src/CosmosDB/Providers/CosmosDbServiceOperationProvider.cs [123:233]


        private ServiceOperationManifest GetServiceOperationManifest()
        {
            return new ServiceOperationManifest
            {
                ConnectionReference = new ConnectionReferenceFormat
                {
                    ReferenceKeyFormat = ConnectionReferenceKeyFormat.ServiceProvider,
                },
                Settings = new OperationManifestSettings
                {
                    SecureData = new OperationManifestSettingWithOptions<SecureDataOptions>(),
                    TrackedProperties = new OperationManifestSetting
                    {
                        Scopes = new OperationScope[] { OperationScope.Trigger },
                    },
                },
                InputsLocation = new InputsLocation[]
                {
                    InputsLocation.Inputs,
                    InputsLocation.Parameters,
                },
                Outputs = new SwaggerSchema
                {
                    Type = SwaggerSchemaType.Object,
                    Properties = new OrdinalDictionary<SwaggerSchema>
                    {
                        {
                            "body", new SwaggerSchema
                            {
                                Type = SwaggerSchemaType.Array,
                                Title = "Receive document",
                                Description = "Receive document from Azure Cosmos DB",
                                Items = new SwaggerSchema
                                {
                                    Type = SwaggerSchemaType.Object,
                                    Properties = new OrdinalDictionary<SwaggerSchema>
                                    {
                                        {
                                            "contentData", new SwaggerSchema
                                            {
                                                Type = SwaggerSchemaType.String,
                                                Title = "Content",
                                                Format = "byte",
                                                Description = "content",
                                            }
                                        },
                                        {
                                                "Properties", new SwaggerSchema
                                                {
                                                    Type = SwaggerSchemaType.Object,
                                                    Title = "documentProperties",
                                                    AdditionalProperties = new JObject
                                                    {
                                                        { "type", "object" },
                                                        { "properties", new JObject { } },
                                                        { "required", new JObject { } },
                                                    },
                                                    Description = "Document DB data properties",
                                                }
                                            },
                                        },
                                    },
                                }
                            },
                        },
                },
                Inputs = new SwaggerSchema
                {
                    Type = SwaggerSchemaType.Object,
                    Properties = new OrdinalDictionary<SwaggerSchema>
                    {
                        {
                            "databaseName", new SwaggerSchema
                            {
                                Type = SwaggerSchemaType.String,
                                Title = "Database name",
                                Description = "Database name",
                            }
                        },
                        {
                            "collectionName", new SwaggerSchema
                            {
                                Type = SwaggerSchemaType.String,
                                Title = "Collection name",
                                Description = "Collection name",
                            }
                        },
                        {
                            "connectionStringSetting", new SwaggerSchema
                            {
                                Type = SwaggerSchemaType.String,
                                Title = "Connection String",
                                Default = "CosmosDB-connectionString",
                                Description = "Connection-string",
                            }
                        },
                    },
                    Required = new string[]
                    {
                        "databaseName",
                        "collectionName",
                    },
                },
                Connector = this.GetServiceOperationApi(),
                Trigger = TriggerType.Batch,
                Recurrence = new RecurrenceSetting
                {
                    Type = RecurrenceType.None,
                },
            };
        }