diff --git a/sns/README.md b/sns/README.md index 238b716c..9ebac002 100644 --- a/sns/README.md +++ b/sns/README.md @@ -17,7 +17,7 @@ npm i @winglibs/sns ```js bring sns; -let client = new sns.MobileClient(); +let client = new sns.MobileNotifications(); test "sending an SMS" { client.publish(PhoneNumber: "+14155552671", Message: "Hello"); diff --git a/sns/aws.w b/sns/aws.w index b055d015..b8a073d4 100644 --- a/sns/aws.w +++ b/sns/aws.w @@ -2,9 +2,9 @@ bring cloud; bring "./types.w" as types; bring aws; -pub class MobileClient_aws impl types.IMobileClient { +pub class MobileNotifications_aws impl types.IMobileNotifications { pub inflight publish(options: types.PublishOptions): types.PublishResult { - return MobileClient_aws._publish(options); + return MobileNotifications_aws._publish(options); } pub onLift(host: std.IInflightHost, ops: Array) { diff --git a/sns/lib.test.w b/sns/lib.test.w index abfefea4..7576d1ab 100644 --- a/sns/lib.test.w +++ b/sns/lib.test.w @@ -1,6 +1,6 @@ bring "./lib.w" as sns; -let client = new sns.MobileClient(); +let client = new sns.MobileNotifications(); test "will send an SMS" { client.publish(PhoneNumber: "+14155552671", Message: "Hello"); diff --git a/sns/lib.w b/sns/lib.w index 50ccb4fc..993a2f4f 100644 --- a/sns/lib.w +++ b/sns/lib.w @@ -3,24 +3,24 @@ bring "./types.w" as types; bring "./sim.w" as sim; bring "./aws.w" as aws; -/// MobileClient is a client for interacting with SNS mobile service. +/// MobileNotifications is a client for interacting with SNS mobile service. /// No cloud resources are created when using this class. /// When running the simulator in a non test environment, it will use the /// actual cloud implementation. -pub class MobileClient impl types.IMobileClient { - inner: types.IMobileClient; +pub class MobileNotifications impl types.IMobileNotifications { + inner: types.IMobileNotifications; new() { let target = util.env("WING_TARGET"); if target == "sim" { if std.Node.of(this).app.isTestEnvironment { - this.inner = new sim.MobileClient_sim(); + this.inner = new sim.MobileNotifications_sim(); } else { - this.inner = new aws.MobileClient_aws(); + this.inner = new aws.MobileNotifications_aws(); } } elif target == "tf-aws" { - this.inner = new aws.MobileClient_aws(); + this.inner = new aws.MobileNotifications_aws(); } elif target == "awscdk" { - this.inner = new aws.MobileClient_aws(); + this.inner = new aws.MobileNotifications_aws(); } else { throw "Unsupported target {target}"; } diff --git a/sns/sim.w b/sns/sim.w index ad549beb..78566dd9 100644 --- a/sns/sim.w +++ b/sns/sim.w @@ -2,7 +2,7 @@ bring cloud; bring util; bring "./types.w" as types; -pub class MobileClient_sim impl types.IMobileClient { +pub class MobileNotifications_sim impl types.IMobileNotifications { store: cloud.Bucket; new() { this.store = new cloud.Bucket() as "Inbox"; diff --git a/sns/types.w b/sns/types.w index 849b28c2..2fe2aa9d 100644 --- a/sns/types.w +++ b/sns/types.w @@ -16,6 +16,6 @@ pub struct PublishResult { SequenceNumber: str?; } -pub interface IMobileClient { +pub interface IMobileNotifications { inflight publish(options: PublishOptions): PublishResult; }