
io.github.vigoo.zioaws.codestarnotifications.package.scala Maven / Gradle / Ivy
package io.github.vigoo.zioaws
import io.github.vigoo.zioaws.core._
import io.github.vigoo.zioaws.core.aspects._
import io.github.vigoo.zioaws.core.config.AwsConfig
import io.github.vigoo.zioaws.core.httpclient.ServiceHttpCapabilities
import software.amazon.awssdk.services.codestarnotifications.{ CodestarNotificationsAsyncClient, CodestarNotificationsAsyncClientBuilder }
import zio.{ Chunk, Has, IO, ZIO, ZLayer, ZManaged }
import zio.stream.ZStream
import org.reactivestreams.Publisher
import scala.jdk.CollectionConverters._
package object codestarnotifications {
import model._
type CodestarNotifications = Has[CodestarNotifications.Service]
object CodestarNotifications {
trait Service extends AspectSupport[Service] {
val api: CodestarNotificationsAsyncClient
def deleteTarget(request: DeleteTargetRequest): IO[AwsError, DeleteTargetResponse.ReadOnly]
def unsubscribe(request: UnsubscribeRequest): IO[AwsError, UnsubscribeResponse.ReadOnly]
def updateNotificationRule(request: UpdateNotificationRuleRequest): IO[AwsError, UpdateNotificationRuleResponse.ReadOnly]
def listTargets(request: ListTargetsRequest): ZStream[Any, AwsError, TargetSummary.ReadOnly]
def listNotificationRules(request: ListNotificationRulesRequest): ZStream[Any, AwsError, NotificationRuleSummary.ReadOnly]
def describeNotificationRule(request: DescribeNotificationRuleRequest): IO[AwsError, DescribeNotificationRuleResponse.ReadOnly]
def untagResource(request: UntagResourceRequest): IO[AwsError, UntagResourceResponse.ReadOnly]
def listEventTypes(request: ListEventTypesRequest): ZStream[Any, AwsError, EventTypeSummary.ReadOnly]
def listTagsForResource(request: ListTagsForResourceRequest): IO[AwsError, ListTagsForResourceResponse.ReadOnly]
def tagResource(request: TagResourceRequest): IO[AwsError, TagResourceResponse.ReadOnly]
def subscribe(request: SubscribeRequest): IO[AwsError, SubscribeResponse.ReadOnly]
def createNotificationRule(request: CreateNotificationRuleRequest): IO[AwsError, CreateNotificationRuleResponse.ReadOnly]
def deleteNotificationRule(request: DeleteNotificationRuleRequest): IO[AwsError, DeleteNotificationRuleResponse.ReadOnly]
}
}
val live: ZLayer[AwsConfig, Throwable, CodestarNotifications] = customized(identity)
def customized(customization: CodestarNotificationsAsyncClientBuilder => CodestarNotificationsAsyncClientBuilder): ZLayer[AwsConfig, Throwable, CodestarNotifications] = managed(customization).toLayer
def managed(customization: CodestarNotificationsAsyncClientBuilder => CodestarNotificationsAsyncClientBuilder): ZManaged[AwsConfig, Throwable, CodestarNotifications.Service] = for (awsConfig <- ZManaged.service[AwsConfig.Service]; b0 <- awsConfig.configure[CodestarNotificationsAsyncClient, CodestarNotificationsAsyncClientBuilder](CodestarNotificationsAsyncClient.builder()).toManaged_; b1 <- awsConfig.configureHttpClient[CodestarNotificationsAsyncClient, CodestarNotificationsAsyncClientBuilder](b0, ServiceHttpCapabilities(supportsHttp2 = false)).toManaged_; client <- ZIO(customization(b1).build()).toManaged_) yield new CodestarNotificationsImpl(client, AwsCallAspect.identity, ().asInstanceOf[Any])
private class CodestarNotificationsImpl[R](override val api: CodestarNotificationsAsyncClient, override val aspect: AwsCallAspect[R], r: R) extends CodestarNotifications.Service with AwsServiceBase[R, CodestarNotificationsImpl] {
override val serviceName: String = "CodestarNotifications"
override def withAspect[R1](newAspect: AwsCallAspect[R1], r: R1): CodestarNotificationsImpl[R1] = new CodestarNotificationsImpl(api, newAspect, r)
def deleteTarget(request: DeleteTargetRequest): IO[AwsError, DeleteTargetResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.DeleteTargetRequest, software.amazon.awssdk.services.codestarnotifications.model.DeleteTargetResponse]("deleteTarget", api.deleteTarget)(request.buildAwsValue()).map(DeleteTargetResponse.wrap).provide(r)
def unsubscribe(request: UnsubscribeRequest): IO[AwsError, UnsubscribeResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.UnsubscribeRequest, software.amazon.awssdk.services.codestarnotifications.model.UnsubscribeResponse]("unsubscribe", api.unsubscribe)(request.buildAwsValue()).map(UnsubscribeResponse.wrap).provide(r)
def updateNotificationRule(request: UpdateNotificationRuleRequest): IO[AwsError, UpdateNotificationRuleResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.UpdateNotificationRuleRequest, software.amazon.awssdk.services.codestarnotifications.model.UpdateNotificationRuleResponse]("updateNotificationRule", api.updateNotificationRule)(request.buildAwsValue()).map(UpdateNotificationRuleResponse.wrap).provide(r)
def listTargets(request: ListTargetsRequest): ZStream[Any, AwsError, TargetSummary.ReadOnly] = asyncSimplePaginatedRequest[software.amazon.awssdk.services.codestarnotifications.model.ListTargetsRequest, software.amazon.awssdk.services.codestarnotifications.model.ListTargetsResponse, software.amazon.awssdk.services.codestarnotifications.model.TargetSummary]("listTargets", api.listTargets, (r, token) => r.toBuilder().nextToken(token).build(), r => Option(r.nextToken()), r => Chunk.fromIterable(r.targets().asScala))(request.buildAwsValue()).map(item => TargetSummary.wrap(item)).provide(r)
def listNotificationRules(request: ListNotificationRulesRequest): ZStream[Any, AwsError, NotificationRuleSummary.ReadOnly] = asyncSimplePaginatedRequest[software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesRequest, software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesResponse, software.amazon.awssdk.services.codestarnotifications.model.NotificationRuleSummary]("listNotificationRules", api.listNotificationRules, (r, token) => r.toBuilder().nextToken(token).build(), r => Option(r.nextToken()), r => Chunk.fromIterable(r.notificationRules().asScala))(request.buildAwsValue()).map(item => NotificationRuleSummary.wrap(item)).provide(r)
def describeNotificationRule(request: DescribeNotificationRuleRequest): IO[AwsError, DescribeNotificationRuleResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.DescribeNotificationRuleRequest, software.amazon.awssdk.services.codestarnotifications.model.DescribeNotificationRuleResponse]("describeNotificationRule", api.describeNotificationRule)(request.buildAwsValue()).map(DescribeNotificationRuleResponse.wrap).provide(r)
def untagResource(request: UntagResourceRequest): IO[AwsError, UntagResourceResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.UntagResourceRequest, software.amazon.awssdk.services.codestarnotifications.model.UntagResourceResponse]("untagResource", api.untagResource)(request.buildAwsValue()).map(UntagResourceResponse.wrap).provide(r)
def listEventTypes(request: ListEventTypesRequest): ZStream[Any, AwsError, EventTypeSummary.ReadOnly] = asyncSimplePaginatedRequest[software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesRequest, software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesResponse, software.amazon.awssdk.services.codestarnotifications.model.EventTypeSummary]("listEventTypes", api.listEventTypes, (r, token) => r.toBuilder().nextToken(token).build(), r => Option(r.nextToken()), r => Chunk.fromIterable(r.eventTypes().asScala))(request.buildAwsValue()).map(item => EventTypeSummary.wrap(item)).provide(r)
def listTagsForResource(request: ListTagsForResourceRequest): IO[AwsError, ListTagsForResourceResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.ListTagsForResourceRequest, software.amazon.awssdk.services.codestarnotifications.model.ListTagsForResourceResponse]("listTagsForResource", api.listTagsForResource)(request.buildAwsValue()).map(ListTagsForResourceResponse.wrap).provide(r)
def tagResource(request: TagResourceRequest): IO[AwsError, TagResourceResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.TagResourceRequest, software.amazon.awssdk.services.codestarnotifications.model.TagResourceResponse]("tagResource", api.tagResource)(request.buildAwsValue()).map(TagResourceResponse.wrap).provide(r)
def subscribe(request: SubscribeRequest): IO[AwsError, SubscribeResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.SubscribeRequest, software.amazon.awssdk.services.codestarnotifications.model.SubscribeResponse]("subscribe", api.subscribe)(request.buildAwsValue()).map(SubscribeResponse.wrap).provide(r)
def createNotificationRule(request: CreateNotificationRuleRequest): IO[AwsError, CreateNotificationRuleResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.CreateNotificationRuleRequest, software.amazon.awssdk.services.codestarnotifications.model.CreateNotificationRuleResponse]("createNotificationRule", api.createNotificationRule)(request.buildAwsValue()).map(CreateNotificationRuleResponse.wrap).provide(r)
def deleteNotificationRule(request: DeleteNotificationRuleRequest): IO[AwsError, DeleteNotificationRuleResponse.ReadOnly] = asyncRequestResponse[software.amazon.awssdk.services.codestarnotifications.model.DeleteNotificationRuleRequest, software.amazon.awssdk.services.codestarnotifications.model.DeleteNotificationRuleResponse]("deleteNotificationRule", api.deleteNotificationRule)(request.buildAwsValue()).map(DeleteNotificationRuleResponse.wrap).provide(r)
}
def deleteTarget(request: DeleteTargetRequest): ZIO[CodestarNotifications, AwsError, DeleteTargetResponse.ReadOnly] = ZIO.accessM(_.get.deleteTarget(request))
def unsubscribe(request: UnsubscribeRequest): ZIO[CodestarNotifications, AwsError, UnsubscribeResponse.ReadOnly] = ZIO.accessM(_.get.unsubscribe(request))
def updateNotificationRule(request: UpdateNotificationRuleRequest): ZIO[CodestarNotifications, AwsError, UpdateNotificationRuleResponse.ReadOnly] = ZIO.accessM(_.get.updateNotificationRule(request))
def listTargets(request: ListTargetsRequest): ZStream[CodestarNotifications, AwsError, TargetSummary.ReadOnly] = ZStream.accessStream(_.get.listTargets(request))
def listNotificationRules(request: ListNotificationRulesRequest): ZStream[CodestarNotifications, AwsError, NotificationRuleSummary.ReadOnly] = ZStream.accessStream(_.get.listNotificationRules(request))
def describeNotificationRule(request: DescribeNotificationRuleRequest): ZIO[CodestarNotifications, AwsError, DescribeNotificationRuleResponse.ReadOnly] = ZIO.accessM(_.get.describeNotificationRule(request))
def untagResource(request: UntagResourceRequest): ZIO[CodestarNotifications, AwsError, UntagResourceResponse.ReadOnly] = ZIO.accessM(_.get.untagResource(request))
def listEventTypes(request: ListEventTypesRequest): ZStream[CodestarNotifications, AwsError, EventTypeSummary.ReadOnly] = ZStream.accessStream(_.get.listEventTypes(request))
def listTagsForResource(request: ListTagsForResourceRequest): ZIO[CodestarNotifications, AwsError, ListTagsForResourceResponse.ReadOnly] = ZIO.accessM(_.get.listTagsForResource(request))
def tagResource(request: TagResourceRequest): ZIO[CodestarNotifications, AwsError, TagResourceResponse.ReadOnly] = ZIO.accessM(_.get.tagResource(request))
def subscribe(request: SubscribeRequest): ZIO[CodestarNotifications, AwsError, SubscribeResponse.ReadOnly] = ZIO.accessM(_.get.subscribe(request))
def createNotificationRule(request: CreateNotificationRuleRequest): ZIO[CodestarNotifications, AwsError, CreateNotificationRuleResponse.ReadOnly] = ZIO.accessM(_.get.createNotificationRule(request))
def deleteNotificationRule(request: DeleteNotificationRuleRequest): ZIO[CodestarNotifications, AwsError, DeleteNotificationRuleResponse.ReadOnly] = ZIO.accessM(_.get.deleteNotificationRule(request))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy