models.py•20.1 kB
# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T03:09:30+00:00
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
class CancelOperationRequest(BaseModel):
pass
class Empty(BaseModel):
pass
class RunType(Enum):
TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED'
ONE_TIME = 'ONE_TIME'
SCHEDULED = 'SCHEDULED'
class State(Enum):
STATE_UNSPECIFIED = 'STATE_UNSPECIFIED'
RUNNING = 'RUNNING'
SUCCEEDED = 'SUCCEEDED'
FAILED = 'FAILED'
class Execution(BaseModel):
endTime: Optional[str] = Field(
None, description='Output only. [Output only] End time stamp'
)
evaluationId: Optional[str] = Field(
None, description='Output only. [Output only] Evaluation ID'
)
inventoryTime: Optional[str] = Field(
None, description='Output only. [Output only] Inventory time stamp'
)
labels: Optional[Dict[str, str]] = Field(
None, description='Labels as key value pairs'
)
name: Optional[str] = Field(
None,
description='The name of execution resource. The format is projects/{project}/locations/{location}/evaluations/{evaluation}/executions/{execution}',
)
runType: Optional[RunType] = Field(
None,
description='type represent whether the execution executed directly by user or scheduled according evaluation.schedule field.',
)
startTime: Optional[str] = Field(
None, description='Output only. [Output only] Start time stamp'
)
state: Optional[State] = Field(None, description='Output only. [Output only] State')
class GceInstanceFilter(BaseModel):
serviceAccounts: Optional[List[str]] = Field(
None, description='Service account of compute engine'
)
class ListExecutionsResponse(BaseModel):
executions: Optional[List[Execution]] = Field(
None, description='The list of Execution'
)
nextPageToken: Optional[str] = Field(
None,
description='A token identifying a page of results the server should return.',
)
unreachable: Optional[List[str]] = Field(
None, description='Locations that could not be reached.'
)
class Location(BaseModel):
displayName: Optional[str] = Field(
None,
description='The friendly name for this location, typically a nearby city name. For example, "Tokyo".',
)
labels: Optional[Dict[str, str]] = Field(
None,
description='Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}',
)
locationId: Optional[str] = Field(
None,
description='The canonical id for this location. For example: `"us-east1"`.',
)
metadata: Optional[Dict[str, Any]] = Field(
None,
description='Service-specific metadata. For example the available capacity at the given location.',
)
name: Optional[str] = Field(
None,
description='Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"`',
)
class OperationMetadata(BaseModel):
apiVersion: Optional[str] = Field(
None, description='Output only. API version used to start the operation.'
)
createTime: Optional[str] = Field(
None, description='Output only. The time the operation was created.'
)
endTime: Optional[str] = Field(
None, description='Output only. The time the operation finished running.'
)
requestedCancellation: Optional[bool] = Field(
None,
description='Output only. Identifies whether the user has requested cancellation of the operation. Operations that have been cancelled successfully have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.',
)
statusMessage: Optional[str] = Field(
None, description='Output only. Human-readable status of the operation, if any.'
)
target: Optional[str] = Field(
None,
description='Output only. Server-defined resource path for the target of the operation.',
)
verb: Optional[str] = Field(
None, description='Output only. Name of the verb executed by the operation.'
)
class Resource(BaseModel):
name: Optional[str] = Field(None, description='the name of the resource')
serviceAccount: Optional[str] = Field(
None, description='the service account accosiate with resource'
)
type: Optional[str] = Field(None, description='the type of reresource')
class ResourceFilter(BaseModel):
gceInstanceFilter: Optional[GceInstanceFilter] = Field(
None, description='Filter compute engine resource'
)
inclusionLabels: Optional[Dict[str, str]] = Field(
None, description='The label used for filter resource'
)
resourceIdPatterns: Optional[List[str]] = Field(
None, description='The id pattern for filter resource'
)
scopes: Optional[List[str]] = Field(
None, description='The scopes of evaluation resource'
)
class State1(Enum):
STATE_UNSPECIFIED = 'STATE_UNSPECIFIED'
CREATING = 'CREATING'
ACTIVE = 'ACTIVE'
DELETING = 'DELETING'
class ResourceStatus(BaseModel):
rulesNewerVersions: Optional[List[str]] = Field(
None, description='the new version of rule id if exists'
)
state: Optional[State1] = Field(None, description='State of the resource')
class Rule(BaseModel):
description: Optional[str] = Field(
None, description='descrite rule in plain language'
)
displayName: Optional[str] = Field(None, description='the name display in UI')
errorMessage: Optional[str] = Field(
None, description='the message template for rule'
)
name: Optional[str] = Field(None, description='rule name')
primaryCategory: Optional[str] = Field(None, description='the primary category')
remediation: Optional[str] = Field(None, description='the remediation for the rule')
revisionId: Optional[str] = Field(
None, description='Output only. the version of the rule'
)
secondaryCategory: Optional[str] = Field(None, description='the secondary category')
severity: Optional[str] = Field(None, description='the severity of the rule')
uri: Optional[str] = Field(None, description='the docuement url for the rule')
class RunEvaluationRequest(BaseModel):
execution: Optional[Execution] = Field(
None, description='Required. The resource being created'
)
executionId: Optional[str] = Field(
None,
description='Required. Id of the requesting object If auto-generating Id server-side, remove this field and execution_id from the method_signature of Create RPC',
)
requestId: Optional[str] = Field(
None,
description='Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).',
)
class SapDiscoveryMetadata(BaseModel):
customerRegion: Optional[str] = Field(
None,
description="Customer region string for customer's use. Does not represent GCP region.",
)
definedSystem: Optional[str] = Field(
None, description='Customer defined, something like "E-commerce pre prod"'
)
environmentType: Optional[str] = Field(
None, description='Should be "prod", "QA", "dev", "staging", etc.'
)
sapProduct: Optional[str] = Field(None, description='This sap product name')
class ResourceState(Enum):
RESOURCE_STATE_UNSPECIFIED = 'RESOURCE_STATE_UNSPECIFIED'
ADDED = 'ADDED'
UPDATED = 'UPDATED'
REMOVED = 'REMOVED'
REPLACED = 'REPLACED'
MISSING = 'MISSING'
class ResourceType(Enum):
RESOURCE_TYPE_UNSPECIFIED = 'RESOURCE_TYPE_UNSPECIFIED'
COMPUTE = 'COMPUTE'
STORAGE = 'STORAGE'
NETWORK = 'NETWORK'
class SapDiscoveryResource(BaseModel):
relatedResources: Optional[List[str]] = Field(
None, description='A list of resource URIs related to this resource.'
)
resourceKind: Optional[str] = Field(
None, description='ComputeInstance, ComputeDisk, VPC, Bare Metal server, etc.'
)
resourceState: Optional[ResourceState] = Field(
None,
description='Indicates whether this is a new, updated, or missing resource.',
)
resourceType: Optional[ResourceType] = Field(
None, description='The type of this resource.'
)
resourceUri: Optional[str] = Field(
None, description='URI of the resource, includes project, location, and name.'
)
updateTime: Optional[str] = Field(
None,
description='Unix timestamp of when this resource last had its discovery data updated.',
)
class SapValidationType(Enum):
SAP_VALIDATION_TYPE_UNSPECIFIED = 'SAP_VALIDATION_TYPE_UNSPECIFIED'
SYSTEM = 'SYSTEM'
COROSYNC = 'COROSYNC'
PACEMAKER = 'PACEMAKER'
HANA = 'HANA'
NETWEAVER = 'NETWEAVER'
class SapValidationValidationDetail(BaseModel):
details: Optional[Dict[str, str]] = Field(
None, description='The pairs of metrics data: field name & field value.'
)
sapValidationType: Optional[SapValidationType] = Field(
None, description='The SAP system that the validation data is from.'
)
class ScannedResource(BaseModel):
resource: Optional[str] = Field(None, description='resource name')
class Status(BaseModel):
code: Optional[int] = Field(
None,
description='The status code, which should be an enum value of google.rpc.Code.',
)
details: Optional[List[Dict[str, Any]]] = Field(
None,
description='A list of messages that carry the error details. There is a common set of message types for APIs to use.',
)
message: Optional[str] = Field(
None,
description='A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.',
)
class ViolationDetails(BaseModel):
asset: Optional[str] = Field(None, description='the name of asset')
observed: Optional[Dict[str, str]] = Field(None, description='observed')
serviceAccount: Optional[str] = Field(
None, description='the service account associate with resource'
)
class WriteInsightResponse(BaseModel):
pass
class FieldXgafv(Enum):
field_1 = '1'
field_2 = '2'
class Alt(Enum):
json = 'json'
media = 'media'
proto = 'proto'
class Evaluation(BaseModel):
createTime: Optional[str] = Field(
None, description='Output only. [Output only] Create time stamp'
)
description: Optional[str] = Field(
None, description='Description of the Evaluation'
)
labels: Optional[Dict[str, str]] = Field(
None, description='Labels as key value pairs'
)
name: Optional[str] = Field(
None,
description="name of resource names have the form 'projects/{project_id}/locations/{location_id}/evaluations/{evaluation_id}'",
)
resourceFilter: Optional[ResourceFilter] = Field(
None, description='annotations as key value pairs'
)
resourceStatus: Optional[ResourceStatus] = Field(
None, description='Output only. [Output only] The updated rule ids if exist.'
)
ruleNames: Optional[List[str]] = Field(None, description='the name of the rule')
ruleVersions: Optional[List[str]] = Field(
None, description='Output only. [Output only] The updated rule ids if exist.'
)
schedule: Optional[str] = Field(
None,
description='crontab format schedule for scheduled evaluation, example: 0 */3 * * *',
)
updateTime: Optional[str] = Field(
None, description='Output only. [Output only] Update time stamp'
)
class ExecutionResult(BaseModel):
documentationUrl: Optional[str] = Field(
None, description='the document url of the rule'
)
resource: Optional[Resource] = Field(None, description='the violate resource')
rule: Optional[str] = Field(None, description='the rule which violate in execution')
severity: Optional[str] = Field(None, description='severity of violation')
violationDetails: Optional[ViolationDetails] = Field(
None, description='the details of violation in result'
)
violationMessage: Optional[str] = Field(
None, description='the violation message of an execution'
)
class ListEvaluationsResponse(BaseModel):
evaluations: Optional[List[Evaluation]] = Field(
None, description='The list of Evaluation'
)
nextPageToken: Optional[str] = Field(
None,
description='A token identifying a page of results the server should return.',
)
unreachable: Optional[List[str]] = Field(
None, description='Locations that could not be reached.'
)
class ListExecutionResultsResponse(BaseModel):
executionResults: Optional[List[ExecutionResult]] = Field(
None, description='The versions from the specified publisher.'
)
nextPageToken: Optional[str] = Field(
None,
description='A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.',
)
class ListLocationsResponse(BaseModel):
locations: Optional[List[Location]] = Field(
None,
description='A list of locations that matches the specified filter in the request.',
)
nextPageToken: Optional[str] = Field(
None, description='The standard List next-page token.'
)
class ListRulesResponse(BaseModel):
nextPageToken: Optional[str] = Field(
None,
description='A token identifying a page of results the server should return.',
)
rules: Optional[List[Rule]] = Field(None, description='all rules in response')
class ListScannedResourcesResponse(BaseModel):
nextPageToken: Optional[str] = Field(
None,
description='A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.',
)
scannedResources: Optional[List[ScannedResource]] = Field(
None, description='All scanned resources in response'
)
class Operation(BaseModel):
done: Optional[bool] = Field(
None,
description='If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.',
)
error: Optional[Status] = Field(
None,
description='The error result of the operation in case of failure or cancellation.',
)
metadata: Optional[Dict[str, Any]] = Field(
None,
description='Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.',
)
name: Optional[str] = Field(
None,
description='The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.',
)
response: Optional[Dict[str, Any]] = Field(
None,
description='The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.',
)
class SapDiscoveryComponent(BaseModel):
applicationType: Optional[str] = Field(
None, description='The component is a SAP application.'
)
databaseType: Optional[str] = Field(
None, description='The component is a SAP database.'
)
hostProject: Optional[str] = Field(
None, description='Pantheon Project in which the resources reside.'
)
resources: Optional[List[SapDiscoveryResource]] = Field(
None, description='The resources in a component.'
)
sid: Optional[str] = Field(
None,
description='The sap identifier, used by the SAP software and helps differentiate systems for customers.',
)
class SapValidation(BaseModel):
validationDetails: Optional[List[SapValidationValidationDetail]] = Field(
None, description='A list of SAP validation metrics data.'
)
class ListOperationsResponse(BaseModel):
nextPageToken: Optional[str] = Field(
None, description='The standard List next-page token.'
)
operations: Optional[List[Operation]] = Field(
None,
description='A list of operations that matches the specified filter in the request.',
)
class SapDiscovery(BaseModel):
applicationLayer: Optional[SapDiscoveryComponent] = Field(
None, description='An SAP system may run without an application layer.'
)
databaseLayer: Optional[SapDiscoveryComponent] = Field(
None, description='An SAP System must have a database.'
)
metadata: Optional[SapDiscoveryMetadata] = Field(
None, description='The metadata for SAP system discovery data.'
)
systemId: Optional[str] = Field(
None,
description='A combination of database SID, database instance URI and tenant DB name to make a unique identifier per-system.',
)
updateTime: Optional[str] = Field(
None, description='Unix timestamp this system has been updated last.'
)
class Insight(BaseModel):
sapDiscovery: Optional[SapDiscovery] = Field(
None,
description='The insights data for sap system discovery. This is a copy of SAP System proto and should get updated whenever that one changes.',
)
sapValidation: Optional[SapValidation] = Field(
None, description='The insights data for the sap workload validation.'
)
sentTime: Optional[str] = Field(
None, description='Output only. [Output only] Create time stamp'
)
class WriteInsightRequest(BaseModel):
insight: Optional[Insight] = Field(
None, description='Required. The metrics data details.'
)
requestId: Optional[str] = Field(
None,
description='Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).',
)