(apiName string)
| 485 | } |
| 486 | |
| 487 | func DescribeAPI(apiName string) ([]schema.APIResponse, error) { |
| 488 | deployedResource, err := GetDeployedResourceByName(apiName) |
| 489 | if err != nil { |
| 490 | return nil, err |
| 491 | } |
| 492 | |
| 493 | var apiResponse []schema.APIResponse |
| 494 | |
| 495 | switch deployedResource.Kind { |
| 496 | case userconfig.RealtimeAPIKind: |
| 497 | apiResponse, err = realtimeapi.DescribeAPIByName(deployedResource) |
| 498 | if err != nil { |
| 499 | return nil, err |
| 500 | } |
| 501 | case userconfig.AsyncAPIKind: |
| 502 | apiResponse, err = asyncapi.DescribeAPIByName(deployedResource) |
| 503 | if err != nil { |
| 504 | return nil, err |
| 505 | } |
| 506 | default: |
| 507 | return nil, ErrorOperationIsOnlySupportedForKind( |
| 508 | *deployedResource, |
| 509 | userconfig.RealtimeAPIKind, |
| 510 | userconfig.AsyncAPIKind, |
| 511 | ) // unexpected |
| 512 | } |
| 513 | |
| 514 | return apiResponse, nil |
| 515 | } |
no test coverage detected