openapi: 3.2.0 info: title: Operations Hub Core.customers.turbines API version: 0.1.1 description: '' servers: [] tags: - name: core.customers.turbines paths: /api/core/v1/customers/{customer_id}/turbines: get: operationId: list_customer_turbines summary: List Turbines for Customer parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true - in: query name: search schema: anyOf: - type: string - type: 'null' description: Search by name (case-insensitive) title: Search required: false description: Search by name (case-insensitive) - in: query name: sort schema: anyOf: - type: string - type: 'null' description: Sort by field (prefix with - for descending) title: Sort required: false description: Sort by field (prefix with - for descending) - in: query name: turbine_id schema: anyOf: - type: integer - type: 'null' description: Filter by turbine ID title: Turbine Id required: false description: Filter by turbine ID - in: query name: relationship_id schema: anyOf: - type: integer - type: 'null' description: Filter by relationship type ID title: Relationship Id required: false description: Filter by relationship type ID - in: query name: is_virtual schema: anyOf: - type: boolean - type: 'null' description: Filter by virtual turbine title: Is Virtual required: false description: Filter by virtual turbine - in: query name: location_id schema: anyOf: - type: integer - type: 'null' description: Filter by turbine location ID title: Location Id required: false description: Filter by turbine location ID - in: query name: paginate schema: default: true description: Enable pagination (false returns all results) title: Paginate type: boolean required: false description: Enable pagination (false returns all results) - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/CustomerTurbineResponse' title: Response type: array '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' description: List all child items for a parent with pagination, search, and sorting. tags: - core.customers.turbines security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: create_customer_turbine summary: Create Turbine parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomerTurbineResponse' description: Create a new child item for the parent. tags: - core.customers.turbines requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerTurbineCreate' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/core/v1/customers/{customer_id}/turbines/{customer_turbine_id}: get: operationId: get_customer_turbine summary: Get Turbine parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true - in: path name: customer_turbine_id schema: title: Customer Turbine Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomerTurbineResponse' description: Get a single child item. tags: - core.customers.turbines security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: update_customer_turbine summary: Update Turbine parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true - in: path name: customer_turbine_id schema: title: Customer Turbine Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomerTurbineResponse' description: Update a child item. tags: - core.customers.turbines requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerTurbineUpdate' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: delete_customer_turbine summary: Delete Turbine parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true - in: path name: customer_turbine_id schema: title: Customer Turbine Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: Soft delete a child item. tags: - core.customers.turbines security: - APIKeyAuth: [] - CookieAuth: [] components: schemas: CustomerTurbineUpdate: additionalProperties: false description: Schema for updating a CustomerTurbine. properties: turbine_id: anyOf: - type: integer - type: 'null' description: Turbine ID title: Turbine Id relationship_id: anyOf: - type: integer - type: 'null' description: Relationship type ID title: Relationship Id title: CustomerTurbineUpdate type: object LocationObject: additionalProperties: false description: Nested location object for responses (no timestamps). properties: id: title: Id type: integer name: title: Name type: string type: anyOf: - $ref: '#/components/schemas/LocationType' - type: 'null' required: - id - name title: LocationObject type: object LocationType: description: Allowed location type values in location. enum: - WIND_PARK - WAREHOUSE - SERVICE_HUB - PORT - TRAINING_CENTER - FACTORY - OFFICE title: LocationType type: string Error: additionalProperties: false description: Error response schema. properties: code: $ref: '#/components/schemas/ErrorCode' message: title: Message type: string required: - code - message title: Error type: object PositionEnum: description: Enum for turbine component positions. enum: - A - B - C title: PositionEnum type: string CustomerTurbineCreateMode: description: Supported create flows for customer turbines. enum: - share - create title: CustomerTurbineCreateMode type: string TurbineComponentInput: additionalProperties: false description: 'Schema for creating a TurbineComponent as part of Turbine creation. Note: turbine_id and location_id are automatically set from the parent turbine.' properties: component_type_id: description: Component type ID title: Component Type Id type: integer serial_number: description: Serial number minLength: 1 title: Serial Number type: string manufacturer_id: anyOf: - type: integer - type: 'null' description: Manufacturer ID title: Manufacturer Id model_id: anyOf: - type: integer - type: 'null' description: Component model ID title: Model Id length: anyOf: - type: number - type: 'null' description: Component length in meters title: Length position: anyOf: - $ref: '#/components/schemas/PositionEnum' - type: 'null' description: Component position (A, B, or C). Must be NULL when the selected turbine has is_virtual=true; required when is_virtual=false. pair_index: anyOf: - enum: - 1 - 2 type: integer - type: 'null' description: 1 or 2 for paired receptors; NULL for non-paired components. title: Pair Index additional_information: anyOf: - type: object - type: 'null' description: Additional information as JSON title: Additional Information required: - component_type_id - serial_number title: TurbineComponentInput type: object RelationshipTypeObject: additionalProperties: false description: Nested relationship type object for responses (no timestamps). properties: id: title: Id type: integer code: title: Code type: string description: anyOf: - type: string - type: 'null' title: Description required: - id - code title: RelationshipTypeObject type: object CustomerTurbineResponse: additionalProperties: false description: Schema for CustomerTurbine response. properties: updated_at: description: Last update timestamp format: date-time title: Updated At type: string id: description: Customer turbine ID title: Id type: integer customer_id: description: Customer ID title: Customer Id type: integer turbine: $ref: '#/components/schemas/TurbineWithLocationObject' description: Turbine information with location relationship: anyOf: - $ref: '#/components/schemas/RelationshipTypeObject' - type: 'null' description: Relationship type information required: - updated_at - id - customer_id - turbine title: CustomerTurbineResponse type: object CustomerTurbineCreate: additionalProperties: false description: Schema for creating or sharing a turbine in customer context. properties: mode: $ref: '#/components/schemas/CustomerTurbineCreateMode' description: 'Create mode: share an existing turbine or create a new one' turbine_id: anyOf: - type: integer - type: 'null' description: Existing turbine ID. Required when mode=share title: Turbine Id relationship_id: anyOf: - type: integer - type: 'null' description: Relationship type ID. Optional in both modes; when omitted in mode=create the server defaults to the customer's customer_locations.relationship_id for the turbine's location. title: Relationship Id customer_location_id: anyOf: - type: integer - type: 'null' description: Customer location ID. Required when mode=create title: Customer Location Id name: anyOf: - minLength: 1 type: string - type: 'null' description: Turbine name. Required when mode=create title: Name latitude: anyOf: - type: number - type: 'null' description: Latitude coordinate. Required when mode=create title: Latitude longitude: anyOf: - type: number - type: 'null' description: Longitude coordinate. Required when mode=create title: Longitude manufacturer_id: anyOf: - type: integer - type: 'null' description: Manufacturer ID title: Manufacturer Id manufacturer_turbine_model_id: anyOf: - type: integer - type: 'null' description: Turbine model ID title: Manufacturer Turbine Model Id pad_number: anyOf: - type: string - type: 'null' description: Pad number title: Pad Number additional_info: anyOf: - type: string - type: 'null' description: Additional information title: Additional Info efficiency: anyOf: - type: integer - type: 'null' description: Turbine efficiency title: Efficiency commissioning_year: anyOf: - type: integer - type: 'null' description: Year of commissioning title: Commissioning Year output: anyOf: - type: string - type: 'null' description: Turbine output title: Output coordinates: anyOf: - type: string - type: 'null' description: Coordinates string title: Coordinates hub_height: anyOf: - type: number - type: 'null' description: Hub height in meters title: Hub Height rotor_radius: anyOf: - type: number - type: 'null' description: Rotor radius in meters title: Rotor Radius components: anyOf: - items: $ref: '#/components/schemas/TurbineComponentInput' type: array - type: 'null' description: Optional list of turbine components to create title: Components nominal_power: anyOf: - type: number - type: 'null' description: Nominal power in kW title: Nominal Power double_receptors: default: false description: Has double receptors title: Double Receptors type: boolean hv_double_receptors: default: false description: Has HV double receptors title: Hv Double Receptors type: boolean manufacturer_number: anyOf: - type: string - type: 'null' description: Manufacturer number title: Manufacturer Number is_virtual: default: false description: Is virtual turbine title: Is Virtual type: boolean required: - mode title: CustomerTurbineCreate type: object Success: additionalProperties: false description: 'Schema returned for successful operations. The `success` field is always ``true`` in this schema. Failed operations are represented by the :class:`Error` schema instead, so a ``false`` value does not occur in practice. The field is included for consistency across responses and to make the contract explicit for clients.' properties: success: default: true description: Always true for this schema. Errors are represented by a separate Error schema, so false is never returned. title: Success type: boolean title: Success type: object TurbineWithLocationObject: additionalProperties: false description: Nested turbine object with location for customer turbine responses. properties: id: title: Id type: integer name: anyOf: - type: string - type: 'null' title: Name location: anyOf: - $ref: '#/components/schemas/LocationObject' - type: 'null' required: - id title: TurbineWithLocationObject type: object ErrorCode: description: Error codes for API errors. enum: - validation - server - auth - unknown - external - generic title: ErrorCode type: string securitySchemes: APIKeyAuth: type: http scheme: bearer CookieAuth: type: apiKey in: cookie name: opshub_prod_sessionid AuthBearer: type: http scheme: bearer