コード例 #1
0
    def list(self, name, service_account_file=""):
        stub = project_billing_info_pb2_grpc.CloudbillingProjectBillingInfoServiceStub(
            channel.Channel()
        )
        request = project_billing_info_pb2.ListCloudbillingProjectBillingInfoRequest()
        request.service_account_file = service_account_file
        request.Name = name

        return stub.ListCloudbillingProjectBillingInfo(request).items
コード例 #2
0
    def delete(self, name, service_account_file=""):
        stub = project_billing_info_pb2_grpc.CloudbillingProjectBillingInfoServiceStub(
            channel.Channel()
        )
        request = project_billing_info_pb2.DeleteCloudbillingProjectBillingInfoRequest()
        request.service_account_file = service_account_file
        request.Name = name

        response = stub.DeleteCloudbillingProjectBillingInfo(request)
コード例 #3
0
    def delete(self):
        stub = project_billing_info_pb2_grpc.CloudbillingProjectBillingInfoServiceStub(
            channel.Channel())
        request = project_billing_info_pb2.DeleteCloudbillingProjectBillingInfoRequest(
        )
        request.service_account_file = self.service_account_file
        if Primitive.to_proto(self.name):
            request.resource.name = Primitive.to_proto(self.name)

        if Primitive.to_proto(self.billing_account_name):
            request.resource.billing_account_name = Primitive.to_proto(
                self.billing_account_name)

        response = stub.DeleteCloudbillingProjectBillingInfo(request)
コード例 #4
0
    def apply(self):
        stub = project_billing_info_pb2_grpc.CloudbillingProjectBillingInfoServiceStub(
            channel.Channel()
        )
        request = project_billing_info_pb2.ApplyCloudbillingProjectBillingInfoRequest()
        if Primitive.to_proto(self.name):
            request.resource.name = Primitive.to_proto(self.name)

        if Primitive.to_proto(self.billing_account_name):
            request.resource.billing_account_name = Primitive.to_proto(
                self.billing_account_name
            )

        request.service_account_file = self.service_account_file

        response = stub.ApplyCloudbillingProjectBillingInfo(request)
        self.name = Primitive.from_proto(response.name)
        self.billing_account_name = Primitive.from_proto(response.billing_account_name)
        self.billing_enabled = Primitive.from_proto(response.billing_enabled)