pulumi/sdk/nodejs/proto/engine_grpc_pb.js
Pat Gavlin 905e7353e4
Update the provider RPC interface (#2512)
These changes add two new methods to the provider interface and extend
the results of three others.

The new methods are `CheckConfig` and `DiffConfig`, which fill out the
set of methods required for a complete implementation of the
first-class provider design. Though these methods are optional for
backwards compatibility, they should be implemented by all future
providers for the best possible user experience.

The adjusted result types are `DiffResponse`, `ReadResponse`, and
`ErrorResourceInitFailed`. The first has been updated to include a list
of the properties that changed (if any). The latter two now include
an estimated set of inputs for the resource as well as the resource's
state. Together, these three changes enable the engine to determine the
set of inputs that should be specified by a user in order to match those
that describe the resource's current state.

This contributes to #2453, #1662, #1635, and #1718.
2019-03-05 10:49:24 -08:00

133 lines
5.2 KiB
JavaScript

// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
// Copyright 2016-2018, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
'use strict';
var grpc = require('grpc');
var engine_pb = require('./engine_pb.js');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
function serialize_google_protobuf_Empty(arg) {
if (!(arg instanceof google_protobuf_empty_pb.Empty)) {
throw new Error('Expected argument of type google.protobuf.Empty');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_google_protobuf_Empty(buffer_arg) {
return google_protobuf_empty_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_GetRootResourceRequest(arg) {
if (!(arg instanceof engine_pb.GetRootResourceRequest)) {
throw new Error('Expected argument of type pulumirpc.GetRootResourceRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_pulumirpc_GetRootResourceRequest(buffer_arg) {
return engine_pb.GetRootResourceRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_GetRootResourceResponse(arg) {
if (!(arg instanceof engine_pb.GetRootResourceResponse)) {
throw new Error('Expected argument of type pulumirpc.GetRootResourceResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_pulumirpc_GetRootResourceResponse(buffer_arg) {
return engine_pb.GetRootResourceResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_LogRequest(arg) {
if (!(arg instanceof engine_pb.LogRequest)) {
throw new Error('Expected argument of type pulumirpc.LogRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_pulumirpc_LogRequest(buffer_arg) {
return engine_pb.LogRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_SetRootResourceRequest(arg) {
if (!(arg instanceof engine_pb.SetRootResourceRequest)) {
throw new Error('Expected argument of type pulumirpc.SetRootResourceRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_pulumirpc_SetRootResourceRequest(buffer_arg) {
return engine_pb.SetRootResourceRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_SetRootResourceResponse(arg) {
if (!(arg instanceof engine_pb.SetRootResourceResponse)) {
throw new Error('Expected argument of type pulumirpc.SetRootResourceResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_pulumirpc_SetRootResourceResponse(buffer_arg) {
return engine_pb.SetRootResourceResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
// Engine is an auxiliary service offered to language and resource provider plugins. Its main purpose today is
// to serve as a common logging endpoint, but it also serves as a state storage mechanism for language hosts
// that can't store their own global state.
var EngineService = exports.EngineService = {
// Log logs a global message in the engine, including errors and warnings.
log: {
path: '/pulumirpc.Engine/Log',
requestStream: false,
responseStream: false,
requestType: engine_pb.LogRequest,
responseType: google_protobuf_empty_pb.Empty,
requestSerialize: serialize_pulumirpc_LogRequest,
requestDeserialize: deserialize_pulumirpc_LogRequest,
responseSerialize: serialize_google_protobuf_Empty,
responseDeserialize: deserialize_google_protobuf_Empty,
},
// GetRootResource gets the URN of the root resource, the resource that should be the root of all
// otherwise-unparented resources.
getRootResource: {
path: '/pulumirpc.Engine/GetRootResource',
requestStream: false,
responseStream: false,
requestType: engine_pb.GetRootResourceRequest,
responseType: engine_pb.GetRootResourceResponse,
requestSerialize: serialize_pulumirpc_GetRootResourceRequest,
requestDeserialize: deserialize_pulumirpc_GetRootResourceRequest,
responseSerialize: serialize_pulumirpc_GetRootResourceResponse,
responseDeserialize: deserialize_pulumirpc_GetRootResourceResponse,
},
// SetRootResource sets the URN of the root resource.
setRootResource: {
path: '/pulumirpc.Engine/SetRootResource',
requestStream: false,
responseStream: false,
requestType: engine_pb.SetRootResourceRequest,
responseType: engine_pb.SetRootResourceResponse,
requestSerialize: serialize_pulumirpc_SetRootResourceRequest,
requestDeserialize: deserialize_pulumirpc_SetRootResourceRequest,
responseSerialize: serialize_pulumirpc_SetRootResourceResponse,
responseDeserialize: deserialize_pulumirpc_SetRootResourceResponse,
},
};
exports.EngineClient = grpc.makeGenericClientConstructor(EngineService);