예제 #1
0
        public IModuleIdentity Create(string moduleId, string generationId, string providerUri)
        {
            Preconditions.CheckNonWhiteSpace(moduleId, nameof(moduleId));
            Preconditions.CheckNonWhiteSpace(generationId, nameof(generationId));
            Preconditions.CheckNonWhiteSpace(providerUri, nameof(providerUri));

            ICredentials credentials = new IdentityProviderServiceCredentials(providerUri, generationId);

            return(new ModuleIdentity(this.iotHubHostName, this.gatewayHostname, this.deviceId, moduleId, credentials));
        }
 public KubernetesModuleIdentity(string iotHubHostname, string gatewayHostname, string deviceId, string moduleId, IdentityProviderServiceCredentials credentials)
 {
     this.IotHubHostname  = Preconditions.CheckNonWhiteSpace(iotHubHostname, nameof(iotHubHostname));
     this.GatewayHostname = gatewayHostname;
     this.DeviceId        = Preconditions.CheckNonWhiteSpace(deviceId, nameof(deviceId));
     this.ModuleId        = Preconditions.CheckNonWhiteSpace(moduleId, nameof(moduleId));
     this.Credentials     = Preconditions.CheckNotNull(credentials, nameof(credentials));
 }