Template format error: Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block of the template

I am trying to make http-proxy work on api gateway. but Serverless template format is not correct and giving unresolved resource dependencies. Can somebody help?

resources:
  Resources:
    ProxyResource:
      Type: AWS::ApiGateway::Resource
      Properties:
        ParentId:
          Fn::GetAtt:
            - "ApiGatewayRestApi"
            - "RootResourceId"
        PathPart: auth-registry-ds/oauth2/token
        RestApiId:
          Ref: "ApiGatewayRestApi"
    ProxyMethod:
      Type: AWS::ApiGateway::Method
      Properties:
        ResourceId:
          Ref: ProxyResource
        RestApiId:
          Ref: "ApiGatewayRestApi"
        HttpMethod: GET # the method of your proxy. Is it GET or POST or ... ?
        MethodResponses:
          - StatusCode: 200
        Integration:
          IntegrationHttpMethod: POST
          Type: HTTP
          Uri: http://internal-ds.com/user
          IntegrationResponses:
            - StatusCode: 200