parameters: (self)
docstring: Get task tiles intersecting with the aoi provided
          ---
          tags:
              - tasks
          produces:
              - application/json
          parameters:
              - in: header
                name: Authorization
                description: Base64 encoded session token
                required: true
                type: string
                default: Token sessionTokenHere==
              - in: body
                name: body
                required: true
                description: JSON object containing aoi and tasks and bool flag for controlling clip grid to aoi
                schema:
                    properties:
                        clipToAoi:
                          type: boolean
                          default: true
                        areaOfInterest:
                            schema:
                                properties:
                                    type:
                                        type: string
                                        default: FeatureCollection
                                    features:
                                        type: array
                                        items:
                                            schema:
                                                $ref: "#/definitions/GeoJsonFeature"
                        grid:
                            schema:
                                properties:
                                    type:
                                        type: string
                                        default: FeatureCollection
                                    features:
                                        type: array
                                        items:
                                            schema:
                                                $ref: "#/definitions/GeoJsonFeature"
          responses:
              200:
                  description: Intersecting tasks found successfully
              400:
                  description: Client Error - Invalid Request
              500:
                  description: Internal Server Error
docstring_summary: Get task tiles intersecting with the aoi provided
          ---
          tags:
              - tasks
          produces:
              - application/json
          parameters:
              - in: header
                name: Authorization
                description: Base64 encoded session token
                required: true
                type: string
                default: Token sessionTokenHere==
              - in: body
                name: body
                required: true
                description: JSON object containing aoi and tasks and bool flag for controlling clip grid to aoi
                schema:
                    properties:
                        clipToAoi:
                          type: boolean
                          default: true
                        areaOfInterest:
                            schema:
                                properties:
                                    type:
                                        type: string
                                        default: FeatureCollection
                                    features:
                                        type: array
                                        items:
                                            schema:
                                                $ref: "#/definitions/GeoJsonFeature"
                        grid:
                            schema:
                                properties:
                                    type:
                                        type: string
                                        default: FeatureCollection
                                    features:
                                        type: array
                                        items:
                                            schema:
                                                $ref: "#/definitions/GeoJsonFeature"
          responses:
              200:
                  description: Intersecting tasks found successfully
              400:
                  description: Client Error - Invalid Request
              500:
                  description: Internal Server Error
docstring_tokens: Get task tiles intersecting with the aoi provided --- tags : - tasks produces : - application / json parameters : - in : header name : Authorization description : Base64 encoded session token required : true type : string default : Token sessionTokenHere == - in : body name : body required : true description : JSON object containing aoi and tasks and bool flag for controlling clip grid to aoi schema : properties : clipToAoi : type : boolean default : true areaOfInterest : schema : properties : type : type : string default : FeatureCollection features : type : array items : schema : $ref : # / definitions / GeoJsonFeature grid : schema : properties : type : type : string default : FeatureCollection features : type : array items : schema : $ref : # / definitions / GeoJsonFeature responses : 200 : description : Intersecting tasks found successfully 400 : description : Client Error - Invalid Request 500 : description : Internal Server Error
function: def put(self):
          """
          Get task tiles intersecting with the aoi provided
          ---
          tags:
              - tasks
          produces:
              - application/json
          parameters:
              - in: header
                name: Authorization
                description: Base64 encoded session token
                required: true
                type: string
                default: Token sessionTokenHere==
              - in: body
                name: body
                required: true
                description: JSON object containing aoi and tasks and bool flag for controlling clip grid to aoi
                schema:
                    properties:
                        clipToAoi:
                          type: boolean
                          default: true
                        areaOfInterest:
                            schema:
                                properties:
                                    type:
                                        type: string
                                        default: FeatureCollection
                                    features:
                                        type: array
                                        items:
                                            schema:
                                                $ref: "#/definitions/GeoJsonFeature"
                        grid:
                            schema:
                                properties:
                                    type:
                                        type: string
                                        default: FeatureCollection
                                    features:
                                        type: array
                                        items:
                                            schema:
                                                $ref: "#/definitions/GeoJsonFeature"
          responses:
              200:
                  description: Intersecting tasks found successfully
              400:
                  description: Client Error - Invalid Request
              500:
                  description: Internal Server Error
          """
          try:
              grid_dto = GridDTO(request.get_json())
              grid_dto.validate()
          except DataError as e:
              current_app.logger.error(f"error validating request: {str(e)}")
              return {"Error": "Unable to fetch tiles interesecting AOI"}, 400
  
          try:
              grid = GridService.trim_grid_to_aoi(grid_dto)
              return grid, 200
          except InvalidGeoJson as e:
              return {"Error": f"{str(e)}"}, 400
          except Exception as e:
              error_msg = f"TasksQueriesAoiAPI - unhandled error: {str(e)}"
              current_app.logger.critical(error_msg)
              return {"Error": "Unable to fetch tiles intersecting AOI"}, 500
function_tokens: def put ( self ) : try : grid_dto = GridDTO ( request . get_json ( ) ) grid_dto . validate ( ) except DataError as e : current_app . logger . error ( f"error validating request: {str(e)}" ) return { "Error" : "Unable to fetch tiles interesecting AOI" } , 400 try : grid = GridService . trim_grid_to_aoi ( grid_dto ) return grid , 200 except InvalidGeoJson as e : return { "Error" : f"{str(e)}" } , 400 except Exception as e : error_msg = f"TasksQueriesAoiAPI - unhandled error: {str(e)}" current_app . logger . critical ( error_msg ) return { "Error" : "Unable to fetch tiles intersecting AOI" } , 500